From 0e2d255d81d15f2399a6c8b02a5bf8e8134dfdcc Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 17 Sep 2026 22:03:52 +0200 Subject: [PATCH] test(roadtrip): find the phone's navigate link by its state, not its label The Up next card stopped printing a fixed key when the audit replaced the nonexistent places.navigate with the single navigation target's own name, so the assertion went looking for text that no longer exists and took the 4.3.0 branch red. The link is found by aria-disabled now, which is what the test is actually about. --- client/tests/unit/mobile/trip/MRoadtripTab.test.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/tests/unit/mobile/trip/MRoadtripTab.test.tsx b/client/tests/unit/mobile/trip/MRoadtripTab.test.tsx index e5119f827..b755b89a3 100644 --- a/client/tests/unit/mobile/trip/MRoadtripTab.test.tsx +++ b/client/tests/unit/mobile/trip/MRoadtripTab.test.tsx @@ -480,12 +480,15 @@ describe('MRoadtripTab', () => { it('FE-MOB-RTTAB-018: leaves the navigate link dead when the stop has no place row behind it', () => { const date = freezeAt(7, 0) + // Found by the attribute, not by a label: the button carries the single navigation + // target's own name when there is exactly one, and a translated word otherwise, so + // its text depends on which map apps a place qualifies for. const enabled = renderTab(planner(today(date))) - expect(screen.getByText('places.navigate').closest('a')).toHaveAttribute('aria-disabled', 'false') + expect(enabled.container.querySelector('a[aria-disabled]')).toHaveAttribute('aria-disabled', 'false') enabled.unmount() - renderTab(planner({ ...today(date), places: [] })) - const link = screen.getByText('places.navigate').closest('a') as HTMLElement + const { container } = renderTab(planner({ ...today(date), places: [] })) + const link = container.querySelector('a[aria-disabled]') as HTMLElement expect(link).toHaveAttribute('aria-disabled', 'true') expect(link).toHaveAttribute('href', '#') })