mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 13:23:04 +00:00
fix(tours): keep a multi-day tour's days in sight in the list row
The stage count sat in the row's fixed-height line of badges, so a tour with stages and a recorded track wrapped and lost its days badge. The count now sits on the fold button, a moon with the number at its corner, or beside the row where it does not unfold, and the days come before the measures so the ascent is what gets cut.
This commit is contained in:
@@ -137,6 +137,12 @@ describe('TourPlannerToursRail', () => {
|
||||
const hutToHut = { ...tour, place_id: 43, name: 'Hut to hut', stage_count: 2 }
|
||||
render(<TourPlannerToursRail planner={planner({ mode: { type: 'new-draft' } })} tours={[tour, hutToHut]} {...railProps} />)
|
||||
expect(screen.getAllByRole('button', { name: 'Show stages' })).toHaveLength(1)
|
||||
// The count sits on the fold button, always in sight, never in the row's line of badges.
|
||||
const unfold = screen.getByRole('button', { name: 'Show stages' })
|
||||
expect(unfold).toHaveAccessibleDescription('2 stages')
|
||||
expect(within(unfold).getByTestId('tour-stages-count')).toHaveTextContent('2')
|
||||
const row = screen.getByRole('option', { name: /Hut to hut/ })
|
||||
expect(within(within(row).getByTestId('tour-metrics')).queryByText(/stages/)).toBeNull()
|
||||
expect(screen.queryByTestId('tour-stage-overview')).toBeNull()
|
||||
await userEvent.click(screen.getByRole('button', { name: 'Show stages' }))
|
||||
expect(screen.getByTestId('tour-stage-overview')).toHaveAttribute('id', 'tour-stages-43')
|
||||
|
||||
Reference in New Issue
Block a user