Skip to content

Commit

Permalink
test: update cypress location properties assertion usage
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorlxy committed Jan 2, 2024
1 parent 70d0c58 commit 49f6f48
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions e2e/tests/routes/non-ascii-paths.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ it('should support rendering non-ASCII paths links and navigate to it correctly'
.should('have.text', '中文路径')
.click()

cy.location().should((location) => {
expect(location.pathname).to.eq(
encodeURI(`${E2E_BASE}routes/non-ascii-paths/中文目录名/中文文件名.html`),
)
})
cy.location('pathname').should(
'eq',
encodeURI(`${E2E_BASE}routes/non-ascii-paths/中文目录名/中文文件名.html`),
)

cy.get('.e2e-theme-content p').should('have.text', '这是一个中文文件')
})

0 comments on commit 49f6f48

Please sign in to comment.