Skip to content

Comments

feat(other): add unit and e2e tests for info modal route (#657)#703

Merged
mahula merged 1 commit intofeature/info-modal-routefrom
test/info-modal-route
Feb 6, 2026
Merged

feat(other): add unit and e2e tests for info modal route (#657)#703
mahula merged 1 commit intofeature/info-modal-routefrom
test/info-modal-route

Conversation

@mahula
Copy link
Collaborator

@mahula mahula commented Feb 6, 2026

Test coverage and CR1 fix for PR #657

Bug fix (CR1 from review)

  • Remove setTimeout firing after unmount in ModalContent.tsx
  • Remove resulting unused setChapter

Unit Tests (Vitest) — InfoRedirect.spec.tsx (5 tests)

  • U1: Navigates to /info when enabled and pathname is /
  • U2: Does not navigate when enabled=false
  • U3: Does not navigate when pathname ≠ /
  • U4: Only navigates once (useRef guard)
  • U5: Renders nothing (returns null)

E2E Tests (Cypress) — info-modal.cy.ts (4 tests)

  • E1: Visiting /info renders the modal
  • E2: NavBar ? icon navigates to /info
  • E3: ✕ button closes modal and navigates to /
  • E4: Content "Close" button closes modal and navigates to /

Design decisions


Pull Request opened by Augment Code with guidance from the PR author

@mahula mahula self-assigned this Feb 6, 2026
@mahula mahula changed the title test: add unit and E2E tests for info modal route (#657) feat(other): add unit and e2e tests for info modal route (#657) Feb 6, 2026
@mahula
Copy link
Collaborator Author

mahula commented Feb 6, 2026

augment review

@augmentcode
Copy link

augmentcode bot commented Feb 6, 2026

🤖 Augment PR Summary

Summary: Improves coverage and stability around the route-based Info modal introduced earlier.

Changes:

  • Removes a post-unmount setTimeout from ModalContent to avoid delayed state updates after closing
  • Adds Vitest unit tests for InfoRedirect to validate one-time redirect behavior to /info
  • Adds Cypress E2E tests covering opening/closing the /info modal via direct navigation and the NavBar link

Technical Notes: E2E assertions rely on the overlay’s Tailwind utility classes (tw:card, tw:backdrop-brightness-75) and validate both close mechanisms route back to /.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

- Remove setTimeout firing after unmount in ModalContent (CR1)
- 4 Vitest unit tests for InfoRedirect guard logic
- 3 Cypress E2E tests for route, navigation, and close flow
- Restore window.location in afterEach to prevent cross-suite leaks
@mahula mahula force-pushed the test/info-modal-route branch from a13d1b5 to 9c2b111 Compare February 6, 2026 19:56
@mahula mahula requested a review from antontranelis February 6, 2026 19:57
@mahula mahula merged commit 3f9fa30 into feature/info-modal-route Feb 6, 2026
28 checks passed
@mahula mahula deleted the test/info-modal-route branch February 6, 2026 20:01
@mahula mahula restored the test/info-modal-route branch February 6, 2026 22:43
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