From d541bfa838c23d69ffaf7b6f0ea33083c5bf7263 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 14 Nov 2026 12:00:41 +0100 Subject: [PATCH] test(mobile): the passkey confirm now closes with the user sheet it belongs to --- client/tests/unit/mobile/admin/MAdminSheets.test.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/tests/unit/mobile/admin/MAdminSheets.test.tsx b/client/tests/unit/mobile/admin/MAdminSheets.test.tsx index 5fa85d34f..9a5b6f95c 100644 --- a/client/tests/unit/mobile/admin/MAdminSheets.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminSheets.test.tsx @@ -430,7 +430,7 @@ describe('MAdminSheets', () => { ); }); - it('FE-MOB-ASHEET-024: confirming the passkey reset without an edited user does nothing', async () => { + it('FE-MOB-ASHEET-024: the passkey confirm closes with the edit sheet and resets nobody', async () => { const user = userEvent.setup(); let called = false; server.use( @@ -443,13 +443,12 @@ describe('MAdminSheets', () => { const { rerender } = render(); await user.click(screen.getByRole('button', { name: 'Reset passkeys' })); - // The edit sheet closes underneath while the confirm stays open + expect(screen.getByRole('dialog', { name: 'Reset passkeys' })).toBeInTheDocument(); + // The confirm belongs to the user being edited: the edit sheet closing takes it along. rerender(); - await user.click(screen.getByRole('button', { name: 'Reset passkeys' })); - + await waitFor(() => expect(screen.queryByRole('dialog', { name: 'Reset passkeys' })).not.toBeInTheDocument()); expect(called).toBe(false); - expect(screen.getByRole('dialog', { name: 'Reset passkeys' })).toBeInTheDocument(); }); it('FE-MOB-ASHEET-025: resetting 2FA confirms, calls the API and reports it', async () => {