Skip to content

Commit

Permalink
fix(auto login): ensure something has rendered in validation fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammer5 committed May 1, 2023
1 parent 2ee2e75 commit 7b79eb1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export const enableAutoLogin = (
cacheAcrossSpecs: true,
validate: () => {
cy.visit('/')

// Make sure that something has been rendered. Otherwise
// the next assertion might be done when nothing has been
// rendered yet, which will result in false negatives.
cy.get('#dhis2-app-root > *').should('exist')

cy.get('h1:contains("Please sign in")', { timeout }).should(
'not.exist'
)
Expand Down

0 comments on commit 7b79eb1

Please sign in to comment.