diff --git a/examples/nuxt-app/test/features/search-listing/aggregations.feature b/examples/nuxt-app/test/features/search-listing/aggregations.feature index a88e058351..fa38b8990e 100644 --- a/examples/nuxt-app/test/features/search-listing/aggregations.feature +++ b/examples/nuxt-app/test/features/search-listing/aggregations.feature @@ -4,6 +4,7 @@ Feature: Search listing - Aggregations Background: Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 + And the search autocomplete request is stubbed And I am using a "macbook-16" device @mockserver diff --git a/examples/nuxt-app/test/features/search-listing/errors.feature b/examples/nuxt-app/test/features/search-listing/errors.feature index c5724a5c97..1c2a9f91d2 100644 --- a/examples/nuxt-app/test/features/search-listing/errors.feature +++ b/examples/nuxt-app/test/features/search-listing/errors.feature @@ -4,6 +4,7 @@ Feature: Searching listing - Errors Background: Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 + And the search autocomplete request is stubbed And I am using a "macbook-16" device @mockserver diff --git a/examples/nuxt-app/test/features/search-listing/grants.feature b/examples/nuxt-app/test/features/search-listing/grants.feature index 805314c960..a5341d2328 100644 --- a/examples/nuxt-app/test/features/search-listing/grants.feature +++ b/examples/nuxt-app/test/features/search-listing/grants.feature @@ -4,6 +4,7 @@ Feature: Grants collection Background: Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 + And the search autocomplete request is stubbed And I am using a "macbook-16" device @mockserver diff --git a/examples/nuxt-app/test/features/search-listing/grid-list.feature b/examples/nuxt-app/test/features/search-listing/grid-list.feature index 5da8d9d947..e73164a291 100644 --- a/examples/nuxt-app/test/features/search-listing/grid-list.feature +++ b/examples/nuxt-app/test/features/search-listing/grid-list.feature @@ -4,6 +4,7 @@ Feature: Grid collection Background: Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 + And the search autocomplete request is stubbed And I am using a "macbook-16" device @mockserver diff --git a/examples/nuxt-app/test/features/search-listing/pagination.feature b/examples/nuxt-app/test/features/search-listing/pagination.feature index b34f441e59..0da3e3b5aa 100644 --- a/examples/nuxt-app/test/features/search-listing/pagination.feature +++ b/examples/nuxt-app/test/features/search-listing/pagination.feature @@ -4,6 +4,7 @@ Feature: Searching listing - Pagination Background: Given the endpoint "/api/tide/site" with query "?id=8888" returns fixture "/site/reference" with status 200 + And the search autocomplete request is stubbed And I am using a "macbook-16" device @mockserver diff --git a/packages/ripple-test-utils/step_definitions/common/mocks.ts b/packages/ripple-test-utils/step_definitions/common/mocks.ts index 618f027c62..73969b2026 100644 --- a/packages/ripple-test-utils/step_definitions/common/mocks.ts +++ b/packages/ripple-test-utils/step_definitions/common/mocks.ts @@ -81,6 +81,24 @@ Given( } ) +Given('the search autocomplete request is stubbed', () => { + cy.intercept( + 'POST', + `/api/tide/search/${Cypress.env('searchIndex')}/query_suggestions`, + { + statusCode: status, + body: { + results: { + documents: [] + }, + meta: { + request_id: '123' + } + } + } + ).as('autocompleteRequest') // assign an alias +}) + Then( 'the search network request should be called with the {string} fixture', (requestFixture: string) => {