2023-08-01 17:49:50 +02:00
|
|
|
export const errorStub = {
|
|
|
|
unauthorized: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Authentication required',
|
|
|
|
},
|
2023-09-02 04:01:54 +02:00
|
|
|
forbidden: {
|
|
|
|
error: 'Forbidden',
|
|
|
|
statusCode: 403,
|
|
|
|
message: expect.any(String),
|
|
|
|
},
|
2023-08-01 17:49:50 +02:00
|
|
|
wrongPassword: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: 'Wrong password',
|
|
|
|
},
|
|
|
|
invalidToken: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid user token',
|
|
|
|
},
|
2023-09-18 17:56:50 +02:00
|
|
|
invalidShareKey: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid share key',
|
|
|
|
},
|
2023-10-29 03:35:38 +02:00
|
|
|
invalidSharePassword: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid password',
|
|
|
|
},
|
2023-09-20 13:16:33 +02:00
|
|
|
badRequest: (message: any = null) => ({
|
2023-08-01 17:49:50 +02:00
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
2023-09-20 13:16:33 +02:00
|
|
|
message: message ?? expect.anything(),
|
|
|
|
}),
|
2023-09-05 04:25:31 +02:00
|
|
|
noPermission: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: expect.stringContaining('Not found or no'),
|
|
|
|
},
|
2023-08-01 17:49:50 +02:00
|
|
|
incorrectLogin: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Incorrect email or password',
|
|
|
|
},
|
|
|
|
alreadyHasAdmin: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: 'The server already has an admin',
|
|
|
|
},
|
2023-09-20 13:16:33 +02:00
|
|
|
noDeleteUploadLibrary: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: 'Cannot delete the last upload library',
|
|
|
|
},
|
2023-08-01 17:49:50 +02:00
|
|
|
};
|