0
0
Fork 0
salix-front-mindshore-fork2/test/cypress/integration/logout.spec.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-07-03 12:18:47 +00:00
/// <reference types="cypress" />
describe('Logout', () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/dashboard`);
cy.waitForElement('.q-page', 6000);
});
describe('by user', () => {
it('should logout', () => {
2024-08-06 07:51:22 +00:00
cy.get('#user').click();
2024-08-13 08:42:15 +00:00
cy.get('#logout').click();
2024-07-03 12:18:47 +00:00
});
});
describe('not user', () => {
beforeEach(() => {
cy.intercept('GET', '**/VnUsers/acl', {
statusCode: 401,
body: {
error: {
statusCode: 401,
name: 'Error',
message: 'Authorization Required',
code: 'AUTHORIZATION_REQUIRED',
},
},
statusMessage: 'AUTHORIZATION_REQUIRED',
}).as('someRoute');
});
it('when token not exists', () => {
cy.reload();
cy.get('.q-notification__message').should(
'have.text',
'Authorization Required'
);
});
});
});