fix: failing simple app test (#827)

* fix: failing simple app test

* fix: more fixes
This commit is contained in:
Joe Tsang 2022-07-20 15:15:13 +01:00 committed by GitHub
parent cca6ee7960
commit 960ff40cc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,8 +27,13 @@ describe('market selector', () => {
cy.getByTestId('market-pane') cy.getByTestId('market-pane')
.children() .children()
.find('[role="button"]') .find('[role="button"]')
.first()
.should('contain.text', markets[0].name); .should('contain.text', markets[0].name);
cy.getByTestId('market-pane').children().find('[role="button"]').click(); cy.getByTestId('market-pane')
.children()
.find('[role="button"]')
.first()
.click();
cy.getByTestId('market-pane').should('not.be.visible'); cy.getByTestId('market-pane').should('not.be.visible');
} }
}); });
@ -40,7 +45,7 @@ describe('market selector', () => {
cy.getByTestId('market-pane') cy.getByTestId('market-pane')
.children() .children()
.find('[role="button"]') .find('[role="button"]')
.should('have.length', 1); .should('have.length.at.least', 1);
cy.get('input[placeholder="Search"]').clear(); cy.get('input[placeholder="Search"]').clear();
cy.get('input[placeholder="Search"]').type('app'); cy.get('input[placeholder="Search"]').type('app');
const filtered = markets.filter((market) => market.name.match(/app/i)); const filtered = markets.filter((market) => market.name.match(/app/i));