Skip to content

chore(dropzone): test suites#6448

Open
cdransf wants to merge 1 commit into
cdransf/s2-dropzone-migration-full-fidelityfrom
cdransf/s2-dropzone-migration-testing
Open

chore(dropzone): test suites#6448
cdransf wants to merge 1 commit 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: 440d0d8

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

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 First Generation 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 13cc926 to f097fdd Compare June 26, 2026 17:12
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-testing branch from f097fdd to 440d0d8 Compare June 26, 2026 18:28
@cdransf cdransf force-pushed the cdransf/s2-dropzone-migration-full-fidelity branch from 5096f04 to 65c7ab4 Compare June 26, 2026 22:11
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:Blocked PR is blocked for some reason

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant