From 2292b5282fb4c3f5910fdd701837e3947e98f6b6 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Tue, 30 Oct 2018 21:44:58 +0000 Subject: [PATCH] Test for class instead of visibility --- cypress/integration/select-multiple.spec.js | 4 ++-- cypress/integration/select-one.spec.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cypress/integration/select-multiple.spec.js b/cypress/integration/select-multiple.spec.js index 7ca08e6..0e11895 100644 --- a/cypress/integration/select-multiple.spec.js +++ b/cypress/integration/select-multiple.spec.js @@ -291,7 +291,7 @@ describe('Choices - select multiple', () => { .find('.choices') .click() .find('.choices__list--dropdown') - .should('not.be.visible'); + .should('not.have.class', 'is-active'); }); }); }); @@ -309,7 +309,7 @@ describe('Choices - select multiple', () => { .find('.choices') .click() .find('.choices__list--dropdown') - .should('not.be.visible'); + .should('not.have.class', 'is-active'); }); }); }); diff --git a/cypress/integration/select-one.spec.js b/cypress/integration/select-one.spec.js index 2a44f83..d00171d 100644 --- a/cypress/integration/select-one.spec.js +++ b/cypress/integration/select-one.spec.js @@ -237,9 +237,11 @@ describe('Choices - select one', () => { it('does not open choice dropdown', () => { cy.get('[data-test-hook=add-items-disabled]') .find('.choices') - .click() + .click(); + + cy.get('[data-test-hook=add-items-disabled]') .find('.choices__list--dropdown') - .should('not.be.visible'); + .should('not.have.class', 'is-active'); }); }); }); @@ -255,9 +257,11 @@ describe('Choices - select one', () => { it('does not open choice dropdown', () => { cy.get('[data-test-hook=disabled-via-attr]') .find('.choices') - .click() + .click(); + + cy.get('[data-test-hook=disabled-via-attr]') .find('.choices__list--dropdown') - .should('not.be.visible'); + .should('not.have.class', 'is-active'); }); }); });