15 min fix try to stablise flakey test (#13609)

This commit is contained in:
Suzanne Aitchison 2021-05-03 13:41:28 +01:00 committed by GitHub
parent 2be1073131
commit 024cf391d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,12 +17,15 @@ describe('User Logout', () => {
// Sign out confirmation page is rendered
cy.url().should('contains', '/signout_confirm');
cy.findByText('Yes, sign out').click();
cy.findByRole('button', { name: 'Yes, sign out' }).click();
// User should be redirected to the homepage
const { baseUrl } = Cypress.config();
cy.url().should('equal', `${baseUrl}`);
// Make sure the state has updated to logged out
cy.findAllByRole('link', { name: 'Log in' });
// User data should not exist on the document or in localStorage
cy.document().should((doc) => {
expect(doc.body.dataset).not.to.have.property('user');