Skip to content

Commit

Permalink
fix(@dpc-sdp/ripple-tide-search): ✅ fix failing dependent filter tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dylankelly committed Jan 12, 2024
1 parent d2a1f0b commit 0603182
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ Feature: Search listing - Filter
Example: Dependent filter - Should reflect the value from the URL
Given the page endpoint for path "/filters" returns fixture "/search-listing/dependent-filters/page" with status 200
And the search network request is stubbed with fixture "/search-listing/dependent-filters/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

When I visit the page "/filters?dependentFilter=Mammals:Dogs,Cats"
Then the search listing page should have 2 results
Expand All @@ -203,8 +202,6 @@ Feature: Search listing - Filter
Example: Dependent filter - Child options should update on parent selection
Given the page endpoint for path "/filters" returns fixture "/search-listing/dependent-filters/page" with status 200
And the search network request is stubbed with fixture "/search-listing/dependent-filters/response" and status 200
And the current date is "Fri, 02 Feb 2050 03:04:05 GMT"

When I visit the page "/filters"
Then the search listing page should have 2 results
And the search network request should be called with the "/search-listing/dependent-filters/request-empty" fixture
Expand Down
4 changes: 4 additions & 0 deletions packages/ripple-test-utils/step_definitions/common/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,7 @@ Given('the current date is {string}', (dateString: string) => {
Given('the current date is restored', () => {
cy.clock().invoke('restore')
})

Given('time moves {int} second', (sec: number = 1) => {
cy.tick(sec * 1000)
})
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const handleSelect = (value: string) => {
if (formNode && initialChild.value) {
nextTick(() => {
formNode.input({
'topic-parent': value,
'topic-child': initialChild.value
[`${props.id}-parent`]: value,
[`${props.id}-child`]: initialChild.value
})
initialChild.value = null
})
Expand Down

0 comments on commit 0603182

Please sign in to comment.