Skip to content

test: add unit tests for ColorLegend mark#373

Merged
gka merged 2 commits intosvelteplot:mainfrom
ljodea:test/colorlegend-158
Feb 18, 2026
Merged

test: add unit tests for ColorLegend mark#373
gka merged 2 commits intosvelteplot:mainfrom
ljodea:test/colorlegend-158

Conversation

@ljodea
Copy link
Copy Markdown
Collaborator

@ljodea ljodea commented Feb 15, 2026

Summary

  • Adds 8 unit tests for the ColorLegend mark component, closing Add unit tests for ColorLegend mark #158
  • Tests cover ordinal legend rendering (item count, labels, distinct swatch colors), symbol path redundancy, legend title, visibility gate (no color scale active), continuous gradient rendering, and single-category edge case
  • Uses a Dot+Plot harness pattern to implicitly trigger ColorLegend via color: { legend: true }

Test plan

  • All 8 new tests pass (npm run test:unit -- --run src/tests/colorLegend.test.svelte.ts)
  • Full test suite passes (459 tests, 0 failures)
  • Lint clean (npm run lint)

Closes #158

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 15, 2026

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit 9e45242
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/6993d87aae3eba0008a24393
😎 Deploy Preview https://deploy-preview-373--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gka gka merged commit 3af387c into svelteplot:main Feb 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for ColorLegend mark

2 participants