From 72935d7e40b794c19b9cd261d1dabc5f2f9ac764 Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 8 Sep 2026 14:19:01 +0200 Subject: [PATCH] test(admin): wait for the migration POST instead of reading it after the toast FE-MOB-MSTOR-013 read migrationBody straight after the save toast. The toast comes from the PUT, the migration POST is fired by the queue effect one commit later, so the two are not the same tick. It only passed while that effect happened to flush first, which on a loaded runner it does not. The desktop twin FE-ADMIN-STOR-030 has waited here since 8069b8805; the mobile file was left behind. --- client/tests/unit/mobile/admin/MAdminStoragePanel.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/tests/unit/mobile/admin/MAdminStoragePanel.test.tsx b/client/tests/unit/mobile/admin/MAdminStoragePanel.test.tsx index bc2b05dcb..6da31e47e 100644 --- a/client/tests/unit/mobile/admin/MAdminStoragePanel.test.tsx +++ b/client/tests/unit/mobile/admin/MAdminStoragePanel.test.tsx @@ -271,7 +271,12 @@ describe('MAdminStoragePanel', () => { await screen.findByText('Storage configuration saved'); // files is default-sourced (uploads-local) in baseState() — stripping restores "no override". expect((putBody as StorageConfig).categories.files).toBeUndefined(); - expect(migrationBody).toEqual({ category: 'files', to: 'off-box' }); + // Waited for, not read straight after the toast. The toast comes from the + // PUT, while the migration POST is fired by the queue effect one commit + // later, so the two are not the same tick. Reading it immediately only held + // while that effect happened to flush first, which under CI load it does + // not. Same fix as FE-ADMIN-STOR-030 on the desktop twin. + await waitFor(() => expect(migrationBody).toEqual({ category: 'files', to: 'off-box' })); expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument(); });