Skip to content

Commit

Permalink
test(@dpc-sdp/ripple-tide-search): added tests for map search banner
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffdowdle committed Dec 17, 2024
1 parent 20c2925 commit 339a312
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 448 deletions.
54 changes: 45 additions & 9 deletions examples/nuxt-app/test/features/maps/map-search-banner.feature
Original file line number Diff line number Diff line change
@@ -1,18 +1,54 @@
Feature: Map search banner

Build test

Background:
Given the site endpoint returns fixture "/site/reference" with status 200

@mockserver
Example: Map search banner (desktop)
Given the page endpoint for path "/map" returns fixture "/maps/example-map-search-banner" with status 200
Example: Map search banner - Content
Given the page endpoint for path "/search-bar-example" returns fixture "/maps/example-map-search-banner" with status 200
And I am using a "macbook-16" device
Then I visit the page "/map"
Then I visit the page "/search-bar-example"
Then the location search banner should have the following content
| title | description | inputLabel | placeholder | image |
| Test search heading | Test introduction text | Test label | Test placeholder | /placeholders/mapbg.png |

@mockserver
Scenario: Map search banner - Custom suggestions
Given I load the page fixture with "/maps/example-map-search-banner"
Given the page endpoint for path "/search-bar-example" returns the loaded fixture
Given the "/api/tide/elasticsearch/elasticsearch_index_develop_node/_search" network request is stubbed with fixture "/maps/simple-map-results" and status 200 as alias "searchReq"
Given I visit the page "/search-bar-example"
And I wait 2 seconds
And I type "bays" into the location search bar
And I wait 2 seconds
And the search suggestions displayed should include
| Test location - testValue - 1 |
| Test location - testValue - 2 |
| With magic key |
And I click the search suggestion labelled "Test location - testValue - 1"
Then the current path should be "/test/target/url"
Then the URL should reflect that the location has the following:
| key | value |
| id | 1 |
| name | Test location - testValue - 1 |

@mockserver
Example: Map search banner (mobile)
Given the page endpoint for path "/map" returns fixture "/maps/example-map-search-banner" with status 200
And I am using a "iphone-x" device
Then I visit the page "/map"
Scenario: Map search banner - Suggestions with ArcGIS magic keys
Given the ArcGIS findAddressCandidates endpoint returns "/maps/arcgis-address-candidates" fixture
Given I load the page fixture with "/maps/example-map-search-banner"
Given the page endpoint for path "/search-bar-example" returns the loaded fixture
Given the "/api/tide/elasticsearch/elasticsearch_index_develop_node/_search" network request is stubbed with fixture "/maps/simple-map-results" and status 200 as alias "searchReq"
Given I visit the page "/search-bar-example"
And I wait 2 seconds
And I type "bays" into the location search bar
And I wait 2 seconds
And the search suggestions displayed should include
| Test location - testValue - 1 |
| Test location - testValue - 2 |
| With magic key |
And I click the search suggestion labelled "With magic key"
Then the current path should be "/test/target/url"
Then the URL should reflect that the location has the following:
| key | value |
| id | fake1234 |
| name | 1234 Fake St Fakeville Vic 3000 |
Loading

0 comments on commit 339a312

Please sign in to comment.