Add component tests for ModalHeader, IconChecked, and Conformance result components
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
39
tests/components/ResultArrow.test.js
Normal file
39
tests/components/ResultArrow.test.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import ResultArrow from '@/components/Discover/Conformance/ConformanceSidebar/ResultArrow.vue';
|
||||
|
||||
describe('ResultArrow', () => {
|
||||
it('renders list items from data prop', () => {
|
||||
const wrapper = mount(ResultArrow, {
|
||||
props: {
|
||||
data: ['Activity A', 'Activity B', 'Activity C'],
|
||||
select: null,
|
||||
},
|
||||
});
|
||||
const items = wrapper.findAll('li');
|
||||
expect(items.length).toBe(3);
|
||||
expect(items[0].text()).toContain('Activity A');
|
||||
expect(items[1].text()).toContain('Activity B');
|
||||
expect(items[2].text()).toContain('Activity C');
|
||||
});
|
||||
|
||||
it('renders empty list when data is null', () => {
|
||||
const wrapper = mount(ResultArrow, {
|
||||
props: { data: null, select: null },
|
||||
});
|
||||
const items = wrapper.findAll('li');
|
||||
expect(items.length).toBe(0);
|
||||
});
|
||||
|
||||
it('renders arrow_circle_down icon for each item', () => {
|
||||
const wrapper = mount(ResultArrow, {
|
||||
props: {
|
||||
data: ['Task 1'],
|
||||
select: null,
|
||||
},
|
||||
});
|
||||
expect(wrapper.find('span.material-symbols-outlined').text()).toContain(
|
||||
'arrow_circle_down',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user