LoginSignup
0
0

More than 1 year has passed since last update.

cypressでhashRouterをvisitする

Posted at

対策

パラメータを変更し更新させる

OK

if ('OK', () => {
cy.visit({qs: {a: 1}, url: 'app#/search?q=検索ワード1'});
cy.visit({qs: {a: 2}: url: 'app#/search?q=検索ワード2'});
})

NG

if ('NG', () => {
cy.visit({url: 'app#/search?q=検索ワード1'});
cy.visit({url: 'app#/search?q=検索ワード2'});
})

参考

cypress
https://docs.cypress.io/api/commands/visit

react-router
https://reactrouter.com/en/main/router-components/hash-router

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0