fix flake in delete listing test (#13899)

This commit is contained in:
Suzanne Aitchison 2021-06-02 11:39:24 +01:00 committed by GitHub
parent 9b8d7cabb3
commit e04c6152a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,10 +19,20 @@ describe('Delete listing', () => {
cy.findByRole('link', { name: 'Delete' }).click();
// Wait until the confirmation page loads
cy.findByRole('heading', {
name: 'Are you sure you want to delete this listing?',
});
cy.findByRole('main')
.findByRole('button', { name: /^Delete$/i })
.click();
// Wait for the form to submit and the user to be returned to the dashboard
cy.findByRole('heading', {
name: 'Are you sure you want to delete this listing?',
}).should('not.exist');
cy.findByRole('main')
.findByRole('heading', { name: 'Listing title' })
.should('not.exist');