Skip to content

Commit

Permalink
Compare paths for urls in i18n tests (cypress-io#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane authored Mar 19, 2020
1 parent 77796df commit 30c9d4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/i18n_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ describe('i18n', () => {
it('provides an alternate link for available English languages', function () {
cy.wrap(this.langValues).each((lang) => {
cy.get(`link[hreflang="${lang}"]`).should(($linkTag) => {
let expectedHref = `https://docs.cypress.io/${lang}/guides/overview/why-cypress.html`
let expectedPath = `${lang}/guides/overview/why-cypress.html`

if (lang === 'en') {
expectedHref = 'https://docs.cypress.io/guides/overview/why-cypress.html'
expectedPath = 'guides/overview/why-cypress.html'
}

expect($linkTag[0].rel).to.eq('alternate')
expect($linkTag[0].href).to.eq(expectedHref)
expect($linkTag[0].href).to.include(expectedPath)
})
})
})
Expand Down

0 comments on commit 30c9d4f

Please sign in to comment.