Skip to content

Commit c7aed44

Browse files
committed
e2e/routes/team: Migrate from mirage to @crates-io/msw
1 parent fdb93cb commit c7aed44

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

e2e/routes/team.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect, test } from '@/e2e/helper';
2+
import { http, HttpResponse } from 'msw';
23

34
test.describe('Route | team', { tag: '@routes' }, () => {
45
test("shows an error message if the category can't be found", async ({ page }) => {
@@ -10,10 +11,8 @@ test.describe('Route | team', { tag: '@routes' }, () => {
1011
await expect(page.locator('[data-test-try-again]')).toHaveCount(0);
1112
});
1213

13-
test('server error causes the error page to be shown', async ({ page, mirage }) => {
14-
await mirage.addHook(server => {
15-
server.get('/api/v1/teams/:id', {}, 500);
16-
});
14+
test('server error causes the error page to be shown', async ({ page, msw }) => {
15+
msw.worker.use(http.get('/api/v1/teams/:id', () => HttpResponse.json({}, { status: 500 })));
1716

1817
await page.goto('/teams/foo');
1918
await expect(page).toHaveURL('/teams/foo');

0 commit comments

Comments
 (0)