mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
test(server): auth e2e (#3492)
* test(server): auth controller e2e test * test(server): user e2e test * refactor(server): album e2e * fix: linting
This commit is contained in:
parent
9e085c1071
commit
e53625b067
19 changed files with 927 additions and 496 deletions
34
server/test/fixtures/auth.stub.ts
vendored
34
server/test/fixtures/auth.stub.ts
vendored
|
|
@ -1,5 +1,27 @@
|
|||
import { AuthUserDto } from '@app/domain';
|
||||
|
||||
export const signupStub = {
|
||||
firstName: 'Immich',
|
||||
lastName: 'Admin',
|
||||
email: 'admin@immich.app',
|
||||
password: 'Password123',
|
||||
};
|
||||
|
||||
export const signupResponseStub = {
|
||||
id: expect.any(String),
|
||||
email: 'admin@immich.app',
|
||||
firstName: 'Immich',
|
||||
lastName: 'Admin',
|
||||
createdAt: expect.any(String),
|
||||
};
|
||||
|
||||
export const loginStub = {
|
||||
admin: {
|
||||
email: 'admin@immich.app',
|
||||
password: 'Password123',
|
||||
},
|
||||
};
|
||||
|
||||
export const authStub = {
|
||||
admin: Object.freeze<AuthUserDto>({
|
||||
id: 'admin_id',
|
||||
|
|
@ -76,6 +98,18 @@ export const authStub = {
|
|||
};
|
||||
|
||||
export const loginResponseStub = {
|
||||
admin: {
|
||||
response: {
|
||||
accessToken: expect.any(String),
|
||||
firstName: 'Immich',
|
||||
isAdmin: true,
|
||||
lastName: 'Admin',
|
||||
profileImagePath: '',
|
||||
shouldChangePassword: true,
|
||||
userEmail: 'admin@immich.app',
|
||||
userId: expect.any(String),
|
||||
},
|
||||
},
|
||||
user1oauth: {
|
||||
response: {
|
||||
accessToken: 'cmFuZG9tLWJ5dGVz',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue