Skip to content

Commit

Permalink
Add alias to Cypress query to avoid asynchronous page update errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ekraffmiller committed Dec 11, 2023
1 parent 9f73f62 commit ce4dbec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/e2e-integration/e2e/sections/dataset/Dataset.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,14 @@ describe('Dataset', () => {

cy.findByText('Restricted File Icon').should('not.exist')
cy.findByText('Restricted with access Icon').should('exist')

cy.findByRole('button', { name: 'Access File' }).should('exist').click()
cy.findByRole('button', { name: 'Access File' }).as('accessButton')
cy.get('@accessButton').should('exist')
cy.get('@accessButton').click()
cy.findByText('Restricted with Access Granted').should('exist')

cy.findByRole('button', { name: 'File Options' }).should('exist').click()
cy.findByRole('button', { name: 'File Options' }).as('fileOptions')
cy.get('@fileOptions').should('exist')
cy.get('@fileOptions').click()
cy.findByText('Unrestrict').should('exist')
})
})
Expand Down Expand Up @@ -361,7 +364,9 @@ describe('Dataset', () => {

cy.findByText('Edit Files').should('exist')

cy.findByRole('button', { name: 'Access File' }).should('exist').click()
cy.findByRole('button', { name: 'Access File' }).as('accessButton')
cy.get('@accessButton').should('exist')
cy.get('@accessButton').click()
cy.findByText('Embargoed').should('exist')
})
})
Expand Down

0 comments on commit ce4dbec

Please sign in to comment.