mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 13:36:48 +00:00
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:
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user