feat(other): add unit and e2e tests for info modal route (#657)#704
Open
feat(other): add unit and e2e tests for info modal route (#657)#704
Conversation
- Move Modal from always-rendered to route-based rendering at /info - Update Modal component to use MapOverlayPage instead of dialog element - Update ModalContent to use useNavigate for closing (navigates to /) - Add automatic redirect to /info when map.info_open is true on first load This change makes the info modal accessible via URL and improves the architecture by using the existing routing system. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add InfoRedirect component for one-time redirect to /info on page load - Simplify Modal component to pure presentation (remove redirect logic) - Change NavBar info button from showModal() to Link to /info route - Remove unused window.my_modal_3 global type declaration - Fix modal centering by removing conflicting position classes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 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
Collaborator
Author
|
Already merge into #657 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test coverage for #657
Unit Tests (Vitest) —
InfoRedirect.spec.tsx(5 tests)/infowhen enabled and pathname is/enabled=false/E2E Tests (Cypress) —
info-modal.cy.ts(4 tests)/inforenders the modal?icon navigates to/info//Design decisions
Modal.tsx: Zero-logic wrapper, tested implicitly via E2E