2023-08-01 10:49:50 -05:00
|
|
|
export const errorStub = {
|
|
|
|
unauthorized: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Authentication required',
|
|
|
|
},
|
2023-09-01 21:01:54 -05:00
|
|
|
forbidden: {
|
|
|
|
error: 'Forbidden',
|
|
|
|
statusCode: 403,
|
|
|
|
message: expect.any(String),
|
|
|
|
},
|
2023-08-01 10:49:50 -05:00
|
|
|
wrongPassword: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: 'Wrong password',
|
|
|
|
},
|
|
|
|
invalidToken: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid user token',
|
|
|
|
},
|
2023-09-18 10:56:50 -05:00
|
|
|
invalidShareKey: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid share key',
|
|
|
|
},
|
2023-10-28 20:35:38 -05:00
|
|
|
invalidSharePassword: {
|
|
|
|
error: 'Unauthorized',
|
|
|
|
statusCode: 401,
|
|
|
|
message: 'Invalid password',
|
|
|
|
},
|
2023-09-20 06:16:33 -05:00
|
|
|
badRequest: (message: any = null) => ({
|
2023-08-01 10:49:50 -05:00
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
2023-09-20 06:16:33 -05:00
|
|
|
message: message ?? expect.anything(),
|
|
|
|
}),
|
2023-09-04 21:25:31 -05:00
|
|
|
noPermission: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: expect.stringContaining('Not found or no'),
|
|
|
|
},
|
2023-08-01 10:49:50 -05: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 06:16:33 -05:00
|
|
|
noDeleteUploadLibrary: {
|
|
|
|
error: 'Bad Request',
|
|
|
|
statusCode: 400,
|
|
|
|
message: 'Cannot delete the last upload library',
|
|
|
|
},
|
2023-08-01 10:49:50 -05:00
|
|
|
};
|