Remove unnecessary beforeEachs

This commit is contained in:
Josh Johnson 2018-10-30 21:21:11 +00:00
parent bd674b5bdf
commit 5fe6e18077
2 changed files with 16 additions and 27 deletions

View file

@ -279,12 +279,6 @@ describe('Choices - select multiple', () => {
addItems: false, addItems: false,
} }
*/ */
beforeEach(() => {
cy.get('[data-test-hook=add-items-disabled]')
.find('.choices')
.click();
});
it('disables the search input', () => { it('disables the search input', () => {
cy.get('[data-test-hook=add-items-disabled]') cy.get('[data-test-hook=add-items-disabled]')
.find('.choices__input--cloned') .find('.choices__input--cloned')
@ -293,7 +287,10 @@ describe('Choices - select multiple', () => {
describe('on click', () => { describe('on click', () => {
it('does not open choice dropdown', () => { 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]') cy.get('[data-test-hook=add-items-disabled]')
.find('.choices__list--dropdown') .find('.choices__list--dropdown')
.should('not.be.visible'); .should('not.be.visible');
@ -302,12 +299,6 @@ describe('Choices - select multiple', () => {
}); });
describe('disabled via attribute', () => { describe('disabled via attribute', () => {
beforeEach(() => {
cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices')
.click();
});
it('disables the search input', () => { it('disables the search input', () => {
cy.get('[data-test-hook=disabled-via-attr]') cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices__input--cloned') .find('.choices__input--cloned')
@ -316,6 +307,10 @@ describe('Choices - select multiple', () => {
describe('on click', () => { describe('on click', () => {
it('does not opens choice dropdown', () => { 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]') cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices__list--dropdown') .find('.choices__list--dropdown')
.should('not.be.visible'); .should('not.be.visible');

View file

@ -227,12 +227,6 @@ describe('Choices - select one', () => {
addItems: false, addItems: false,
} }
*/ */
beforeEach(() => {
cy.get('[data-test-hook=add-items-disabled]')
.find('.choices')
.click();
});
it('disables the search input', () => { it('disables the search input', () => {
cy.get('[data-test-hook=add-items-disabled]') cy.get('[data-test-hook=add-items-disabled]')
.find('.choices__input--cloned') .find('.choices__input--cloned')
@ -241,7 +235,10 @@ describe('Choices - select one', () => {
describe('on click', () => { describe('on click', () => {
it('does not open choice dropdown', () => { 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]') cy.get('[data-test-hook=add-items-disabled]')
.find('.choices__list--dropdown') .find('.choices__list--dropdown')
.should('not.be.visible'); .should('not.be.visible');
@ -250,12 +247,6 @@ describe('Choices - select one', () => {
}); });
describe('disabled via attribute', () => { describe('disabled via attribute', () => {
beforeEach(() => {
cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices')
.click();
});
it('disables the search input', () => { it('disables the search input', () => {
cy.get('[data-test-hook=disabled-via-attr]') cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices__input--cloned') .find('.choices__input--cloned')
@ -264,7 +255,10 @@ describe('Choices - select one', () => {
describe('on click', () => { describe('on click', () => {
it('does not open choice dropdown', () => { 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]') cy.get('[data-test-hook=disabled-via-attr]')
.find('.choices__list--dropdown') .find('.choices__list--dropdown')
.should('not.be.visible'); .should('not.be.visible');