diff --git a/cypress/e2e/NotFoundView.cy.ts b/cypress/e2e/NotFoundView.cy.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f8515e8250d43784702ed3e645e08976a70b43a --- /dev/null +++ b/cypress/e2e/NotFoundView.cy.ts @@ -0,0 +1,17 @@ +describe('NotFound Test', () => { + beforeEach(() => { + cy.visit('/login'); + cy.get('#emailInput input').type('user@example.com'); + cy.get('#passwordInput input').type('John1'); + cy.get('form').submit(); + cy.wait(1000); + cy.visit('/') + }) + it('redirects user when page is not found, then go home', () => { + cy.visit('/non-existent-page') + cy.get('[data-cy="404-error"]').should('exist') + cy.get('[data-cy="to-home"]').click() + cy.url().should('include', '/') + }) + +}) \ No newline at end of file diff --git a/src/views/NotFoundView.vue b/src/views/NotFoundView.vue index abe797a09a88baf1be90e93bd505c906c8cf9b55..a65861a1c669dbb0904dc814f0f8a63e29777dbc 100644 --- a/src/views/NotFoundView.vue +++ b/src/views/NotFoundView.vue @@ -11,7 +11,7 @@ Beklager, det har oppstått en feil. Forespurt side ikke funnet! </div> <div class="error-actions"> - <Button1 button-text="Ta meg hjem" @click="home" /> + <Button1 button-text="Take Me Home" @click="home" /> </div> </div> </div>