Skip to content

Commit

Permalink
test(route-information-popup): popup text splits mid-word
Browse files Browse the repository at this point in the history
  • Loading branch information
koebi authored and TheGreatRefrigerator committed Mar 21, 2023
1 parent df1d005 commit e3beb53
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cypress/e2e/directions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ describe('Directions component', () => {
cy.get('.custom-html-icon-div').eq(0).should('have.css', 'background-color', 'rgb(0, 128, 0)')
cy.get('.custom-html-icon-div').eq(1).should('have.css', 'background-color', 'rgb(255, 0, 0)')
})

it('shows the popup correctly', () => {
let contentWidth = 0
cy.get('.cy-route-popup-icon').then((element) => {
contentWidth += element.width()
})
cy.get('.cy-route-popup-text').then((element) => {
contentWidth += element.width()
})

// content width is larger than width of above 2 divs combined
cy.get('.leaflet-popup-content').then(($popup) => {
expect($popup.width()).to.be.gte(contentWidth)
})
})
})

context('loads round trip from url link', () => {
Expand Down

0 comments on commit e3beb53

Please sign in to comment.