Ensure test hook is correct

This commit is contained in:
Josh Johnson 2018-10-27 21:12:28 +01:00
parent ea9e322931
commit a45bcdaf49

View file

@ -579,23 +579,23 @@ describe('Choices - select one', () => {
describe('parent/child', () => { describe('parent/child', () => {
describe('selecting "Parent choice 2"', () => { describe('selecting "Parent choice 2"', () => {
it('enables the child Choices instance', () => { it('enables the child Choices instance', () => {
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(1) .eq(1)
.should('have.class', 'is-disabled'); .should('have.class', 'is-disabled');
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(0) .eq(0)
.click(); .click();
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices__list--dropdown .choices__list') .find('.choices__list--dropdown .choices__list')
.children() .children()
.eq(1) .eq(1)
.click(); .click();
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(1) .eq(1)
.should('not.have.class', 'is-disabled'); .should('not.have.class', 'is-disabled');
@ -605,7 +605,7 @@ describe('Choices - select one', () => {
describe('changing selection from "Parent choice 2" to something else', () => { describe('changing selection from "Parent choice 2" to something else', () => {
it('disables the child Choices instance', () => { it('disables the child Choices instance', () => {
// open parent instance and select second choice // open parent instance and select second choice
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(0) .eq(0)
.click() .click()
@ -614,13 +614,13 @@ describe('Choices - select one', () => {
.eq(1) .eq(1)
.click(); .click();
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(1) .eq(1)
.should('not.have.class', 'is-disabled'); .should('not.have.class', 'is-disabled');
// open parent instance and select third choice // open parent instance and select third choice
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(0) .eq(0)
.click() .click()
@ -629,7 +629,7 @@ describe('Choices - select one', () => {
.eq(2) .eq(2)
.click(); .click();
cy.get('[data-test-hook=dependencies]') cy.get('[data-test-hook=parent-child]')
.find('.choices') .find('.choices')
.eq(1) .eq(1)
.should('have.class', 'is-disabled'); .should('have.class', 'is-disabled');