Skip to content

Commit

Permalink
Merge pull request #1194 from geoadmin/feat-pb-400-test-search-result…
Browse files Browse the repository at this point in the history
…-is-hidden

PB-400: Add test for hiding the dropdown adter selecting a search result
  • Loading branch information
ismailsunni authored Jan 14, 2025
2 parents 9b2e7f0 + d003f79 commit 43cd93c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/cypress/tests-e2e/search/search-results.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,19 @@ describe('Test the search bar result handling', () => {
expect(feature[0]).to.be.approximately(coordinates[0], acceptableDelta)
expect(feature[1]).to.be.approximately(coordinates[1], acceptableDelta)
})

// ----------------------------------------------------------------------
cy.log('Ensuring the search dialog closes once you have selected an item')
cy.get('[data-cy="search-results-locations"] [data-cy="search-result-entry"]')
.as('locationSearchResults')
.first()
.invoke('text')
.then((text) => text.trim())
.should('eq', '1530 Payerne')

cy.log('Clicking the result, will hide the dropdown of the search result')
cy.get('@locationSearchResults').should('be.visible')
cy.get('@locationSearchResults').first().click()
cy.get('@locationSearchResults').should('not.be.visible')
})
})

0 comments on commit 43cd93c

Please sign in to comment.