test(canvas/chat): add AttachmentLightbox coverage (13 cases) #653

Closed
app-fe wants to merge 1 commits from test/attachment-lightbox-clean-v2 into main
Member

Summary

  • Add AttachmentLightbox.test.tsx with 13 test cases covering:
    • Render states: open=false, role=dialog, aria-modal, aria-label, close button, children, reduced-motion
    • Interaction: close button click, backdrop click (calls onClose), content click (stopPropagation), Escape key, other keys
    • Focus: focus trap to close button on open, focus restore to previous element on close

Test plan

  • npx vitest run src/components/tabs/chat/__tests__/AttachmentLightbox.test.tsx — 13/13 pass
  • npm run build — clean

🤖 Generated with Claude Code

## Summary - Add AttachmentLightbox.test.tsx with 13 test cases covering: - Render states: open=false, role=dialog, aria-modal, aria-label, close button, children, reduced-motion - Interaction: close button click, backdrop click (calls onClose), content click (stopPropagation), Escape key, other keys - Focus: focus trap to close button on open, focus restore to previous element on close ## Test plan - [x] `npx vitest run src/components/tabs/chat/__tests__/AttachmentLightbox.test.tsx` — 13/13 pass - [x] `npm run build` — clean 🤖 Generated with [Claude Code](https://claude.com/claude-code)
app-fe added 1 commit 2026-05-12 03:51:28 +00:00
test(canvas/chat): add AttachmentLightbox coverage (13 cases)
All checks were successful
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 32s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 35s
E2E API Smoke Test / detect-changes (pull_request) Successful in 44s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 35s
Harness Replays / detect-changes (pull_request) Successful in 15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 13s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 32s
qa-review / approved (pull_request) Successful in 17s
security-review / approved (pull_request) Successful in 15s
sop-tier-check / tier-check (pull_request) Successful in 16s
gate-check-v3 / gate-check (pull_request) Successful in 24s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 7s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 8s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 10s
Harness Replays / Harness Replays (pull_request) Successful in 7s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 8s
CI / Canvas (Next.js) (pull_request) Successful in 8m1s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 1s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7m34s
4e146e3793
Covers:
- Does not render when open=false
- Renders dialog with role=dialog and aria-modal
- Renders with provided aria-label
- Close button has aria-label="Close preview"
- Click backdrop calls onClose; content click does not
- Escape key calls onClose; other keys do not
- Focus moves to close button when opened
- Focus restores to previous element when closed
- Reduced-motion class on backdrop
- Renders children inside the modal

Per RFC #2991 Phase 2: this is the third-caller justification for
the abstraction (image, PDF, future video-fullscreen all want the
same modal contract).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Author
Member

PR Summary

Clean branch: 1 file (214 lines), 13 test cases, no CI changes.

Test coverage:

  • Render: open=false, role=dialog, aria-modal, aria-label, close button label, children, motion-reduce class
  • Interaction: backdrop click → onClose, content click → stopPropagation, Escape → onClose, other keys → no-op
  • Focus: focus moves to close button on open, restores to previous element on close

Verified:

  • npx vitest run src/components/tabs/chat/__tests__/AttachmentLightbox.test.tsx — 13/13 pass
  • npm run build — clean

Reviewers: @hongming-pc2, @core-qa

🤖 Generated with Claude Code

## PR Summary Clean branch: 1 file (214 lines), 13 test cases, no CI changes. **Test coverage:** - Render: open=false, role=dialog, aria-modal, aria-label, close button label, children, motion-reduce class - Interaction: backdrop click → onClose, content click → stopPropagation, Escape → onClose, other keys → no-op - Focus: focus moves to close button on open, restores to previous element on close **Verified:** - `npx vitest run src/components/tabs/chat/__tests__/AttachmentLightbox.test.tsx` — 13/13 pass - `npm run build` — clean Reviewers: @hongming-pc2, @core-qa 🤖 Generated with [Claude Code](https://claude.com/claude-code)
core-uiux closed this pull request 2026-05-12 03:53:01 +00:00
Some checks are pending
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 32s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 35s
E2E API Smoke Test / detect-changes (pull_request) Successful in 44s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 35s
Harness Replays / detect-changes (pull_request) Successful in 15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 13s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 32s
qa-review / approved (pull_request) Successful in 17s
security-review / approved (pull_request) Successful in 15s
sop-tier-check / tier-check (pull_request) Successful in 16s
gate-check-v3 / gate-check (pull_request) Successful in 24s
audit-force-merge / audit (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 7s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
CI / Python Lint & Test (pull_request) Successful in 8s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 8s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 10s
Harness Replays / Harness Replays (pull_request) Successful in 7s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 8s
CI / Canvas (Next.js) (pull_request) Successful in 8m1s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / all-required (pull_request) Successful in 1s
Required
Details
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7m34s
sop-checklist / all-items-acked (pull_request)
Required

Pull request closed

Sign in to join this conversation.
No description provided.