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.
This commit is contained in:
Maurice
2026-09-08 14:19:01 +02:00
committed by Maurice
parent 569f0ca1a5
commit 72935d7e40
@@ -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();
});