diff --git a/cypress/integration/select-multiple.spec.js b/cypress/integration/select-multiple.spec.js index 2ecd10a..87a281e 100644 --- a/cypress/integration/select-multiple.spec.js +++ b/cypress/integration/select-multiple.spec.js @@ -279,12 +279,6 @@ describe('Choices - select multiple', () => { addItems: false, } */ - beforeEach(() => { - cy.get('[data-test-hook=add-items-disabled]') - .find('.choices') - .click(); - }); - it('disables the search input', () => { cy.get('[data-test-hook=add-items-disabled]') .find('.choices__input--cloned') @@ -293,7 +287,10 @@ describe('Choices - select multiple', () => { describe('on click', () => { it('does not open choice dropdown', () => { - cy.wait(500); // allow for animation frame + cy.get('[data-test-hook=add-items-disabled]') + .find('.choices') + .click(); + cy.get('[data-test-hook=add-items-disabled]') .find('.choices__list--dropdown') .should('not.be.visible'); @@ -302,12 +299,6 @@ describe('Choices - select multiple', () => { }); describe('disabled via attribute', () => { - beforeEach(() => { - cy.get('[data-test-hook=disabled-via-attr]') - .find('.choices') - .click(); - }); - it('disables the search input', () => { cy.get('[data-test-hook=disabled-via-attr]') .find('.choices__input--cloned') @@ -316,6 +307,10 @@ describe('Choices - select multiple', () => { describe('on click', () => { it('does not opens choice dropdown', () => { + cy.get('[data-test-hook=disabled-via-attr]') + .find('.choices') + .click(); + cy.get('[data-test-hook=disabled-via-attr]') .find('.choices__list--dropdown') .should('not.be.visible'); diff --git a/cypress/integration/select-one.spec.js b/cypress/integration/select-one.spec.js index ff09061..0129d5a 100644 --- a/cypress/integration/select-one.spec.js +++ b/cypress/integration/select-one.spec.js @@ -227,12 +227,6 @@ describe('Choices - select one', () => { addItems: false, } */ - beforeEach(() => { - cy.get('[data-test-hook=add-items-disabled]') - .find('.choices') - .click(); - }); - it('disables the search input', () => { cy.get('[data-test-hook=add-items-disabled]') .find('.choices__input--cloned') @@ -241,7 +235,10 @@ describe('Choices - select one', () => { describe('on click', () => { it('does not open choice dropdown', () => { - cy.wait(500); // allow for animation frame + cy.get('[data-test-hook=add-items-disabled]') + .find('.choices') + .click(); + cy.get('[data-test-hook=add-items-disabled]') .find('.choices__list--dropdown') .should('not.be.visible'); @@ -250,12 +247,6 @@ describe('Choices - select one', () => { }); describe('disabled via attribute', () => { - beforeEach(() => { - cy.get('[data-test-hook=disabled-via-attr]') - .find('.choices') - .click(); - }); - it('disables the search input', () => { cy.get('[data-test-hook=disabled-via-attr]') .find('.choices__input--cloned') @@ -264,7 +255,10 @@ describe('Choices - select one', () => { describe('on click', () => { it('does not open choice dropdown', () => { - cy.wait(500); // allow for animation frame + cy.get('[data-test-hook=disabled-via-attr]') + .find('.choices') + .click(); + cy.get('[data-test-hook=disabled-via-attr]') .find('.choices__list--dropdown') .should('not.be.visible');