From d543ca87fbd5a52b76ba68e5a9cf3d5bdaafe993 Mon Sep 17 00:00:00 2001 From: Jesse Yang Date: Fri, 18 Dec 2020 10:31:33 -0800 Subject: [PATCH] fix: fix the flaky FilterBox test re-introduced by #12114 (#12124) --- .../cypress/integration/dashboard/filter.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts index 70ac7017be..828c0d8033 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/filter.test.ts @@ -70,11 +70,7 @@ describe('Dashboard filter', () => { cy.get('.Select__placeholder:first').click(); // should open the filter indicator - cy.get('svg[data-test="filter"]') - .should('be.visible') - .should(nodes => { - expect(nodes).to.have.length(9); - }); + cy.get('svg[data-test="filter"]').should('be.visible'); cy.get('.Select__control:first input[type=text]').type('So', { force: true, @@ -83,6 +79,12 @@ 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(9); + }); + cy.get('.filter_box button').click({ force: true }); cy.wait(aliases.filter(x => x !== getAlias(filterId))).then(requests => { return Promise.all(