Skip to content

Commit

Permalink
fix(nuxt-app): fix dependent filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Featherston committed Mar 26, 2024
1 parent abc9fc1 commit db4374e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Feature: Search listing - Filter
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-mammals-children" fixture
And the filters toggle should show 2 applied filters
Then I toggle the search listing filters section

When I click the search listing dropdown field labelled "Terms dependent example"
Then the selected dropdown field should have the items:
Expand All @@ -227,6 +228,7 @@ Feature: Search listing - Filter

When I visit the page "/filters"
Then the search listing page should have 2 results
Then I toggle the search listing filters section
And the search network request should be called with the "/search-listing/dependent-filters/request-empty" fixture
And the search listing dropdown field labelled "Terms dependent child example" should be disabled
And the search listing dropdown field labelled "Terms dependent grandchild example" should be disabled
Expand Down Expand Up @@ -276,6 +278,7 @@ Feature: Search listing - Filter
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-birds-grandchildren-single" fixture
And the filters toggle should show 3 applied filters
Then I toggle the search listing filters section

When I click the search listing dropdown field labelled "Terms dependent example"
And I click the option labelled "Mammals" in the selected dropdown
Expand Down Expand Up @@ -304,6 +307,7 @@ Feature: Search listing - Filter
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-birds-grandchildren" fixture
And the filters toggle should show 3 applied filters
Then I toggle the search listing filters section

When I click the search listing dropdown field labelled "Terms dependent example"
And I click the option labelled "Mammals" in the selected dropdown
Expand Down Expand Up @@ -334,6 +338,7 @@ Feature: Search listing - Filter
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-birds-grandchildren" fixture
And the filters toggle should show 3 applied filters
Then I toggle the search listing filters section

Then the search listing dropdown field labelled "Terms dependent example" should have the value "Birds"
And I click the search listing dropdown field labelled "Terms dependent example"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ When(
}
)

When(
`the search listing dropdown field labelled {string} should be disabled`,
(label: string) => {
cy.contains('label', label)
.invoke('attr', 'for')
.then((dropdownId) => {
cy.get(`#${dropdownId}`).should('have.attr', 'disabled')
})
}
)

When(`I toggle the search listing filters section`, () => {
cy.get(`button`).contains('Refine search').as('refineBtn')
cy.wait(300)
Expand Down

0 comments on commit db4374e

Please sign in to comment.