Skip to content
Snippets Groups Projects
Commit 00b1fe72 authored by Sverre Frogner Haugen's avatar Sverre Frogner Haugen
Browse files

Added unit test to TotalSavings component

parent ebc48c88
No related branches found
No related tags found
1 merge request!50Home page
Pipeline #279892 failed
// Import the necessary packages
import { mount } from '@vue/test-utils'
import TotalSavings from '@/components/HomeComponents/TotalSavings.vue'
import { describe, it, expect } from 'vitest'
import { createPinia } from 'pinia'
describe('YourComponent', () => {
it('renders correctly with default value', async () => {
const pinia = createPinia()
const wrapper = mount(TotalSavings, {
global:{
plugins:[pinia]
}
})
// Assert that the component renders correctly
expect(wrapper.exists()).toBe(true)
// Assert that the rendered value matches the given value
expect(wrapper.find('#Saved').text()).toBe(`0 nok`)
})
})
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