Skip to content
Snippets Groups Projects
Commit b15d736e authored by Ingrid Martinsheimen Egge's avatar Ingrid Martinsheimen Egge :cow2:
Browse files

sypress tester til navbar

parent e910ead7
No related branches found
No related tags found
1 merge request!21Merge profilinnstillinger into main
Pipeline #218812 failed
...@@ -3,6 +3,6 @@ const { defineConfig } = require('cypress') ...@@ -3,6 +3,6 @@ const { defineConfig } = require('cypress')
module.exports = defineConfig({ module.exports = defineConfig({
e2e: { e2e: {
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}', specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
baseUrl: 'http://localhost:4173' baseUrl: 'http://localhost:5173'
} }
}) })
describe('Correct navigation links', () => { describe('Correct navigation links', () => {
/*TODO*/ it("is sent to error page if page does not exist", () => {
cy.visit('/qwerty')
cy.contains('#msg', '404')
})
it("navigates to settings page", () => {
cy.visit('/')
cy.get('#settingsIcon').click()
cy.url().should('include', '/profileSettings')
})
/*TODO: Other pages*/
}) })
describe('Navbar on all pages', () => { describe('Navbar on all pages', () => {
/*TODO*/ it("front page has a navbar",()=> {
cy.visit('/')
cy.get('nav').should('exist')
})
it("settings page has a navbar",()=> {
cy.visit('/profileSettings')
cy.get('nav').should('exist')
})
/*TODO: other pages*/
}) })
\ No newline at end of file
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
</RouterLink> </RouterLink>
</li> </li>
<li> <li>
<RouterLink :to="'/'" :aria-label="'link to settings page'"> <RouterLink :to="'/profileSettings'" :aria-label="'link to settings page'">
<Icon icon="mdi:cog" :color="iconColor" :style="{ fontSize: iconSize }"/> <Icon id="settingsIcon" icon="mdi:cog" :color="iconColor" :style="{ fontSize: iconSize }"/>
</RouterLink> </RouterLink>
</li> </li>
</ul> </ul>
......
<template> <template>
<h1>404</h1> <h1 id="msg">404</h1>
<h2>Oida, denne siden finnes ikke</h2> <h2>Oida, denne siden finnes ikke</h2>
<RouterLink to="/">Gå tilbake til forsiden</RouterLink> <RouterLink to="/">Gå tilbake til forsiden</RouterLink>
</template> </template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment