Skip to content

Commit

Permalink
Merge pull request #1145 from geoadmin/feat-pb-1189-add-test-layer-fe…
Browse files Browse the repository at this point in the history
…ature-search

PB-1189: add layer feature search test
  • Loading branch information
sommerfe authored Nov 29, 2024
2 parents 444595c + bbe6a69 commit 04c928e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/cypress/tests-e2e/search/search-results.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,16 @@ describe('Test the search bar result handling', () => {
cy.get(searchbarSelector).click()
cy.get('@locationSearchResults').should('not.be.visible')

cy.log('Testing layer feature search')
cy.get(searchbarSelector).click()
cy.get('[data-cy="search-results-featuresearch"] [data-cy="search-result-entry"]').click()
cy.url().should((url) => {
const center = new URLSearchParams(url.split('map')[1]).get('center')
const [x, y] = center.split(',').map(parseFloat)
expect(x).to.be.closeTo(expectedCenterDefaultProjection[0], 1)
expect(y).to.be.closeTo(expectedCenterDefaultProjection[1], 1)
})

cy.log('Checking that the swisssearch url param is not present after reloading the page')
cy.reload()
cy.waitMapIsReady()
Expand Down

0 comments on commit 04c928e

Please sign in to comment.