Skip to content
Snippets Groups Projects
Commit b232a313 authored by Ingrid's avatar Ingrid
Browse files

la inn noen unit-tester

parent 180a887d
No related branches found
No related tags found
3 merge requests!21Merge profilinnstillinger into main,!13Fridge view,!4Navbar
Pipeline #217568 passed
// https://docs.cypress.io/api/introduction/api.html
describe('My First Test', () => {
it('visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'You did it!')
})
})
describe('Correct navigation links', () => {
/*TODO*/
})
describe('Navbar on all pages', () => {
/*TODO*/
})
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
"@iconify/vue": "^4.1.1", "@iconify/vue": "^4.1.1",
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue": "^4.0.0",
"@vue/test-utils": "^2.2.6", "@vue/test-utils": "^2.2.6",
"cypress": "^12.0.2", "cypress": "^12.10.0",
"jsdom": "^20.0.3", "jsdom": "^20.0.3",
"node-sass": "^8.0.0", "node-sass": "^8.0.0",
"sass-loader": "^13.2.2", "sass-loader": "^13.2.2",
...@@ -1953,9 +1953,9 @@ ...@@ -1953,9 +1953,9 @@
} }
}, },
"node_modules/commander": { "node_modules/commander": {
"version": "5.1.0", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
"integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 6" "node": ">= 6"
...@@ -2048,9 +2048,9 @@ ...@@ -2048,9 +2048,9 @@
"integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w=="
}, },
"node_modules/cypress": { "node_modules/cypress": {
"version": "12.9.0", "version": "12.10.0",
"resolved": "https://registry.npmjs.org/cypress/-/cypress-12.9.0.tgz", "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.10.0.tgz",
"integrity": "sha512-Ofe09LbHKgSqX89Iy1xen2WvpgbvNxDzsWx3mgU1mfILouELeXYGwIib3ItCwoRrRifoQwcBFmY54Vs0zw7QCg==", "integrity": "sha512-Y0wPc221xKKW1/4iAFCphkrG2jNR4MjOne3iGn4mcuCaE7Y5EtXL83N8BzRsAht7GYfWVjJ/UeTqEdDKHz39HQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
...@@ -2068,7 +2068,7 @@ ...@@ -2068,7 +2068,7 @@
"check-more-types": "^2.24.0", "check-more-types": "^2.24.0",
"cli-cursor": "^3.1.0", "cli-cursor": "^3.1.0",
"cli-table3": "~0.6.1", "cli-table3": "~0.6.1",
"commander": "^5.1.0", "commander": "^6.2.1",
"common-tags": "^1.8.0", "common-tags": "^1.8.0",
"dayjs": "^1.10.4", "dayjs": "^1.10.4",
"debug": "^4.3.4", "debug": "^4.3.4",
...@@ -2086,7 +2086,7 @@ ...@@ -2086,7 +2086,7 @@
"listr2": "^3.8.3", "listr2": "^3.8.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"log-symbols": "^4.0.0", "log-symbols": "^4.0.0",
"minimist": "^1.2.6", "minimist": "^1.2.8",
"ospath": "^1.2.2", "ospath": "^1.2.2",
"pretty-bytes": "^5.6.0", "pretty-bytes": "^5.6.0",
"proxy-from-env": "1.0.0", "proxy-from-env": "1.0.0",
......
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import HelloWorld from '../HelloWorld.vue'
describe('HelloWorld', () => {
it('renders properly', () => {
const wrapper = mount(HelloWorld, { props: { msg: 'Hello Vitest' } })
expect(wrapper.text()).toContain('Hello Vitest')
})
})
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import Navbar from "@/components/Navbar.vue";
import { Icon } from '@iconify/vue';
describe('Navbar', () => {
it('contains 5 links', () => {
const wrapper = mount(Navbar)
expect(wrapper.findAll('RouterLink').length).toBe(5)
})
it('contains 5 icons', () => {
const wrapper = mount(Navbar)
const icons = wrapper.findAllComponents(Icon)
expect(icons).toHaveLength(5)})
})
/*APP COLOURS*/ /*APP COLORS*/
$green: #00663C; $green: #00663C;
$white:#FFFFFF; $white:#FFFFFF;
$grey:#D9D9D9; $grey:#D9D9D9;
......
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