test(dashboard): fix flaky Cypress test (#12151)

This commit is contained in:
Jesse Yang 2020-12-21 20:40:33 -08:00 committed by GitHub
parent ce1abc98df
commit e2f676445b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -69,8 +69,10 @@ describe('Dashboard filter', () => {
it('should apply filter', () => {
cy.get('.Select__placeholder:first').click();
// should open the filter indicator
cy.get('svg[data-test="filter"]').should('be.visible');
// should show the filter indicator
cy.get('svg[data-test="filter"]:visible').should(nodes => {
expect(nodes.length).to.least(9);
});
cy.get('.Select__control:first input[type=text]').type('So', {
force: true,
@ -80,9 +82,8 @@ describe('Dashboard filter', () => {
cy.get('.Select__menu').first().contains('South Asia').click();
// should still have all filter indicators
// and since the select is closed, all filter indicators should be visible
cy.get('svg[data-test="filter"]:visible').should(nodes => {
expect(nodes).to.have.length(10);
expect(nodes.length).to.least(9);
});
cy.get('.filter_box button').click({ force: true });