Skip to content

Add unit tests for RuleX/Y marks#353

Merged
gka merged 4 commits into
mainfrom
copilot/add-unit-tests-rulex-y
Feb 17, 2026
Merged

Add unit tests for RuleX/Y marks#353
gka merged 4 commits into
mainfrom
copilot/add-unit-tests-rulex-y

Conversation

Copilot AI commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

RuleX and RuleY marks lacked test coverage. This PR adds comprehensive unit tests for both marks.

Test Coverage

22 tests added (11 per mark) covering:

  • Basic rendering and positioning (vertical rules for RuleX, horizontal for RuleY)
  • Stroke styling (color, opacity, dasharray)
  • Inset properties (general inset, directional insetTop/Bottom and insetLeft/Right)
  • Position offsets (dx/dy)
  • Custom range endpoints (y1/y2 for RuleX, x1/x2 for RuleY)
  • Canvas mode rendering
  • Accessor function indices
  • Edge cases (empty data, raw value arrays)

Implementation

Tests follow existing mark test patterns (TickX/Y, GridX/Y):

  • Svelte component wrappers for rendering in test Plot components
  • DOM queries and attribute validation
  • Vitest + @testing-library/svelte

Files added:

  • src/tests/ruleX.test.svelte + src/tests/ruleX.test.ts
  • src/tests/ruleY.test.svelte + src/tests/ruleY.test.ts
Original prompt

This section details on the original issue you should resolve

<issue_title>Add unit tests for RuleX/Y marks</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify

netlify Bot commented Feb 8, 2026

Copy link
Copy Markdown

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit ee4dff1
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/6994569055f1de0008cc932b
😎 Deploy Preview https://deploy-preview-353--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.

Copilot AI changed the title [WIP] Add unit tests for RuleX/Y marks Add unit tests for RuleX/Y marks Feb 8, 2026
Copilot AI requested a review from gka February 8, 2026 13:11
@gka gka marked this pull request as ready for review February 17, 2026 11:52
@gka gka merged commit d1ae2b1 into main Feb 17, 2026
8 checks passed
@gka gka deleted the copilot/add-unit-tests-rulex-y branch February 17, 2026 11:59
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 RuleX/Y marks

2 participants