cypress-component-testing-examples icon indicating copy to clipboard operation
cypress-component-testing-examples copied to clipboard

vue2 mocked router read/write example

Open Craig1f opened this issue 3 years ago • 0 comments

To test a component that uses query params for state. We need to read from a mocked $route, and we need to push to a mocked $router.

Sets up $router with a spy so we can test attempts to update the $router. Adapted to use cy.spy() instead of jest.

Craig1f avatar Feb 01 '22 19:02 Craig1f