Skip to content

Commit

Permalink
fix: checkUrl should check pathname not full url
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorreem committed Aug 27, 2024
1 parent c607a53 commit 16cf887
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ Cypress.Commands.add('checkLink', (href, text) => {

Cypress.Commands.add('checkPageUrl', (url, locale = 'en') => {
const localePart = locale === 'en' ? '' : `${locale}/`;
const pageUrl = `${Cypress.config('baseUrl')}/${localePart}${url}`;
cy.url().should('be.equal', pageUrl);
const pageUrl = `/${localePart}${url}`;
cy.location().should((loc) => {
expect(loc.pathname).to.eq(pageUrl);
});
});

// CUSTOM COMMANDS THAT NEED FIREBASE ACCESS
Expand Down

0 comments on commit 16cf887

Please sign in to comment.