mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor: e2e client (#7324)
This commit is contained in:
parent
5c0c98473d
commit
2ebb57cbd4
13 changed files with 19 additions and 146 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { AuthDeviceResponseDto, LoginCredentialDto, LoginResponseDto, UserResponseDto } from '@app/domain';
|
||||
import { LoginCredentialDto, LoginResponseDto, UserResponseDto } from '@app/domain';
|
||||
import { adminSignupStub, loginResponseStub, loginStub } from '@test';
|
||||
import request from 'supertest';
|
||||
|
||||
|
|
@ -27,19 +27,4 @@ export const authApi = {
|
|||
|
||||
return body as LoginResponseDto;
|
||||
},
|
||||
getAuthDevices: async (server: any, accessToken: string) => {
|
||||
const { status, body } = await request(server).get('/auth/devices').set('Authorization', `Bearer ${accessToken}`);
|
||||
|
||||
expect(body).toEqual(expect.any(Array));
|
||||
expect(status).toBe(200);
|
||||
|
||||
return body as AuthDeviceResponseDto[];
|
||||
},
|
||||
validateToken: async (server: any, accessToken: string) => {
|
||||
const { status, body } = await request(server)
|
||||
.post('/auth/validateToken')
|
||||
.set('Authorization', `Bearer ${accessToken}`);
|
||||
expect(body).toEqual({ authStatus: true });
|
||||
expect(status).toBe(200);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue