How to mock route ? #14609
Unanswered
bhardwajashutosh9520
asked this question in
Questions and Help
How to mock route ?
#14609
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to mock and stub the route change .
for example :
Code : -
describe('company profile edit version test cases:', function() {
beforeEach(function() {
cy.fixture('companyData').then(data => {
this.data = data;
});
cy.stub(Router, 'push').returns(cy.stub());
});
it('redirect user :', function() {
cy.server();
cy.route('GET',
http://localhost:8000/user/detail
, this.data.userData);cy.visit(
http://localhost:3000/verify#access_token=N2Dr6jFxMkhscOq0TurVMMBHVMw94TZ
,);
});
});
Beta Was this translation helpful? Give feedback.
All reactions