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

Wrote unit test for ProgressBar component

parent 1ad70ce8
No related branches found
No related tags found
1 merge request!44General components testing
Pipeline #279175 passed
......@@ -12,8 +12,6 @@
}
})
</script>
<template>
......
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