Skip to content

test(contour): add spline Shift-hole test - #6336

Open
diattamo wants to merge 2 commits into
OHIF:masterfrom
diattamo:test/spline-shift-hole
Open

diattamo wants to merge 2 commits into
OHIF:masterfrom
diattamo:test/spline-shift-hole

Conversation

@diattamo

@diattamo diattamo commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Context

Adds E2E coverage for cutting a hole into a spline contour. If you hold Shift while drawing a stroke fully inside an existing contour in the same segment, the stroke cuts a hole in that contour. SplineContourSegmentation.spec.ts (#6117) already covers the case where a Shift stroke overlaps a contour's edge and carves part of it away. It had no test for a stroke that falls entirely inside the contour.

Changes & Results

Shift stroke inside a spline contour cuts a hole (SplineContourSegmentation.spec.ts)

  • Draws a spline contour (clickShape), then holds Shift and draws a second spline (holeClickShape) fully inside it.
  • Asserts that the viewport still has one path element and that its d attribute has exactly two subpaths (two M commands), one for the outline and one for the hole. The hole becomes part of the contour's own path, not a second path element.
  • Finishes with a viewport screenshot that confirms the fill is cut out in the middle.

Supporting changes

  • holeClickShape and the twoSubpathsD matcher are spec-level constants.
  • New screenShotPaths.splineContourSegmentation.contourWithHole entry and its baseline, contourWithHole.png.

Testing

pnpm run test:e2e tests/SplineContourSegmentation.spec.ts

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: macOS 26.5.1
  • Node version: 25.4.0
  • Browser: Playwright 1.56.1 bundled Chromium

Summary by CodeRabbit

  • Tests
    • Added coverage for drawing a fully contained shape inside a spline contour while holding Shift, verifying it appears as a hole in the resulting path.
    • Added a screenshot check for the rendered contour and hole.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@netlify

netlify Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit fb76728
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6ac6517713963e0008101a7c
😎 Deploy Preview https://deploy-preview-6336--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f77b1384-ce3a-4c90-8f5c-1e941bfa3508
📥 Commits

Reviewing files that changed from the base of the PR and between 25561d8 and fb76728.

📒 Files selected for processing (1)
  • tests/utils/screenShotPaths.ts
💤 Files with no reviewable changes (1)
  • tests/utils/screenShotPaths.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The test suite adds a case for drawing a fully contained Shift stroke inside an outer spline contour. The test checks that one visible SVG path has exactly two subpaths and captures a screenshot.

Changes

Spline Contour Segmentation Test

Layer / File(s) Summary
Contained Shift-stroke test
tests/SplineContourSegmentation.spec.ts, tests/utils/screenShotPaths.ts
Adds a contained test shape and a test that checks the SVG path for exactly two subpaths after a contained Shift stroke. Registers the screenshot path for the result.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to fb767

This PR adds test coverage for cutting a hole in a spline contour. It doesn't change production behavior, and no merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the change as a test for Shift-created holes in spline contours and follows the repository’s semantic-release format.
Description check ✅ Passed The description covers the context, changes, testing command, checklist, and tested environment. It provides enough detail to understand and validate the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@diattamo
diattamo deployed to unrestricted October 7, 2026 14:04 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
unrestricted — fb767286 Deployed Oct 7, 2026 by diattamo via playwright-tests (24.15.0) #5184
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.

1 participant