diff --git a/client/src/components/Tours/toursI18n.test.tsx b/client/src/components/Tours/toursI18n.test.tsx index dee72687d..ebf8e9050 100644 --- a/client/src/components/Tours/toursI18n.test.tsx +++ b/client/src/components/Tours/toursI18n.test.tsx @@ -122,7 +122,7 @@ describe('Tours English and German copy', () => { await waitFor(() => expect(screen.getByLabelText(toursText(de, 'tours.planner.difficulty.t2'))).toBeInTheDocument()) const onAssignToDay = vi.fn() rerender() - const saveBanner = screen.getByText(toursText(de, 'tours.planner.saved')).closest('[role="status"]')! + const saveBanner = screen.getByText(toursText(de, 'tours.planner.saved')).closest('[role="status"]') as HTMLElement expect(within(saveBanner).getByRole('button', { name: toursText(de, 'tours.planner.planAnother') })).toBeInTheDocument() expect(within(saveBanner).queryByRole('button', { name: toursText(de, 'tours.planner.assignToDay') })).not.toBeInTheDocument() fireEvent.click(screen.getByRole('button', { name: `${toursText(de, 'tours.addToDay')}: ${tour.name}` })) diff --git a/client/src/components/Tours/toursPermissions.test.tsx b/client/src/components/Tours/toursPermissions.test.tsx index 4e34a282e..cd58dd6d2 100644 --- a/client/src/components/Tours/toursPermissions.test.tsx +++ b/client/src/components/Tours/toursPermissions.test.tsx @@ -141,7 +141,7 @@ describe('Tours permissions without database setup', () => { } as unknown as TourPlannerController const assign = vi.fn() render(<>) - const saveBanner = screen.getByText('tours.planner.saved').closest('[role="status"]')! + const saveBanner = screen.getByText('tours.planner.saved').closest('[role="status"]') as HTMLElement expect(within(saveBanner).getByRole('button', { name: 'tours.planner.planAnother' })).toBeInTheDocument() expect(within(saveBanner).queryByRole('button', { name: 'tours.planner.assignToDay' })).not.toBeInTheDocument() const save = screen.getByRole('button', { name: 'tours.planner.save' }) as HTMLButtonElement diff --git a/client/src/components/shared/CustomSelect.consumers.test.tsx b/client/src/components/shared/CustomSelect.consumers.test.tsx index a75005ae2..6c6e4d7ac 100644 --- a/client/src/components/shared/CustomSelect.consumers.test.tsx +++ b/client/src/components/shared/CustomSelect.consumers.test.tsx @@ -80,7 +80,7 @@ describe('CustomSelect consumer contracts', () => { planner={planner({ saveOutcome: tour, editingPlaceId: 42 })} tours={[tour]} days={days} loading={false} onAssignToDay={onAssignToDay} onViewGpxTour={vi.fn()} />) - const saveBanner = screen.getByText('Tour saved').closest('[role="status"]')! + const saveBanner = screen.getByText('Tour saved').closest('[role="status"]') as HTMLElement expect(within(saveBanner).getByRole('button', { name: 'Plan another' })).toBeInTheDocument() expect(within(saveBanner).queryByRole('button', { name: 'Assign to a day' })).not.toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Add to day: Ridge walk' }))