Skip to content
Snippets Groups Projects
Commit 0971e7c5 authored by Vilde Min Vikan's avatar Vilde Min Vikan
Browse files

Merge branch 'GeneralComponentsTesting' into 'master'

General components testing

See merge request !44
parents a7ec0f97 2ec44bec
No related branches found
No related tags found
1 merge request!44General components testing
Pipeline #279457 passed
......@@ -12,8 +12,6 @@
}
})
</script>
<template>
......
import { shallowMount } from '@vue/test-utils';
import InfoComponent from '@/components/InfoComponent.vue'
import { describe, it, expect } from 'vitest'
//Needs to be updated when the info component gets dynamic data instead of static data
describe('InfoComponent', () => {
it('renders the correct quote and total savings', () => {
const wrapper = shallowMount(InfoComponent);
const quote = wrapper.find('#Quote');
const totalSavings = wrapper.find('#TotalSavings');
expect(quote.text()).toBe('Sparetips: Sett av et jevnt beløp hver måned på sparekonto eller lignende.');
expect(totalSavings.text()).toBe('Våre brukere har spart til sammen 5000 nok');
});
});
import { shallowMount } from '@vue/test-utils';
import ProgressBar from '@/components/ProgressBar.vue'
import { describe, it, expect } from 'vitest'
describe('MyComponent', () => {
it('renders correctly with props', () => {
const wrapper = shallowMount(ProgressBar, {
props: {
Max: 10,
Current: 5
}
});
expect(wrapper.find('progress').exists()).toBe(true);
});
it('renders progress bar with correct max and value attributes', () => {
const wrapper = shallowMount(ProgressBar, {
props: {
Max: 10,
Current: 5
}
});
const progress = wrapper.find('progress');
expect(progress.attributes('max')).toBe('10');
expect(progress.attributes('value')).toBe('6');
});
});
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