17500: Allows Cypress tests to navigate using the app's router.
[arvados-workbench2.git] / cypress / integration / page-not-found.spec.js
index 3dd15a67970668fdb2772352185b170138d0e36c..5d6a26b7d654ee0d2adc7c8f8fbdbccca9dc344b 100644 (file)
@@ -19,12 +19,9 @@ describe('Page not found tests', function() {
     });
 
     it('shows not found page', function() {
-        // given
-        const invalidUUID = '1212r12r12r12r12r12r21r'
-
         // when
         cy.loginAs(adminUser);
-        cy.visit(`/collections/${invalidUUID}`);
+        cy.goToPath(`/this/is/an/invalid/route`);
 
         // then
         cy.get('[data-cy=not-found-page]').should('exist');
@@ -38,10 +35,10 @@ describe('Page not found tests', function() {
 
         // when
         cy.loginAs(adminUser);
-        cy.visit(`/projects/${notExistingUUID}`);
+        cy.goToPath(`/projects/${notExistingUUID}`);
 
         // then
-        cy.get('[data-cy=not-found-page]').should('not.exist');
         cy.get('[data-cy=not-found-content]').should('exist');
+        cy.get('[data-cy=not-found-page]').should('not.exist');
     });
 })
\ No newline at end of file