Skip to content

chore(dropzone): test suites#6448

Open
cdransf wants to merge 4 commits into
cdransf/s2-dropzone-migration-full-fidelityfrom
cdransf/s2-dropzone-migration-testing
Open

chore(dropzone): test suites#6448
cdransf wants to merge 4 commits into
cdransf/s2-dropzone-migration-full-fidelityfrom
cdransf/s2-dropzone-migration-testing

Conversation

@cdransf

@cdransf cdransf commented Jun 23, 2026

Copy link
Copy Markdown
Member

Description

Adds Phase 6 test coverage for the 2nd-gen <swc-dropzone> component migration. Two new files are introduced:

  • test/dropzone.test.ts — 13 Storybook Vitest play-function stories covering the full drag lifecycle, status region transitions, size reflection, drop-effect validation, and dev-mode accessible-name warnings
  • test/dropzone.a11y.spec.ts — 6 Playwright ARIA snapshot tests verifying role, accessible name, status region announcements across all four states (default, dragged, filled, filled-and-dragged), keyboard focus behavior, and tab order

Motivation and context

Phase 5 (styling) is complete. These tests close the Phase 6 gate before documentation work begins in Phase 7. They also add an explicit non-regression test for the dragover path always calling event.preventDefault(), and cover the dev-mode warning when no accessible name is provided.

Related issue(s)

  • fixes SWC-2150

Screenshots (if appropriate)

N/A — test-only change

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Vitest play functions pass in headless Chromium

    1. Run yarn test --story-path=dropzone (or equivalent)
    2. Confirm all 13 play-function stories in Drop Zone/Tests pass without timeout
    3. Confirm no console warnings appear from non-warning stories
  • Playwright ARIA snapshots pass

    1. Run yarn test:a11y targeting the drop-zone stories
    2. Confirm all 6 ARIA snapshot tests pass
    3. Confirm the status region announces correctly in dragged, filled, and filled-and-dragged states
  • No regressions in the States story

    1. Open Storybook → Drop Zone → States
    2. Confirm all four variants render with correct visual state (default, dragged, filled, filled-and-dragged)
    3. Confirm the filled state hides the illustrated message

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard (test-only PR; no interactive behavior changed)

    1. Open Storybook → Drop Zone → Overview
    2. Press Tab once; confirm focus lands on the "Browse files" button, not the swc-dropzone host
    3. Confirm the focus ring is visible on the button
    4. Confirm no focus trap exists (pressing Tab again moves focus past the component)
  • Screen reader (covered by Playwright ARIA snapshot tests)

    1. Open Storybook → Drop Zone → States
    2. Navigate to the dragged drop zone; confirm VoiceOver/NVDA announces group "Dragged drop zone" and reads the status region content "File ready to drop"
    3. Navigate to the filled drop zone; confirm the status region announces "File accepted"
    4. Navigate to the filled-and-dragged drop zone; confirm the status region announces "Drop to replace existing file"
    5. Confirm the default drop zone's status region is empty and not announced

@cdransf cdransf self-assigned this Jun 23, 2026
@cdransf cdransf requested a review from a team as a code owner June 23, 2026 23:07
@cdransf cdransf added the Spectrum 2 Issues related to Spectrum 2 label Jun 23, 2026
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b1b8d64

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6448

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch 2 times, most recently from 827c525 to 144aaeb Compare June 23, 2026 23:52
@cdransf cdransf added Status:WIP PR is a work in progress or draft do-not-merge NO MERGE-Y! labels Jun 23, 2026
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 607abae to 26dc7e5 Compare June 24, 2026 15:58
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 144aaeb to 7fd8372 Compare June 24, 2026 15:58
@cdransf cdransf added Status:Ready for review PR ready for review or re-review. and removed Status:WIP PR is a work in progress or draft do-not-merge NO MERGE-Y! labels Jun 24, 2026
@cdransf cdransf mentioned this pull request Jun 24, 2026
21 tasks
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 26dc7e5 to 87928fd Compare June 24, 2026 20:45
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch 3 times, most recently from a2bf987 to b10a35e Compare June 24, 2026 23:13
@cdransf cdransf added Status:Blocked PR is blocked for some reason and removed Status:Ready for review PR ready for review or re-review. labels Jun 25, 2026
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 15ada21 to 972adaa Compare June 25, 2026 21:15
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from b10a35e to 13cc926 Compare June 25, 2026 21:15
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 972adaa to a32b450 Compare June 26, 2026 17:07
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 440d0d8 to af0429e Compare July 6, 2026 15:09
@cdransf cdransf added Status:Ready for review PR ready for review or re-review. and removed Status:Blocked PR is blocked for some reason labels Jul 6, 2026
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from aa81723 to a764c2f Compare July 6, 2026 16:47
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from af0429e to 2a005c1 Compare July 6, 2026 16:47
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from d79fa33 to 557ff9e Compare July 6, 2026 19:49
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 2a005c1 to 9adcecd Compare July 6, 2026 19:49

@rise-erpelding rise-erpelding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of small suggestions!

Also, do you want to update the migration plan here to check off items related to testing?

Comment thread 2nd-gen/packages/swc/components/dropzone/test/dropzone.test.ts
Comment thread 2nd-gen/packages/swc/components/dropzone/test/dropzone.test.ts
@cdransf

cdransf commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

A couple of small suggestions!

Also, do you want to update the migration plan here to check off items related to testing?

Yes! Updated. ✨

@cdransf cdransf requested a review from rise-erpelding July 6, 2026 23:19

@rise-erpelding rise-erpelding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks great!

@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 64d5bf2 to 72a9855 Compare July 7, 2026 16:30
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch 2 times, most recently from 5f0439f to 439a3ee Compare July 7, 2026 20:35
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 72a9855 to 1acb11b Compare July 7, 2026 20:40
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 439a3ee to 19eb783 Compare July 7, 2026 20:42
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 1acb11b to c672ab3 Compare July 7, 2026 20:42
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 80fda76 to a0ead09 Compare July 8, 2026 18:02
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from c672ab3 to 50e1c55 Compare July 8, 2026 18:03
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from a0ead09 to 06e8fcf Compare July 9, 2026 21:17
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 50e1c55 to 495b0c5 Compare July 9, 2026 21:17
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 06e8fcf to 0f8a012 Compare July 10, 2026 19:12
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 495b0c5 to 41822e2 Compare July 10, 2026 19:13
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 0f8a012 to 1b9fe4e Compare July 13, 2026 19:14
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from 41822e2 to b1b8d64 Compare July 13, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component:Dropzone Spectrum 2 Issues related to Spectrum 2 Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants