mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
chore: remove unused stubs (#9647)
This commit is contained in:
parent
00b5ad3421
commit
a3489d604b
18
server/test/fixtures/auth.stub.ts
vendored
18
server/test/fixtures/auth.stub.ts
vendored
@ -3,24 +3,6 @@ import { SessionEntity } from 'src/entities/session.entity';
|
|||||||
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
import { SharedLinkEntity } from 'src/entities/shared-link.entity';
|
||||||
import { UserEntity } from 'src/entities/user.entity';
|
import { UserEntity } from 'src/entities/user.entity';
|
||||||
|
|
||||||
export const adminSignupStub = {
|
|
||||||
name: 'Immich Admin',
|
|
||||||
email: 'admin@immich.app',
|
|
||||||
password: 'Password123',
|
|
||||||
};
|
|
||||||
|
|
||||||
export const userSignupStub = {
|
|
||||||
...adminSignupStub,
|
|
||||||
memoriesEnabled: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const loginStub = {
|
|
||||||
admin: {
|
|
||||||
email: 'admin@immich.app',
|
|
||||||
password: 'Password123',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export const authStub = {
|
export const authStub = {
|
||||||
admin: Object.freeze<AuthDto>({
|
admin: Object.freeze<AuthDto>({
|
||||||
user: {
|
user: {
|
||||||
|
52
server/test/fixtures/error.stub.ts
vendored
52
server/test/fixtures/error.stub.ts
vendored
@ -1,52 +0,0 @@
|
|||||||
export const errorStub = {
|
|
||||||
unauthorized: {
|
|
||||||
error: 'Unauthorized',
|
|
||||||
statusCode: 401,
|
|
||||||
message: 'Authentication required',
|
|
||||||
},
|
|
||||||
forbidden: {
|
|
||||||
error: 'Forbidden',
|
|
||||||
statusCode: 403,
|
|
||||||
message: expect.any(String),
|
|
||||||
},
|
|
||||||
wrongPassword: {
|
|
||||||
error: 'Bad Request',
|
|
||||||
statusCode: 400,
|
|
||||||
message: 'Wrong password',
|
|
||||||
},
|
|
||||||
invalidToken: {
|
|
||||||
error: 'Unauthorized',
|
|
||||||
statusCode: 401,
|
|
||||||
message: 'Invalid user token',
|
|
||||||
},
|
|
||||||
invalidShareKey: {
|
|
||||||
error: 'Unauthorized',
|
|
||||||
statusCode: 401,
|
|
||||||
message: 'Invalid share key',
|
|
||||||
},
|
|
||||||
invalidSharePassword: {
|
|
||||||
error: 'Unauthorized',
|
|
||||||
statusCode: 401,
|
|
||||||
message: 'Invalid password',
|
|
||||||
},
|
|
||||||
badRequest: (message: any = null) => ({
|
|
||||||
error: 'Bad Request',
|
|
||||||
statusCode: 400,
|
|
||||||
message: message ?? expect.anything(),
|
|
||||||
}),
|
|
||||||
noPermission: {
|
|
||||||
error: 'Bad Request',
|
|
||||||
statusCode: 400,
|
|
||||||
message: expect.stringContaining('Not found or no'),
|
|
||||||
},
|
|
||||||
incorrectLogin: {
|
|
||||||
error: 'Unauthorized',
|
|
||||||
statusCode: 401,
|
|
||||||
message: 'Incorrect email or password',
|
|
||||||
},
|
|
||||||
alreadyHasAdmin: {
|
|
||||||
error: 'Bad Request',
|
|
||||||
statusCode: 400,
|
|
||||||
message: 'The server already has an admin',
|
|
||||||
},
|
|
||||||
};
|
|
5
server/test/fixtures/uuid.stub.ts
vendored
5
server/test/fixtures/uuid.stub.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
export const uuidStub = {
|
|
||||||
invalid: 'invalid-uuid',
|
|
||||||
// valid uuid v4
|
|
||||||
notFound: '00000000-0000-4000-a000-000000000000',
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user