test(mail): add regression coverage for mobile navigation #1071
Open
real-venus wants to merge 1 commit into
Open
test(mail): add regression coverage for mobile navigation #1071real-venus wants to merge 1 commit into
real-venus wants to merge 1 commit into
Conversation
Add focused tests for the existing mobile/small-screen navigation surface (issue Stellar-Mail#979), keeping all work inside current app paths. - Extract two small pure helpers so behavior is testable without a DOM: - isMobileViewport / MOBILE_BREAKPOINT in hooks/use-mobile.tsx - BOTTOM_NAV_ITEMS / isBottomNavItemActive for the bottom bar - BottomNavigation consumes the descriptors (rendering unchanged) and now sets aria-current="page" on the active tab plus an accessible nav label. - Unit tests (vitest): breakpoint predicate (below/above + 768px boundary + degenerate widths) and bottom-nav active-state contract (success + edge + action-only tabs never active). - Playwright spec: mobile-viewport flow — bottom bar shown / sidebar hidden, tapping a folder tab switches the mailbox, action tabs stay inactive. Fixtures stay fake and deterministic; tests assert user-visible outcomes and stable helper contracts. Unit suite passes (448). The Playwright spec is not run here: this sandbox lacks the pinned Playwright browser binary (chromium_headless_shell-1148); it runs once `playwright install` is available.
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.
Summary
Adds focused regression coverage for the existing Mobile Navigation surface (issue #979) — bottom navigation, sidebar collapse boundary, and the responsive switch. Scoped to existing app paths; no new tool or feature. Two small pure helpers were extracted so the behavior is testable without a DOM, and the bottom bar gained minor accessibility attributes.
Closes #979
Changes
isMobileViewport(width)+MOBILE_BREAKPOINTinsrc/hooks/use-mobile.tsx; the hook now delegates to it (behavior unchanged). Boundary aligns with Tailwind'smd(768px).src/components/mail/bottom-navigation-items.tswithBOTTOM_NAV_ITEMSdescriptors and a pureisBottomNavItemActive()so the active-tab logic is a stable, testable contract.aria-current="page"on the active tab and an accessiblearia-label="Bottom navigation"on the nav.