@@ -582,32 +582,32 @@ describe('Test the search bar result handling', () => {
582582 expect ( searchStore4 . query ) . to . eq ( '1530 Payerne' )
583583 } )
584584 cy . url ( ) . should ( 'not.contain' , 'swisssearch' )
585- // cy.url().should('not.contain', 'swisssearch_autoselect')
586- // const acceptableDelta = 0.25
587-
588- // cy.getPinia().then((pinia) => {
589- // const mapStore8 = useMapStore(pinia)
590- // const feature = mapStore8.pinnedLocation
591- // assertDefined(feature)
592- // expect(feature).to.be.a('array').that.is.not.empty
593- // expect(feature.length).to.greaterThan(1)
594- // expect(feature[0]).to.be.approximately(coordinates[0]!, acceptableDelta)
595- // expect(feature[1]).to.be.approximately(coordinates[1]!, acceptableDelta)
596- // })
597-
598- // // ----------------------------------------------------------------------
599- // cy.log('Ensuring the search dialog closes once you have selected an item')
600- // cy.get('[data-cy="search-results-locations"] [data-cy="search-result-entry"]')
601- // .as('locationSearchResults')
602- // .first()
603- // .invoke('text')
604- // .then((text) => text.trim())
605- // .should('contains', '1530 Payerne')
606-
607- // cy.log('Clicking the result, will hide the dropdown of the search result')
608- // cy.get('@locationSearchResults').should('be.visible')
609- // cy.get('@locationSearchResults').first().click()
610- // cy.get('@locationSearchResults').should('not.be.visible')
585+ cy . url ( ) . should ( 'not.contain' , 'swisssearch_autoselect' )
586+ const acceptableDelta = 0.25
587+
588+ cy . getPinia ( ) . then ( ( pinia ) => {
589+ const mapStore8 = useMapStore ( pinia )
590+ const feature = mapStore8 . pinnedLocation
591+ assertDefined ( feature )
592+ expect ( feature ) . to . be . a ( 'array' ) . that . is . not . empty
593+ expect ( feature . length ) . to . greaterThan ( 1 )
594+ expect ( feature [ 0 ] ) . to . be . approximately ( coordinates [ 0 ] ! , acceptableDelta )
595+ expect ( feature [ 1 ] ) . to . be . approximately ( coordinates [ 1 ] ! , acceptableDelta )
596+ } )
597+
598+ // ----------------------------------------------------------------------
599+ cy . log ( 'Ensuring the search dialog closes once you have selected an item' )
600+ cy . get ( '[data-cy="search-results-locations"] [data-cy="search-result-entry"]' )
601+ . as ( 'locationSearchResults' )
602+ . first ( )
603+ . invoke ( 'text' )
604+ . then ( ( text ) => text . trim ( ) )
605+ . should ( 'contains' , '1530 Payerne' )
606+
607+ cy . log ( 'Clicking the result, will hide the dropdown of the search result' )
608+ cy . get ( '@locationSearchResults' ) . should ( 'be.visible' )
609+ cy . get ( '@locationSearchResults' ) . first ( ) . click ( )
610+ cy . get ( '@locationSearchResults' ) . should ( 'not.be.visible' )
611611 } )
612612
613613 it ( 'handle swisssearch and crosshair together correctly' , ( ) => {
0 commit comments