0
0
Fork 0

test: refs #8039 axios not notify

This commit is contained in:
Alex Moreno 2024-10-21 13:38:35 +02:00
parent 8478d89183
commit c69f7af390
1 changed files with 0 additions and 18 deletions

View File

@ -36,8 +36,6 @@ describe('Axios boot', () => {
describe('onResponseError()', async () => { describe('onResponseError()', async () => {
it('should call to the Notify plugin with a message error for an status code "500"', async () => { it('should call to the Notify plugin with a message error for an status code "500"', async () => {
Notify.create = vi.fn();
const error = { const error = {
response: { response: {
status: 500, status: 500,
@ -45,19 +43,10 @@ describe('Axios boot', () => {
}; };
const result = onResponseError(error); const result = onResponseError(error);
expect(result).rejects.toEqual(expect.objectContaining(error)); expect(result).rejects.toEqual(expect.objectContaining(error));
expect(Notify.create).toHaveBeenCalledWith(
expect.objectContaining({
message: 'An internal server error has ocurred',
type: 'negative',
})
);
}); });
it('should call to the Notify plugin with a message from the response property', async () => { it('should call to the Notify plugin with a message from the response property', async () => {
Notify.create = vi.fn();
const error = { const error = {
response: { response: {
status: 401, status: 401,
@ -70,14 +59,7 @@ describe('Axios boot', () => {
}; };
const result = onResponseError(error); const result = onResponseError(error);
expect(result).rejects.toEqual(expect.objectContaining(error)); expect(result).rejects.toEqual(expect.objectContaining(error));
expect(Notify.create).toHaveBeenCalledWith(
expect.objectContaining({
message: 'Invalid user or password',
type: 'negative',
})
);
}); });
}); });
}); });