From 02b1077abe4b14a456fe72b6664c592066a1a27d Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 25 Jul 2024 19:36:12 +0200 Subject: [PATCH] test(api): don't sign in before testing signin (#55661) --- api/src/routes/auth.test.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/api/src/routes/auth.test.ts b/api/src/routes/auth.test.ts index a9587d2ffe7..f6ae0380640 100644 --- a/api/src/routes/auth.test.ts +++ b/api/src/routes/auth.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { createSuperRequest, devLogin, setupServer } from '../../jest.utils'; +import { setupServer, superRequest } from '../../jest.utils'; import { AUTH0_DOMAIN } from '../utils/env'; jest.mock('../utils/env', () => { @@ -13,14 +13,8 @@ jest.mock('../utils/env', () => { describe('auth0 routes', () => { setupServer(); describe('GET /signin', () => { - let superGet: ReturnType; - beforeAll(async () => { - const setCookies = await devLogin(); - - superGet = createSuperRequest({ method: 'GET', setCookies }); - }); it('should redirect to the auth0 login page', async () => { - const res = await superGet('/signin'); + const res = await superRequest('/signin', { method: 'GET' }); expect(res.status).toBe(302); // eslint-disable-next-line @typescript-eslint/no-unsafe-argument