mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
test(api): don't sign in before testing signin (#55661)
This commit is contained in:
committed by
GitHub
parent
ee37d563f7
commit
02b1077abe
@@ -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<typeof createSuperRequest>;
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user