From f668eee22709cec7aa55ab356384faa6cf15bc2d Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 21 Nov 2026 10:59:35 +0100 Subject: [PATCH] test(client): drop the two new non-null assertions in the addon card tests Client lint was red: lint:warnings counted 1877 no-non-null-assertion warnings in tests against a baseline of 1875, both from closest('section')! in FE-ADMIN-ADDON-045 and 046. Cast to HTMLElement like the other card lookups in the file. --- client/src/components/Admin/AddonManager.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Admin/AddonManager.test.tsx b/client/src/components/Admin/AddonManager.test.tsx index 2340d3db6..540915913 100644 --- a/client/src/components/Admin/AddonManager.test.tsx +++ b/client/src/components/Admin/AddonManager.test.tsx @@ -697,7 +697,7 @@ describe('AddonManager', () => { server.use(addonsRoute([buildAddon({ id: 'packing', name: 'Lists', icon: 'ListChecks', type: 'trip', enabled: true })])); const onToggle = vi.fn(); const { unmount } = render(); - const trip = (await screen.findByRole('heading', { name: 'Trip' })).closest('section')!; + const trip = (await screen.findByRole('heading', { name: 'Trip' })).closest('section') as HTMLElement; await userEvent.click(within(trip).getByRole('button', { name: 'Follow booked flights live' })); expect(onToggle).toHaveBeenCalledTimes(1); // The count stays the addons': the flight row is an instance option beside them. @@ -713,7 +713,7 @@ describe('AddonManager', () => { vi.spyOn(mailIngestRepo, 'adminSettings').mockResolvedValue({ mail_ingest_enabled: 'true' }); vi.spyOn(mailIngestRepo, 'adminStatus').mockRejectedValue(new Error('no status')); render(); - const integration = (await screen.findByRole('heading', { name: 'Integration' })).closest('section')!; + const integration = (await screen.findByRole('heading', { name: 'Integration' })).closest('section') as HTMLElement; expect(within(integration).getByText('Booking mail import')).toBeInTheDocument(); await userEvent.click(await within(integration).findByRole('button', { name: 'Set up mail import' })); const dialog = await screen.findByRole('dialog');