mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 08:30:05 +00:00
test(admin): fail the addon load with a server error, not a dropped connection
A network error starts the client's connectivity probe, and whether the app then counted itself offline, where it stays quiet on purpose, raced the error toast on a loaded runner (FE-MOB-AADD-004 failed in CI twice). A 500 fails the load the same way and toasts every time.
This commit is contained in:
@@ -102,7 +102,10 @@ describe('MAdminAddonManager', () => {
|
||||
});
|
||||
|
||||
it('FE-MOB-AADD-004: a failing load toasts the addon error', async () => {
|
||||
server.use(http.get('/api/admin/addons', () => HttpResponse.error()));
|
||||
// A server error, not a dropped connection: a network error starts the client's
|
||||
// connectivity probe, and whether the app then counts itself offline (and stays
|
||||
// quiet, as it should offline) raced the toast on a loaded runner.
|
||||
server.use(http.get('/api/admin/addons', () => HttpResponse.json({ error: 'boom' }, { status: 500 })));
|
||||
render(<><ToastContainer /><MAdminAddonManager /></>);
|
||||
|
||||
await screen.findByText('Failed to update addon');
|
||||
|
||||
Reference in New Issue
Block a user