test: refs #6695 handle uncaught exceptions in logout.spec.js for better error management
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details

This commit is contained in:
Alex Moreno 2025-03-14 11:16:54 +01:00
parent 7bd4f088eb
commit 2c4ee50f46
1 changed files with 10 additions and 1 deletions

View File

@ -24,12 +24,21 @@ describe('Logout', () => {
},
},
statusMessage: 'AUTHORIZATION_REQUIRED',
});
}).as('badRequest');
});
it('when token not exists', () => {
const exceptionHandler = (err) => {
if (err.code === 'AUTHORIZATION_REQUIRED') return;
};
Cypress.on('uncaught:exception', exceptionHandler);
cy.get('.q-list').first().should('be.visible').click();
cy.wait('@badRequest');
cy.checkNotification('Authorization Required');
Cypress.off('uncaught:exception', exceptionHandler);
});
});
});