@zap-wunschlachen/wl-shared-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/playwright.yml +215 -0
- package/.github/workflows/static.yml +62 -0
- package/.prettierrc +5 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/preview.ts +37 -0
- package/.storybook/storyWrapper.vue +18 -0
- package/.storybook/withVuetifyTheme.decorator.ts +21 -0
- package/App.vue +95 -0
- package/README.md +56 -0
- package/heroicons.ts +75 -0
- package/index.html +19 -0
- package/package.json +66 -0
- package/playwright.config.ts +35 -0
- package/public/audio/dummy_pink_noise.wav +0 -0
- package/public/background.svg +60 -0
- package/public/javascript.svg +1 -0
- package/public/style.css +187 -0
- package/public/technologies.svg +22 -0
- package/src/assets/css/base.css +235 -0
- package/src/assets/css/variables.css +96 -0
- package/src/assets/fonts/Outfit-Black.ttf +0 -0
- package/src/assets/fonts/Outfit-Bold.ttf +0 -0
- package/src/assets/fonts/Outfit-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Outfit-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Outfit-Light.ttf +0 -0
- package/src/assets/fonts/Outfit-Medium.ttf +0 -0
- package/src/assets/fonts/Outfit-Regular.ttf +0 -0
- package/src/assets/fonts/Outfit-SemiBold.ttf +0 -0
- package/src/assets/fonts/Outfit-Thin.ttf +0 -0
- package/src/components/Accordion/Accordion.css +59 -0
- package/src/components/Accordion/AccordionGroup.vue +51 -0
- package/src/components/Accordion/AccordionItem.vue +66 -0
- package/src/components/Appointment/Card/Actions.css +30 -0
- package/src/components/Appointment/Card/Actions.vue +66 -0
- package/src/components/Appointment/Card/Card.css +49 -0
- package/src/components/Appointment/Card/Card.vue +55 -0
- package/src/components/Appointment/Card/Details.css +51 -0
- package/src/components/Appointment/Card/Details.vue +44 -0
- package/src/components/Audio/Audio.vue +188 -0
- package/src/components/Audio/Waveform.vue +118 -0
- package/src/components/Button/Button.vue +119 -0
- package/src/components/CheckBox/CheckBox.css +185 -0
- package/src/components/CheckBox/Checkbox.vue +130 -0
- package/src/components/DateInput/DateInput.css +3 -0
- package/src/components/DateInput/DateInput.vue +263 -0
- package/src/components/Dialog/Dialog.css +6 -0
- package/src/components/Dialog/Dialog.vue +29 -0
- package/src/components/EditField/EditField.css +20 -0
- package/src/components/EditField/EditField.vue +202 -0
- package/src/components/IconBullet/IconBullet.vue +86 -0
- package/src/components/IconBullet/IconBulletList.vue +41 -0
- package/src/components/Icons/Audio/CloudFailed.vue +21 -0
- package/src/components/Icons/Audio/CloudSaved.vue +22 -0
- package/src/components/Icons/Audio/Delete.vue +16 -0
- package/src/components/Icons/Audio/Pause.vue +19 -0
- package/src/components/Icons/Audio/Play.vue +16 -0
- package/src/components/Icons/CalendarNotification.vue +126 -0
- package/src/components/Icons/Chair.vue +32 -0
- package/src/components/Icons/ChairNotification.vue +35 -0
- package/src/components/Icons/Circle.vue +66 -0
- package/src/components/Icons/FavIcon.vue +22 -0
- package/src/components/Icons/FilledCircle.vue +11 -0
- package/src/components/Icons/Group3.vue +46 -0
- package/src/components/Icons/RingNotification.vue +54 -0
- package/src/components/Icons/SolidArrowRight.vue +14 -0
- package/src/components/Icons/calendar.vue +17 -0
- package/src/components/Icons/checkbox.vue +19 -0
- package/src/components/Icons/outlineChecked.vue +27 -0
- package/src/components/Icons/play.vue +6 -0
- package/src/components/Input/Input.css +187 -0
- package/src/components/Input/Input.vue +247 -0
- package/src/components/Laboratory/AppointmentCard/AppointmentCard.css +7 -0
- package/src/components/Laboratory/AppointmentCard/AppointmentCard.vue +116 -0
- package/src/components/Laboratory/ChatBoxImage/ChatBoxImage.vue +81 -0
- package/src/components/Laboratory/ChatMessage/ChatMessage.vue +113 -0
- package/src/components/Laboratory/ChatMessage/ChatMessageBadge.css +4 -0
- package/src/components/Laboratory/ChatMessage/ChatMessageBadge.vue +99 -0
- package/src/components/Laboratory/ChatNotification/ChatNotification.vue +130 -0
- package/src/components/Laboratory/DocumentCard/DocumentCard.css +3 -0
- package/src/components/Laboratory/DocumentCard/DocumentCard.vue +50 -0
- package/src/components/Laboratory/DocumentCard/DocumentCardItem.vue +53 -0
- package/src/components/Laboratory/InfoCard/InfoCard.vue +162 -0
- package/src/components/Laboratory/MainColumnsBar/MainColumnsBar.vue +102 -0
- package/src/components/Laboratory/ProgressCircle/ProgressCircle.vue +152 -0
- package/src/components/Laboratory/ProgressLinear/ProgressLinear.css +33 -0
- package/src/components/Laboratory/ProgressLinear/ProgressLinear.vue +75 -0
- package/src/components/Laboratory/SelectionColumnBar/SelectionColumnBar.vue +92 -0
- package/src/components/Laboratory/StatusNotification/StatusNotification.vue +49 -0
- package/src/components/Laboratory/TagLabel/TagLabel.vue +126 -0
- package/src/components/Laboratory/TagLabelGroup/TagLabelGroup.vue +97 -0
- package/src/components/Laboratory/TicketCard/TicketCard.css +3 -0
- package/src/components/Laboratory/TicketCard/TicketCard.vue +143 -0
- package/src/components/Laboratory/TimeLine/TimeLineEvent.css +18 -0
- package/src/components/Laboratory/TimeLine/TimeLineEvent.vue +119 -0
- package/src/components/Laboratory/TimeLine/Timeline.css +4 -0
- package/src/components/Laboratory/TimeLine/Timeline.vue +30 -0
- package/src/components/Modal/Modal.css +6 -0
- package/src/components/Modal/Modal.vue +23 -0
- package/src/components/NotificationBubble/NotificationBubble.css +4 -0
- package/src/components/NotificationBubble/NotificationBubble.vue +90 -0
- package/src/components/OtpInput/OtpInput.css +39 -0
- package/src/components/OtpInput/OtpInput.vue +144 -0
- package/src/components/PhoneInput/PhoneInput.css +32 -0
- package/src/components/PhoneInput/PhoneInput.vue +114 -0
- package/src/components/Select/Select.css +150 -0
- package/src/components/Select/Select.vue +304 -0
- package/src/components/TextArea/TextArea.css +3 -0
- package/src/components/TextArea/TextArea.vue +126 -0
- package/src/components/TickBox/TickBox.css +49 -0
- package/src/components/TickBox/TickBox.vue +126 -0
- package/src/components/index.ts +20 -0
- package/src/constants/buttonEnums.ts +0 -0
- package/src/constants/iconEnums.ts +4 -0
- package/src/i18n/i18n.ts +16 -0
- package/src/i18n/locales/de.json +19 -0
- package/src/i18n/locales/en.json +19 -0
- package/src/index.ts +31 -0
- package/src/main.ts +11 -0
- package/src/plugins/vuetify.ts +131 -0
- package/src/shims-vue.d.ts +10 -0
- package/src/stories/Accordion.stories.ts +650 -0
- package/src/stories/Audio.stories.ts +29 -0
- package/src/stories/Button.stories.ts +263 -0
- package/src/stories/CheckBox.stories.ts +348 -0
- package/src/stories/DateInput.stories.ts +54 -0
- package/src/stories/Dialog.stories.ts +147 -0
- package/src/stories/EditField.stories.ts +79 -0
- package/src/stories/IconBullet/IconBullet.stories.ts +201 -0
- package/src/stories/IconBullet/IconBulletList.stories.ts +275 -0
- package/src/stories/Input.stories.ts +351 -0
- package/src/stories/Laboratory/Cards/AppointmentCard/AppointmentCard.stories.ts +260 -0
- package/src/stories/Laboratory/Cards/DocumentCard/DocumentCard.stories.ts +176 -0
- package/src/stories/Laboratory/Cards/DocumentCard/DocumentCardItem.stories.ts +119 -0
- package/src/stories/Laboratory/Cards/InfoCard/InfoCard.stories.ts +320 -0
- package/src/stories/Laboratory/Cards/TicketCard/TicketCard.stories.ts +335 -0
- package/src/stories/Laboratory/Chat/ChatBoxImage.stories.ts +82 -0
- package/src/stories/Laboratory/Chat/ChatMessage.stories.ts +198 -0
- package/src/stories/Laboratory/Chat/ChatMessageBadge.stories.ts +204 -0
- package/src/stories/Laboratory/Chat/ChatNotification.stories.ts +144 -0
- package/src/stories/Laboratory/Chat/ProgressLinear.stories.ts +186 -0
- package/src/stories/Laboratory/Chat/StatusNotification.stories.ts +111 -0
- package/src/stories/Laboratory/MainColumnsBar.stories.ts +48 -0
- package/src/stories/Laboratory/ProgressCircle.stories.ts +261 -0
- package/src/stories/Laboratory/SelectionColumnBar.stories.ts +234 -0
- package/src/stories/Laboratory/TagLabel.stories.ts +418 -0
- package/src/stories/Laboratory/TagLabelGroup.stories.ts +234 -0
- package/src/stories/Laboratory/Timeline.stories.ts +403 -0
- package/src/stories/NotificationBubble.stories.ts +194 -0
- package/src/stories/OtpInput.stories.ts +101 -0
- package/src/stories/PhoneInput.stories.ts +53 -0
- package/src/stories/Select.stories.ts +419 -0
- package/src/stories/TextArea.stories.ts +112 -0
- package/src/stories/TickBox.stories.ts +294 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/v-icon.stories.ts +91 -0
- package/src/types/index.ts +21 -0
- package/src/vite-env.d.ts +1 -0
- package/tests/e2e/README.md +221 -0
- package/tests/e2e/accessibility.spec.ts +639 -0
- package/tests/e2e/accordion.spec.ts +42 -0
- package/tests/e2e/additional-components.spec.ts +438 -0
- package/tests/e2e/all-components.spec.ts +135 -0
- package/tests/e2e/button-fixed.spec.ts +59 -0
- package/tests/e2e/button.spec.ts +76 -0
- package/tests/e2e/checkbox.spec.ts +50 -0
- package/tests/e2e/date-input.spec.ts +46 -0
- package/tests/e2e/debug.spec.ts +52 -0
- package/tests/e2e/dialog.spec.ts +58 -0
- package/tests/e2e/input.spec.ts +55 -0
- package/tests/e2e/laboratory-components.spec.ts +321 -0
- package/tests/e2e/otp-input.spec.ts +50 -0
- package/tests/e2e/select.spec.ts +52 -0
- package/tests/e2e/storybook-utils.ts +59 -0
- package/tests/e2e/test-basic.spec.ts +34 -0
- package/tests/e2e/visual-regression.spec.ts +351 -0
- package/tests/unit/components/Accordion/AccordionGroup.spec.ts +343 -0
- package/tests/unit/components/Accordion/AccordionItem.spec.ts +384 -0
- package/tests/unit/components/Audio/Audio.spec.ts +404 -0
- package/tests/unit/components/Audio/Waveform.spec.ts +484 -0
- package/tests/unit/components/Core/Button.spec.ts +337 -0
- package/tests/unit/components/Core/Checkbox.spec.ts +545 -0
- package/tests/unit/components/Core/DateInput.spec.ts +691 -0
- package/tests/unit/components/Core/Dialog.spec.ts +486 -0
- package/tests/unit/components/Core/EditField.spec.ts +783 -0
- package/tests/unit/components/Core/Input.spec.ts +513 -0
- package/tests/unit/components/Core/Modal.spec.ts +519 -0
- package/tests/unit/components/Core/NotificationBubble.spec.ts +607 -0
- package/tests/unit/components/Core/OtpInput.spec.ts +709 -0
- package/tests/unit/components/Core/PhoneInput.spec.ts +620 -0
- package/tests/unit/components/Core/Select.spec.ts +713 -0
- package/tests/unit/components/Core/TextArea.spec.ts +566 -0
- package/tests/unit/components/Core/TickBox.spec.ts +780 -0
- package/tests/unit/components/IconBullet/IconBullet.spec.ts +357 -0
- package/tests/unit/components/IconBullet/IconBulletList.spec.ts +372 -0
- package/tests/unit/components/Icons/Audio/CloudFailed.spec.ts +109 -0
- package/tests/unit/components/Icons/Audio/CloudSaved.spec.ts +150 -0
- package/tests/unit/components/Icons/Audio/Delete.spec.ts +159 -0
- package/tests/unit/components/Icons/Audio/Pause.spec.ts +209 -0
- package/tests/unit/components/Icons/Audio/Play.spec.ts +218 -0
- package/tests/unit/components/Icons/CalendarNotification.spec.ts +187 -0
- package/tests/unit/components/Icons/Chair.spec.ts +235 -0
- package/tests/unit/components/Icons/ChairNotification.spec.ts +312 -0
- package/tests/unit/components/Icons/Circle.spec.ts +256 -0
- package/tests/unit/components/Icons/FavIcon.spec.ts +252 -0
- package/tests/unit/components/Icons/FilledCircle.spec.ts +275 -0
- package/tests/unit/components/Icons/Group3.spec.ts +356 -0
- package/tests/unit/components/Icons/RingNotification.spec.ts +394 -0
- package/tests/unit/components/Icons/calendar.spec.ts +287 -0
- package/tests/unit/components/Icons/checkbox.spec.ts +316 -0
- package/tests/unit/components/Icons/outlineChecked.spec.ts +435 -0
- package/tests/unit/components/Icons/play.spec.ts +309 -0
- package/tests/unit/components/Laboratory/AppointmentCard.spec.ts +168 -0
- package/tests/unit/components/Laboratory/ChatBoxImage.spec.ts +180 -0
- package/tests/unit/components/Laboratory/ChatMessage.spec.ts +264 -0
- package/tests/unit/components/Laboratory/ChatMessageBadge.spec.ts +283 -0
- package/tests/unit/components/Laboratory/ChatNotification.spec.ts +257 -0
- package/tests/unit/components/Laboratory/DocumentCard.spec.ts +229 -0
- package/tests/unit/components/Laboratory/DocumentCardItem.spec.ts +237 -0
- package/tests/unit/components/Laboratory/InfoCard.spec.ts +309 -0
- package/tests/unit/components/Laboratory/MainColumnsBar.spec.ts +252 -0
- package/tests/unit/components/Laboratory/ProgressCircle.spec.ts +291 -0
- package/tests/unit/components/Laboratory/ProgressLinear.spec.ts +276 -0
- package/tests/unit/components/Laboratory/SelectionColumnBar.spec.ts +289 -0
- package/tests/unit/components/Laboratory/StatusNotification.spec.ts +297 -0
- package/tests/unit/components/Laboratory/TagLabel.spec.ts +354 -0
- package/tests/unit/components/Laboratory/TagLabelGroup.spec.ts +378 -0
- package/tests/unit/components/Laboratory/TicketCard.spec.ts +352 -0
- package/tests/unit/components/Laboratory/TimeLineEvent.spec.ts +382 -0
- package/tests/unit/components/Laboratory/Timeline.spec.ts +420 -0
- package/tests/unit/constants/iconEnums.spec.ts +40 -0
- package/tests/unit/i18n/i18n.spec.ts +89 -0
- package/tests/unit/plugins/vuetify.spec.ts +221 -0
- package/tests/unit/setup.ts +190 -0
- package/tests/unit/src/components/index.spec.ts +193 -0
- package/tests/unit/src/index.spec.ts +183 -0
- package/tests/unit/src/main.spec.ts +152 -0
- package/tsconfig.json +26 -0
- package/vite.config.ts +29 -0
- package/vitest.config.ts +84 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import Delete from '@components/Icons/Audio/Delete.vue';
|
|
4
|
+
|
|
5
|
+
describe('Delete Icon', () => {
|
|
6
|
+
describe('Rendering', () => {
|
|
7
|
+
it('renders as SVG element', () => {
|
|
8
|
+
const wrapper = mount(Delete);
|
|
9
|
+
expect(wrapper.find('svg').exists()).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('has correct SVG attributes', () => {
|
|
13
|
+
const wrapper = mount(Delete);
|
|
14
|
+
const svg = wrapper.find('svg');
|
|
15
|
+
|
|
16
|
+
expect(svg.attributes('width')).toBe('24');
|
|
17
|
+
expect(svg.attributes('height')).toBe('24');
|
|
18
|
+
expect(svg.attributes('viewBox')).toBe('0 0 24 24');
|
|
19
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
20
|
+
expect(svg.attributes('xmlns')).toBe('http://www.w3.org/2000/svg');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('contains exactly 1 path element', () => {
|
|
24
|
+
const wrapper = mount(Delete);
|
|
25
|
+
const paths = wrapper.findAll('path');
|
|
26
|
+
expect(paths).toHaveLength(1);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe('Path Structure', () => {
|
|
31
|
+
it('path represents X inside circle', () => {
|
|
32
|
+
const wrapper = mount(Delete);
|
|
33
|
+
const path = wrapper.find('path');
|
|
34
|
+
|
|
35
|
+
const pathData = path.attributes('d');
|
|
36
|
+
expect(pathData).toContain('M9.75 9.75L14.25 14.25'); // First diagonal
|
|
37
|
+
expect(pathData).toContain('M14.25 9.75L9.75 14.25'); // Second diagonal
|
|
38
|
+
expect(pathData).toContain('M21 12C21 16.9706'); // Circle
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('path has correct stroke properties', () => {
|
|
42
|
+
const wrapper = mount(Delete);
|
|
43
|
+
const path = wrapper.find('path');
|
|
44
|
+
|
|
45
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
46
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
47
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('path contains complete circle definition', () => {
|
|
51
|
+
const wrapper = mount(Delete);
|
|
52
|
+
const path = wrapper.find('path');
|
|
53
|
+
|
|
54
|
+
const pathData = path.attributes('d');
|
|
55
|
+
// Circle centered at 12,12 with radius 9
|
|
56
|
+
expect(pathData).toContain('12 21C7.02944 21'); // Bottom point
|
|
57
|
+
expect(pathData).toContain('3 12C3 7.02944'); // Left side
|
|
58
|
+
expect(pathData).toContain('12 3C16.9706 3'); // Top point
|
|
59
|
+
expect(pathData).toContain('21 12Z'); // Right side and close
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('X marks cross at correct coordinates', () => {
|
|
63
|
+
const wrapper = mount(Delete);
|
|
64
|
+
const path = wrapper.find('path');
|
|
65
|
+
|
|
66
|
+
const pathData = path.attributes('d');
|
|
67
|
+
// X should be centered in the circle
|
|
68
|
+
expect(pathData).toContain('9.75 9.75'); // Top-left
|
|
69
|
+
expect(pathData).toContain('14.25 14.25'); // Bottom-right
|
|
70
|
+
expect(pathData).toContain('14.25 9.75'); // Top-right
|
|
71
|
+
expect(pathData).toContain('9.75 14.25'); // Bottom-left
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('Visual Properties', () => {
|
|
76
|
+
it('stroke uses the correct color', () => {
|
|
77
|
+
const wrapper = mount(Delete);
|
|
78
|
+
const path = wrapper.find('path');
|
|
79
|
+
|
|
80
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('path has no fill', () => {
|
|
84
|
+
const wrapper = mount(Delete);
|
|
85
|
+
const svg = wrapper.find('svg');
|
|
86
|
+
|
|
87
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('has rounded line caps and joins', () => {
|
|
91
|
+
const wrapper = mount(Delete);
|
|
92
|
+
const path = wrapper.find('path');
|
|
93
|
+
|
|
94
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
95
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
describe('Accessibility', () => {
|
|
100
|
+
it('svg is properly structured for screen readers', () => {
|
|
101
|
+
const wrapper = mount(Delete);
|
|
102
|
+
const svg = wrapper.find('svg');
|
|
103
|
+
|
|
104
|
+
expect(svg.element.tagName.toLowerCase()).toBe('svg');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
describe('Component Integration', () => {
|
|
109
|
+
it('can be mounted without props', () => {
|
|
110
|
+
expect(() => {
|
|
111
|
+
mount(Delete);
|
|
112
|
+
}).not.toThrow();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('renders consistently on multiple mounts', () => {
|
|
116
|
+
const wrapper1 = mount(Delete);
|
|
117
|
+
const wrapper2 = mount(Delete);
|
|
118
|
+
|
|
119
|
+
expect(wrapper1.html()).toBe(wrapper2.html());
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('maintains correct proportions', () => {
|
|
123
|
+
const wrapper = mount(Delete);
|
|
124
|
+
const svg = wrapper.find('svg');
|
|
125
|
+
|
|
126
|
+
// Icon should be square
|
|
127
|
+
expect(svg.attributes('width')).toBe(svg.attributes('height'));
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('uses standard 24x24 icon size', () => {
|
|
131
|
+
const wrapper = mount(Delete);
|
|
132
|
+
const svg = wrapper.find('svg');
|
|
133
|
+
|
|
134
|
+
expect(svg.attributes('width')).toBe('24');
|
|
135
|
+
expect(svg.attributes('height')).toBe('24');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe('Icon Semantics', () => {
|
|
140
|
+
it('represents a delete/close action', () => {
|
|
141
|
+
const wrapper = mount(Delete);
|
|
142
|
+
const path = wrapper.find('path');
|
|
143
|
+
|
|
144
|
+
// Should contain X shape
|
|
145
|
+
const pathData = path.attributes('d');
|
|
146
|
+
expect(pathData).toMatch(/M9\.75 9\.75L14\.25 14\.25/);
|
|
147
|
+
expect(pathData).toMatch(/M14\.25 9\.75L9\.75 14\.25/);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it('uses circle as boundary', () => {
|
|
151
|
+
const wrapper = mount(Delete);
|
|
152
|
+
const path = wrapper.find('path');
|
|
153
|
+
|
|
154
|
+
// Should contain circle
|
|
155
|
+
const pathData = path.attributes('d');
|
|
156
|
+
expect(pathData).toMatch(/M21 12C21 16\.9706/);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
});
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import Pause from '@components/Icons/Audio/Pause.vue';
|
|
4
|
+
|
|
5
|
+
describe('Pause Icon', () => {
|
|
6
|
+
describe('Rendering', () => {
|
|
7
|
+
it('renders as SVG element', () => {
|
|
8
|
+
const wrapper = mount(Pause);
|
|
9
|
+
expect(wrapper.find('svg').exists()).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('has correct SVG attributes', () => {
|
|
13
|
+
const wrapper = mount(Pause);
|
|
14
|
+
const svg = wrapper.find('svg');
|
|
15
|
+
|
|
16
|
+
expect(svg.attributes('width')).toBe('24');
|
|
17
|
+
expect(svg.attributes('height')).toBe('24');
|
|
18
|
+
expect(svg.attributes('viewBox')).toBe('0 0 24 24');
|
|
19
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
20
|
+
expect(svg.attributes('xmlns')).toBe('http://www.w3.org/2000/svg');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('contains a group element', () => {
|
|
24
|
+
const wrapper = mount(Pause);
|
|
25
|
+
const group = wrapper.find('g');
|
|
26
|
+
expect(group.exists()).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('group has correct id attribute', () => {
|
|
30
|
+
const wrapper = mount(Pause);
|
|
31
|
+
const group = wrapper.find('g');
|
|
32
|
+
expect(group.attributes('id')).toBe('heroicons-outline/pause');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('contains exactly 1 path element', () => {
|
|
36
|
+
const wrapper = mount(Pause);
|
|
37
|
+
const paths = wrapper.findAll('path');
|
|
38
|
+
expect(paths).toHaveLength(1);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
describe('Path Structure', () => {
|
|
43
|
+
it('path represents two vertical lines (pause bars)', () => {
|
|
44
|
+
const wrapper = mount(Pause);
|
|
45
|
+
const path = wrapper.find('path');
|
|
46
|
+
|
|
47
|
+
const pathData = path.attributes('d');
|
|
48
|
+
expect(pathData).toBe('M15.75 5.25L15.75 18.75M8.25 5.25V18.75');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('path has correct id attribute', () => {
|
|
52
|
+
const wrapper = mount(Pause);
|
|
53
|
+
const path = wrapper.find('path');
|
|
54
|
+
|
|
55
|
+
expect(path.attributes('id')).toBe('Vector');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('path has correct stroke properties', () => {
|
|
59
|
+
const wrapper = mount(Pause);
|
|
60
|
+
const path = wrapper.find('path');
|
|
61
|
+
|
|
62
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
63
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
64
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('pause bars have correct positioning', () => {
|
|
68
|
+
const wrapper = mount(Pause);
|
|
69
|
+
const path = wrapper.find('path');
|
|
70
|
+
|
|
71
|
+
const pathData = path.attributes('d');
|
|
72
|
+
// Left bar at x=8.25
|
|
73
|
+
expect(pathData).toContain('M8.25 5.25');
|
|
74
|
+
expect(pathData).toContain('V18.75');
|
|
75
|
+
|
|
76
|
+
// Right bar at x=15.75
|
|
77
|
+
expect(pathData).toContain('M15.75 5.25');
|
|
78
|
+
expect(pathData).toContain('L15.75 18.75');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('pause bars span correct vertical range', () => {
|
|
82
|
+
const wrapper = mount(Pause);
|
|
83
|
+
const path = wrapper.find('path');
|
|
84
|
+
|
|
85
|
+
const pathData = path.attributes('d');
|
|
86
|
+
// Both bars should go from y=5.25 to y=18.75
|
|
87
|
+
expect(pathData).toMatch(/5\.25/g);
|
|
88
|
+
expect(pathData).toMatch(/18\.75/g);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe('Visual Properties', () => {
|
|
93
|
+
it('stroke uses the correct color', () => {
|
|
94
|
+
const wrapper = mount(Pause);
|
|
95
|
+
const path = wrapper.find('path');
|
|
96
|
+
|
|
97
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('path has no fill', () => {
|
|
101
|
+
const wrapper = mount(Pause);
|
|
102
|
+
const svg = wrapper.find('svg');
|
|
103
|
+
|
|
104
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('has rounded line caps', () => {
|
|
108
|
+
const wrapper = mount(Pause);
|
|
109
|
+
const path = wrapper.find('path');
|
|
110
|
+
|
|
111
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('has rounded line joins', () => {
|
|
115
|
+
const wrapper = mount(Pause);
|
|
116
|
+
const path = wrapper.find('path');
|
|
117
|
+
|
|
118
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('Accessibility', () => {
|
|
123
|
+
it('svg is properly structured for screen readers', () => {
|
|
124
|
+
const wrapper = mount(Pause);
|
|
125
|
+
const svg = wrapper.find('svg');
|
|
126
|
+
|
|
127
|
+
expect(svg.element.tagName.toLowerCase()).toBe('svg');
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('has descriptive group id', () => {
|
|
131
|
+
const wrapper = mount(Pause);
|
|
132
|
+
const group = wrapper.find('g');
|
|
133
|
+
|
|
134
|
+
expect(group.attributes('id')).toContain('pause');
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
describe('Component Integration', () => {
|
|
139
|
+
it('can be mounted without props', () => {
|
|
140
|
+
expect(() => {
|
|
141
|
+
mount(Pause);
|
|
142
|
+
}).not.toThrow();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('renders consistently on multiple mounts', () => {
|
|
146
|
+
const wrapper1 = mount(Pause);
|
|
147
|
+
const wrapper2 = mount(Pause);
|
|
148
|
+
|
|
149
|
+
expect(wrapper1.html()).toBe(wrapper2.html());
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('maintains correct proportions', () => {
|
|
153
|
+
const wrapper = mount(Pause);
|
|
154
|
+
const svg = wrapper.find('svg');
|
|
155
|
+
|
|
156
|
+
// Icon should be square
|
|
157
|
+
expect(svg.attributes('width')).toBe(svg.attributes('height'));
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('uses standard 24x24 icon size', () => {
|
|
161
|
+
const wrapper = mount(Pause);
|
|
162
|
+
const svg = wrapper.find('svg');
|
|
163
|
+
|
|
164
|
+
expect(svg.attributes('width')).toBe('24');
|
|
165
|
+
expect(svg.attributes('height')).toBe('24');
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
describe('Icon Semantics', () => {
|
|
170
|
+
it('represents a pause action with two vertical bars', () => {
|
|
171
|
+
const wrapper = mount(Pause);
|
|
172
|
+
const path = wrapper.find('path');
|
|
173
|
+
|
|
174
|
+
const pathData = path.attributes('d');
|
|
175
|
+
// Should contain two vertical lines
|
|
176
|
+
// Path: M15.75 5.25L15.75 18.75M8.25 5.25V18.75
|
|
177
|
+
// Commands: M (move), L (line), M (move), V (vertical line)
|
|
178
|
+
const commands = pathData.match(/[MLV]/g);
|
|
179
|
+
expect(commands).toHaveLength(4); // M, L, M, V
|
|
180
|
+
// Two bars: first M+L, second M+V
|
|
181
|
+
expect(commands).toEqual(['M', 'L', 'M', 'V']);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('pause bars are symmetrically positioned', () => {
|
|
185
|
+
const wrapper = mount(Pause);
|
|
186
|
+
const path = wrapper.find('path');
|
|
187
|
+
|
|
188
|
+
const pathData = path.attributes('d');
|
|
189
|
+
// Center is at x=12, bars should be equidistant
|
|
190
|
+
// Left bar at 8.25, right bar at 15.75
|
|
191
|
+
// Distance from center: 12 - 8.25 = 3.75, 15.75 - 12 = 3.75
|
|
192
|
+
expect(pathData).toContain('8.25');
|
|
193
|
+
expect(pathData).toContain('15.75');
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('bars have equal height', () => {
|
|
197
|
+
const wrapper = mount(Pause);
|
|
198
|
+
const path = wrapper.find('path');
|
|
199
|
+
|
|
200
|
+
const pathData = path.attributes('d');
|
|
201
|
+
// Both bars go from 5.25 to 18.75 (height = 13.5)
|
|
202
|
+
const matches5_25 = pathData.match(/5\.25/g);
|
|
203
|
+
const matches18_75 = pathData.match(/18\.75/g);
|
|
204
|
+
|
|
205
|
+
expect(matches5_25).toHaveLength(2); // Both bars start at 5.25
|
|
206
|
+
expect(matches18_75).toHaveLength(2); // Both bars end at 18.75
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { mount } from '@vue/test-utils';
|
|
3
|
+
import Play from '@components/Icons/Audio/Play.vue';
|
|
4
|
+
|
|
5
|
+
describe('Play Icon', () => {
|
|
6
|
+
describe('Rendering', () => {
|
|
7
|
+
it('renders as SVG element', () => {
|
|
8
|
+
const wrapper = mount(Play);
|
|
9
|
+
expect(wrapper.find('svg').exists()).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('has correct SVG attributes', () => {
|
|
13
|
+
const wrapper = mount(Play);
|
|
14
|
+
const svg = wrapper.find('svg');
|
|
15
|
+
|
|
16
|
+
expect(svg.attributes('width')).toBe('24');
|
|
17
|
+
expect(svg.attributes('height')).toBe('24');
|
|
18
|
+
expect(svg.attributes('viewBox')).toBe('0 0 24 24');
|
|
19
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
20
|
+
expect(svg.attributes('xmlns')).toBe('http://www.w3.org/2000/svg');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('contains exactly 1 path element', () => {
|
|
24
|
+
const wrapper = mount(Play);
|
|
25
|
+
const paths = wrapper.findAll('path');
|
|
26
|
+
expect(paths).toHaveLength(1);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
describe('Path Structure', () => {
|
|
31
|
+
it('path represents play triangle/arrow shape', () => {
|
|
32
|
+
const wrapper = mount(Play);
|
|
33
|
+
const path = wrapper.find('path');
|
|
34
|
+
|
|
35
|
+
const pathData = path.attributes('d');
|
|
36
|
+
expect(pathData).toContain('M5.25 5.65248C5.25 4.7968');
|
|
37
|
+
expect(pathData).toContain('6.91716 4.66674L18.4577');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('path has correct stroke properties', () => {
|
|
41
|
+
const wrapper = mount(Play);
|
|
42
|
+
const path = wrapper.find('path');
|
|
43
|
+
|
|
44
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
45
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
46
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('path forms complete play button shape', () => {
|
|
50
|
+
const wrapper = mount(Play);
|
|
51
|
+
const path = wrapper.find('path');
|
|
52
|
+
|
|
53
|
+
const pathData = path.attributes('d');
|
|
54
|
+
// Verify key points of the play triangle
|
|
55
|
+
expect(pathData).toContain('5.25 5.65248'); // Top left corner
|
|
56
|
+
expect(pathData).toContain('5.25 18.3471'); // Bottom left corner
|
|
57
|
+
expect(pathData).toContain('18.4577 11.0141'); // Right point (top half)
|
|
58
|
+
expect(pathData).toContain('18.4577 12.9855'); // Right point (bottom half)
|
|
59
|
+
expect(pathData).toContain('6.91716 19.3329'); // Bottom edge
|
|
60
|
+
expect(pathData).toContain('Z'); // Path closed
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('play button has proper mathematical curve', () => {
|
|
64
|
+
const wrapper = mount(Play);
|
|
65
|
+
const path = wrapper.find('path');
|
|
66
|
+
|
|
67
|
+
const pathData = path.attributes('d');
|
|
68
|
+
// Cubic bezier curves for smooth play button
|
|
69
|
+
expect(pathData).toContain('C5.25 4.7968'); // Start curve
|
|
70
|
+
expect(pathData).toContain('6.1674 4.25437'); // Control point
|
|
71
|
+
expect(pathData).toContain('6.91716 4.66674'); // End point
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('triangle points to the right', () => {
|
|
75
|
+
const wrapper = mount(Play);
|
|
76
|
+
const path = wrapper.find('path');
|
|
77
|
+
|
|
78
|
+
const pathData = path.attributes('d');
|
|
79
|
+
// Left edge at x=5.25, right point at x=18.4577
|
|
80
|
+
expect(parseFloat(pathData.match(/M([\d.]+)/)[1])).toBeLessThan(10);
|
|
81
|
+
expect(pathData).toContain('18.4577'); // Right-most point
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('Visual Properties', () => {
|
|
86
|
+
it('stroke uses the correct color', () => {
|
|
87
|
+
const wrapper = mount(Play);
|
|
88
|
+
const path = wrapper.find('path');
|
|
89
|
+
|
|
90
|
+
expect(path.attributes('stroke')).toBe('#172774');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('path has no fill', () => {
|
|
94
|
+
const wrapper = mount(Play);
|
|
95
|
+
const svg = wrapper.find('svg');
|
|
96
|
+
|
|
97
|
+
expect(svg.attributes('fill')).toBe('none');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('has rounded line caps and joins', () => {
|
|
101
|
+
const wrapper = mount(Play);
|
|
102
|
+
const path = wrapper.find('path');
|
|
103
|
+
|
|
104
|
+
expect(path.attributes('stroke-linecap')).toBe('round');
|
|
105
|
+
expect(path.attributes('stroke-linejoin')).toBe('round');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
describe('Accessibility', () => {
|
|
110
|
+
it('svg is properly structured for screen readers', () => {
|
|
111
|
+
const wrapper = mount(Play);
|
|
112
|
+
const svg = wrapper.find('svg');
|
|
113
|
+
|
|
114
|
+
expect(svg.element.tagName.toLowerCase()).toBe('svg');
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe('Component Integration', () => {
|
|
119
|
+
it('can be mounted without props', () => {
|
|
120
|
+
expect(() => {
|
|
121
|
+
mount(Play);
|
|
122
|
+
}).not.toThrow();
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('renders consistently on multiple mounts', () => {
|
|
126
|
+
const wrapper1 = mount(Play);
|
|
127
|
+
const wrapper2 = mount(Play);
|
|
128
|
+
|
|
129
|
+
expect(wrapper1.html()).toBe(wrapper2.html());
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('maintains correct proportions', () => {
|
|
133
|
+
const wrapper = mount(Play);
|
|
134
|
+
const svg = wrapper.find('svg');
|
|
135
|
+
|
|
136
|
+
// Icon should be square
|
|
137
|
+
expect(svg.attributes('width')).toBe(svg.attributes('height'));
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('uses standard 24x24 icon size', () => {
|
|
141
|
+
const wrapper = mount(Play);
|
|
142
|
+
const svg = wrapper.find('svg');
|
|
143
|
+
|
|
144
|
+
expect(svg.attributes('width')).toBe('24');
|
|
145
|
+
expect(svg.attributes('height')).toBe('24');
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe('Icon Semantics', () => {
|
|
150
|
+
it('represents a play action with triangle pointing right', () => {
|
|
151
|
+
const wrapper = mount(Play);
|
|
152
|
+
const path = wrapper.find('path');
|
|
153
|
+
|
|
154
|
+
const pathData = path.attributes('d');
|
|
155
|
+
// Triangle should point to the right
|
|
156
|
+
expect(pathData).toMatch(/M5\.25/); // Starts from left
|
|
157
|
+
expect(pathData).toMatch(/18\.\d+/); // Points to right
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('triangle is vertically centered', () => {
|
|
161
|
+
const wrapper = mount(Play);
|
|
162
|
+
const path = wrapper.find('path');
|
|
163
|
+
|
|
164
|
+
const pathData = path.attributes('d');
|
|
165
|
+
// Top at ~5.65, bottom at ~18.35
|
|
166
|
+
// Center should be around (5.65 + 18.35) / 2 = 12
|
|
167
|
+
expect(pathData).toContain('11.0141'); // Upper center point
|
|
168
|
+
expect(pathData).toContain('12.9855'); // Lower center point
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('has smooth bezier curves for professional appearance', () => {
|
|
172
|
+
const wrapper = mount(Play);
|
|
173
|
+
const path = wrapper.find('path');
|
|
174
|
+
|
|
175
|
+
const pathData = path.attributes('d');
|
|
176
|
+
// Should contain curve commands (C)
|
|
177
|
+
expect(pathData).toMatch(/C\d+\.\d+\s+\d+\.\d+/);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe('Play Button Geometry', () => {
|
|
182
|
+
it('forms an isosceles triangle shape', () => {
|
|
183
|
+
const wrapper = mount(Play);
|
|
184
|
+
const path = wrapper.find('path');
|
|
185
|
+
|
|
186
|
+
const pathData = path.attributes('d');
|
|
187
|
+
// Verify triangle vertices
|
|
188
|
+
expect(pathData).toContain('5.25 5.65248'); // Top left
|
|
189
|
+
expect(pathData).toContain('5.25 18.3471'); // Bottom left
|
|
190
|
+
expect(pathData).toContain('18.4577'); // Right point
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('has symmetric top and bottom halves', () => {
|
|
194
|
+
const wrapper = mount(Play);
|
|
195
|
+
const path = wrapper.find('path');
|
|
196
|
+
|
|
197
|
+
const pathData = path.attributes('d');
|
|
198
|
+
// Center line at y=12, symmetric offsets
|
|
199
|
+
expect(pathData).toContain('11.0141'); // ~1 unit above center
|
|
200
|
+
expect(pathData).toContain('12.9855'); // ~1 unit below center
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('maintains audio/video play button standard proportions', () => {
|
|
204
|
+
const wrapper = mount(Play);
|
|
205
|
+
const path = wrapper.find('path');
|
|
206
|
+
|
|
207
|
+
const pathData = path.attributes('d');
|
|
208
|
+
// Width ~13.2 (18.4577 - 5.25)
|
|
209
|
+
// Height ~12.7 (18.3471 - 5.65248)
|
|
210
|
+
// Roughly equilateral triangle shape
|
|
211
|
+
const widthMatch = pathData.match(/18\.4577/);
|
|
212
|
+
const leftMatch = pathData.match(/M5\.25/);
|
|
213
|
+
|
|
214
|
+
expect(widthMatch).toBeTruthy();
|
|
215
|
+
expect(leftMatch).toBeTruthy();
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
});
|