@nexxtmove/ui 2.6.0 → 2.8.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/dist/components/editor/molecules/EditorColor/EditorColor.vue.d.ts +7 -5
- package/dist/components/editor/molecules/EditorColor/_ColorField.vue.d.ts +4 -1
- package/dist/components/organisms/ColorPicker/ColorPicker.vue.d.ts +3 -1
- package/dist/index.js +95 -172
- package/dist/nuxt.js +0 -1
- package/package.json +38 -36
- package/src/attribute-contract.test.ts +151 -0
- package/src/components/atoms/AnimatedNumber/AnimatedNumber.stories.ts +36 -0
- package/src/components/atoms/AnimatedNumber/AnimatedNumber.test.ts +21 -0
- package/src/components/atoms/Avatar/Avatar.stories.ts +122 -0
- package/src/components/atoms/Avatar/Avatar.test.ts +134 -0
- package/src/components/atoms/Button/Button.stories.ts +290 -0
- package/src/components/atoms/Button/Button.test.ts +406 -0
- package/src/components/atoms/Card/Card.stories.ts +45 -0
- package/src/components/atoms/Card/Card.test.ts +46 -0
- package/src/components/atoms/Checkbox/Checkbox.stories.ts +35 -0
- package/src/components/atoms/Checkbox/Checkbox.test.ts +55 -0
- package/src/components/atoms/Chip/Chip.stories.ts +274 -0
- package/src/components/atoms/Chip/Chip.test.ts +230 -0
- package/src/components/atoms/EnergyLabel/EnergyLabel.stories.ts +189 -0
- package/src/components/atoms/EnergyLabel/EnergyLabel.test.ts +100 -0
- package/src/components/atoms/FloatingPanel/FloatingPanel.stories.ts +677 -0
- package/src/components/atoms/FloatingPanel/FloatingPanel.test.ts +864 -0
- package/src/components/atoms/Icon/Icon.stories.ts +63 -0
- package/src/components/atoms/Icon/Icon.test.ts +89 -0
- package/src/components/atoms/Loader/Loader.stories.ts +36 -0
- package/src/components/atoms/Loader/Loader.test.ts +40 -0
- package/src/components/atoms/PickerItem/PickerItem.stories.ts +172 -0
- package/src/components/atoms/PickerItem/PickerItem.test.ts +142 -0
- package/src/components/atoms/PickerPreview/PickerPreview.stories.ts +183 -0
- package/src/components/atoms/PickerPreview/PickerPreview.test.ts +137 -0
- package/src/components/atoms/PresenceIndicator/PresenceIndicator.stories.ts +21 -0
- package/src/components/atoms/PropertyListing/PropertyListing.stories.ts +38 -0
- package/src/components/atoms/PropertyListing/PropertyListing.test.ts +46 -0
- package/src/components/atoms/SelectableOption/SelectableOption.stories.ts +131 -0
- package/src/components/atoms/SelectableOption/SelectableOption.test.ts +96 -0
- package/src/components/atoms/Skeleton/Skeleton.stories.ts +27 -0
- package/src/components/atoms/Skeleton/Skeleton.test.ts +28 -0
- package/src/components/atoms/Slider/Slider.stories.ts +151 -0
- package/src/components/atoms/Slider/Slider.test.ts +191 -0
- package/src/components/atoms/Squircle/Squircle.stories.ts +114 -0
- package/src/components/atoms/Squircle/Squircle.test.ts +70 -0
- package/src/components/atoms/Switch/Switch.stories.ts +91 -0
- package/src/components/atoms/Switch/Switch.test.ts +183 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.ts +158 -0
- package/src/components/atoms/Tooltip/Tooltip.test.ts +134 -0
- package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.stories.ts +124 -0
- package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.test.ts +464 -0
- package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.stories.ts +266 -0
- package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.test.ts +421 -0
- package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.stories.ts +365 -0
- package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.test.ts +484 -0
- package/src/components/editor/composables/useRadioGrid.test.ts +261 -0
- package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.stories.ts +73 -0
- package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.test.ts +189 -0
- package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.stories.ts +309 -0
- package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.test.ts +359 -0
- package/src/components/editor/molecules/EditorAnchor/EditorAnchor.stories.ts +138 -0
- package/src/components/editor/molecules/EditorAnchor/EditorAnchor.test.ts +344 -0
- package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.stories.ts +87 -0
- package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.test.ts +262 -0
- package/src/components/editor/molecules/EditorBlur/EditorBlur.stories.ts +115 -0
- package/src/components/editor/molecules/EditorBlur/EditorBlur.test.ts +243 -0
- package/src/components/editor/molecules/EditorBorder/EditorBorder.stories.ts +187 -0
- package/src/components/editor/molecules/EditorBorder/EditorBorder.test.ts +456 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.stories.ts +633 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.test.ts +776 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.vue +7 -5
- package/src/components/editor/molecules/EditorColor/EditorColorGradient.test.ts +832 -0
- package/src/components/editor/molecules/EditorColor/_ColorField.vue +20 -15
- package/src/components/editor/molecules/EditorColor/gradientClass.test.ts +303 -0
- package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.stories.ts +72 -0
- package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.test.ts +124 -0
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.stories.ts +46 -0
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.test.ts +97 -0
- package/src/components/editor/molecules/EditorFontSize/EditorFontSize.stories.ts +248 -0
- package/src/components/editor/molecules/EditorFontSize/EditorFontSize.test.ts +288 -0
- package/src/components/editor/molecules/EditorGap/EditorGap.stories.ts +129 -0
- package/src/components/editor/molecules/EditorGap/EditorGap.test.ts +253 -0
- package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.stories.ts +68 -0
- package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.test.ts +150 -0
- package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.stories.ts +71 -0
- package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.test.ts +161 -0
- package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.stories.ts +204 -0
- package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.test.ts +238 -0
- package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.stories.ts +257 -0
- package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.test.ts +286 -0
- package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.stories.ts +135 -0
- package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.test.ts +230 -0
- package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.stories.ts +154 -0
- package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.test.ts +112 -0
- package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.stories.ts +206 -0
- package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.test.ts +332 -0
- package/src/components/editor/molecules/EditorPadding/EditorPadding.stories.ts +374 -0
- package/src/components/editor/molecules/EditorPadding/EditorPadding.test.ts +712 -0
- package/src/components/editor/molecules/EditorRadius/EditorRadius.stories.ts +64 -0
- package/src/components/editor/molecules/EditorRadius/EditorRadius.test.ts +137 -0
- package/src/components/editor/molecules/EditorShadow/EditorShadow.stories.ts +103 -0
- package/src/components/editor/molecules/EditorShadow/EditorShadow.test.ts +168 -0
- package/src/components/editor/molecules/EditorSize/EditorSize.stories.ts +84 -0
- package/src/components/editor/molecules/EditorSize/EditorSize.test.ts +253 -0
- package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.stories.ts +49 -0
- package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.test.ts +43 -0
- package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.stories.ts +69 -0
- package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.test.ts +155 -0
- package/src/components/molecules/Announcement/Announcement.stories.ts +224 -0
- package/src/components/molecules/Announcement/Announcement.test.ts +161 -0
- package/src/components/molecules/ContactInfoCard/ContactInfoCard.stories.ts +99 -0
- package/src/components/molecules/ContactInfoCard/ContactInfoCard.test.ts +70 -0
- package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.stories.ts +148 -0
- package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.test.ts +271 -0
- package/src/components/molecules/DoughnutChart/DoughnutChart.stories.ts +45 -0
- package/src/components/molecules/DoughnutChart/DoughnutChart.test.ts +205 -0
- package/src/components/molecules/InfoBlock/InfoBlock.stories.ts +84 -0
- package/src/components/molecules/InfoBlock/InfoBlock.test.ts +101 -0
- package/src/components/molecules/InputField/InputField.stories.ts +117 -0
- package/src/components/molecules/InputField/InputField.test.ts +138 -0
- package/src/components/molecules/InputSelect/InputSelect.stories.ts +116 -0
- package/src/components/molecules/InputSelect/InputSelect.test.ts +127 -0
- package/src/components/molecules/ModalFooter/ModalFooter.stories.ts +204 -0
- package/src/components/molecules/ModalFooter/ModalFooter.test.ts +276 -0
- package/src/components/molecules/PageCard/PageCard.stories.ts +100 -0
- package/src/components/molecules/PageCard/PageCard.test.ts +91 -0
- package/src/components/molecules/PageContainer/PageContainer.stories.ts +90 -0
- package/src/components/molecules/PageContainer/PageContainer.test.ts +50 -0
- package/src/components/molecules/PageMockup/PageMockup.stories.ts +38 -0
- package/src/components/molecules/PageMockup/PageMockup.test.ts +20 -0
- package/src/components/molecules/PageTypeTile/PageTypeTile.stories.ts +63 -0
- package/src/components/molecules/PageTypeTile/PageTypeTile.test.ts +41 -0
- package/src/components/molecules/Pagination/Pagination.stories.ts +72 -0
- package/src/components/molecules/Pagination/Pagination.test.ts +130 -0
- package/src/components/molecules/PickerGroup/PickerGroup.stories.ts +90 -0
- package/src/components/molecules/PickerGroup/PickerGroup.test.ts +145 -0
- package/src/components/molecules/PickerList/PickerList.stories.ts +436 -0
- package/src/components/molecules/PickerList/PickerList.test.ts +870 -0
- package/src/components/molecules/PlaceholderInput/PlaceholderInput.stories.ts +48 -0
- package/src/components/molecules/PlaceholderInput/PlaceholderInput.test.ts +107 -0
- package/src/components/molecules/PropertyCard/PropertyCard.stories.ts +46 -0
- package/src/components/molecules/PropertyCard/PropertyCard.test.ts +59 -0
- package/src/components/molecules/Select/Select.stories.ts +264 -0
- package/src/components/molecules/Select/Select.test.ts +315 -0
- package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.stories.ts +84 -0
- package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.test.ts +103 -0
- package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.stories.ts +11 -0
- package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.test.ts +38 -0
- package/src/components/molecules/SocialIcons/SocialIcons.stories.ts +28 -0
- package/src/components/molecules/SocialIcons/SocialIcons.test.ts +58 -0
- package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.stories.ts +11 -0
- package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.test.ts +116 -0
- package/src/components/molecules/SocialMediaType/SocialMediaType.stories.ts +37 -0
- package/src/components/molecules/SocialMediaType/SocialMediaType.test.ts +126 -0
- package/src/components/molecules/Source/Source.stories.ts +35 -0
- package/src/components/molecules/Source/Source.test.ts +45 -0
- package/src/components/molecules/TabbedContent/TabbedContent.stories.ts +96 -0
- package/src/components/molecules/TabbedContent/TabbedContent.test.ts +109 -0
- package/src/components/molecules/Tabs/Tabs.stories.ts +230 -0
- package/src/components/molecules/Tabs/Tabs.test.ts +280 -0
- package/src/components/molecules/TemplateCard/TemplateCard.stories.ts +327 -0
- package/src/components/molecules/TemplateCard/TemplateCard.test.ts +339 -0
- package/src/components/molecules/Textarea/Textarea.stories.ts +216 -0
- package/src/components/molecules/Textarea/Textarea.test.ts +191 -0
- package/src/components/molecules/TimelineEvent/TimelineEvent.stories.ts +319 -0
- package/src/components/molecules/TimelineEvent/TimelineEvent.test.ts +224 -0
- package/src/components/molecules/TimelineLanes/TimelineLanes.stories.ts +29 -0
- package/src/components/molecules/TimelineLanes/TimelineLanes.test.ts +30 -0
- package/src/components/molecules/Toast/Toast.stories.ts +110 -0
- package/src/components/molecules/Toast/Toast.test.ts +103 -0
- package/src/components/molecules/ToggleGroup/ToggleGroup.stories.ts +297 -0
- package/src/components/molecules/ToggleGroup/ToggleGroup.test.ts +578 -0
- package/src/components/molecules/Tree/Tree.stories.ts +884 -0
- package/src/components/molecules/Tree/Tree.test.ts +1247 -0
- package/src/components/molecules/Tree/tree-drop.test.ts +223 -0
- package/src/components/organisms/Calendar/Calendar.stories.ts +108 -0
- package/src/components/organisms/Calendar/Calendar.test.ts +279 -0
- package/src/components/organisms/Calendar/_CalendarDayView.test.ts +104 -0
- package/src/components/organisms/Calendar/_CalendarHeader.test.ts +86 -0
- package/src/components/organisms/Calendar/_CalendarMonthView.test.ts +52 -0
- package/src/components/organisms/Calendar/_CalendarTimePicker.test.ts +89 -0
- package/src/components/organisms/Calendar/_CalendarYearView.test.ts +56 -0
- package/src/components/organisms/ColorPicker/ColorPicker.stories.ts +229 -0
- package/src/components/organisms/ColorPicker/ColorPicker.test.ts +696 -0
- package/src/components/organisms/ColorPicker/ColorPicker.vue +12 -3
- package/src/components/organisms/ColorPicker/gradient.test.ts +67 -0
- package/src/components/organisms/ColorPicker/gradientGeometry.test.ts +206 -0
- package/src/components/organisms/Combobox/Combobox.stories.ts +234 -0
- package/src/components/organisms/Combobox/Combobox.test.ts +512 -0
- package/src/components/organisms/Combobox/Combobox.vue +1 -1
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.stories.ts +158 -0
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.test.ts +524 -0
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.vue +1 -1
- package/src/components/organisms/CountrySelect/CountrySelect.stories.ts +139 -0
- package/src/components/organisms/CountrySelect/CountrySelect.test.ts +149 -0
- package/src/components/organisms/DatePicker/DatePicker.stories.ts +163 -0
- package/src/components/organisms/DatePicker/DatePicker.test.ts +214 -0
- package/src/components/organisms/DropdownButton/DropdownButton.stories.ts +123 -0
- package/src/components/organisms/DropdownButton/DropdownButton.test.ts +379 -0
- package/src/components/organisms/FontPicker/FontPicker.stories.ts +476 -0
- package/src/components/organisms/FontPicker/FontPicker.test.ts +873 -0
- package/src/components/organisms/Header/Header.stories.ts +75 -0
- package/src/components/organisms/Header/Header.test.ts +233 -0
- package/src/components/organisms/IconPicker/IconPicker.stories.ts +734 -0
- package/src/components/organisms/IconPicker/IconPicker.test.ts +669 -0
- package/src/components/organisms/IconPicker/_IconPickerGrid.test.ts +184 -0
- package/src/components/organisms/IconPicker/_IconPickerRail.test.ts +102 -0
- package/src/components/organisms/IconPicker/useIconPickerNavigation.test.ts +215 -0
- package/src/components/organisms/Modal/Modal.stories.ts +350 -0
- package/src/components/organisms/Modal/Modal.test.ts +275 -0
- package/src/components/organisms/PickerPanel/PickerPanel.stories.ts +452 -0
- package/src/components/organisms/PickerPanel/PickerPanel.test.ts +358 -0
- package/src/components/organisms/ProgressBar/ProgressBar.stories.ts +100 -0
- package/src/components/organisms/ProgressBar/ProgressBar.test.ts +417 -0
- package/src/components/organisms/ReferenceCard/ReferenceCard.stories.ts +191 -0
- package/src/components/organisms/ReferenceCard/ReferenceCard.test.ts +165 -0
- package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.stories.ts +65 -0
- package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.test.ts +466 -0
- package/src/components/organisms/StepperHeader/StepperHeader.stories.ts +91 -0
- package/src/components/organisms/StepperHeader/StepperHeader.test.ts +279 -0
- package/src/components/organisms/Table/Table.stories.ts +332 -0
- package/src/components/organisms/Table/Table.test.ts +320 -0
- package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.stories.ts +198 -0
- package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.test.ts +283 -0
- package/src/components/organisms/TimelineTrack/TimelineTrack.stories.ts +120 -0
- package/src/components/organisms/TimelineTrack/TimelineTrack.test.ts +91 -0
- package/src/components/organisms/Toaster/Toaster.stories.ts +51 -0
- package/src/components/organisms/Toaster/Toaster.test.ts +75 -0
- package/src/components/organisms/VideoControls/VideoControls.stories.ts +792 -0
- package/src/components/organisms/VideoControls/VideoControls.test.ts +1056 -0
- package/src/components/organisms/VideoPlayer/VideoPlayer.stories.ts +327 -0
- package/src/components/organisms/VideoPlayer/VideoPlayer.test.ts +439 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import InfoBlock from './InfoBlock.vue'
|
|
4
|
+
|
|
5
|
+
describe('InfoBlock', () => {
|
|
6
|
+
it('renders correctly with default slot content and green color', () => {
|
|
7
|
+
const customText = 'Koopwoningen doen het goed als post of reel'
|
|
8
|
+
const wrapper = mount(InfoBlock, {
|
|
9
|
+
props: {
|
|
10
|
+
icon: 'bell',
|
|
11
|
+
color: 'green',
|
|
12
|
+
},
|
|
13
|
+
slots: {
|
|
14
|
+
default: `<div class="heading-4">Tip!</div><div class="body-medium">${customText}</div>`,
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
expect(wrapper.text()).toContain('Tip!')
|
|
19
|
+
expect(wrapper.text()).toContain(customText)
|
|
20
|
+
expect(wrapper.find('.bg-green-50').exists()).toBe(true)
|
|
21
|
+
expect(wrapper.find('.bg-green-500').exists()).toBe(true)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('renders correctly with custom color purple', () => {
|
|
25
|
+
const wrapper = mount(InfoBlock, {
|
|
26
|
+
props: {
|
|
27
|
+
icon: 'star',
|
|
28
|
+
color: 'purple',
|
|
29
|
+
},
|
|
30
|
+
slots: {
|
|
31
|
+
default: 'Custom Purple Content',
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
expect(wrapper.text()).toContain('Custom Purple Content')
|
|
36
|
+
expect(wrapper.find('.bg-sapphire-50').exists()).toBe(true)
|
|
37
|
+
expect(wrapper.find('.bg-purple-500').exists()).toBe(true)
|
|
38
|
+
expect(wrapper.find('.border-purple-500').exists()).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('renders correctly with custom color blue', () => {
|
|
42
|
+
const wrapper = mount(InfoBlock, {
|
|
43
|
+
props: {
|
|
44
|
+
icon: 'info',
|
|
45
|
+
color: 'blue',
|
|
46
|
+
},
|
|
47
|
+
slots: {
|
|
48
|
+
default: 'Custom Blue Content',
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
expect(wrapper.text()).toContain('Custom Blue Content')
|
|
53
|
+
expect(wrapper.find('.bg-yale-blue-50').exists()).toBe(true)
|
|
54
|
+
expect(wrapper.find('.bg-cornflower-blue-500').exists()).toBe(true)
|
|
55
|
+
expect(wrapper.find('.border-cornflower-blue-500').exists()).toBe(true)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('renders correctly with custom color rose', () => {
|
|
59
|
+
const wrapper = mount(InfoBlock, {
|
|
60
|
+
props: {
|
|
61
|
+
icon: 'info',
|
|
62
|
+
color: 'rose',
|
|
63
|
+
},
|
|
64
|
+
slots: {
|
|
65
|
+
default: 'Custom Rose Content',
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
expect(wrapper.text()).toContain('Custom Rose Content')
|
|
70
|
+
expect(wrapper.find('.bg-rose-50').exists()).toBe(true)
|
|
71
|
+
expect(wrapper.find('.bg-rose-500').exists()).toBe(true)
|
|
72
|
+
expect(wrapper.find('.border-rose-500').exists()).toBe(true)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
it('has correct accessibility attributes', () => {
|
|
76
|
+
const wrapper = mount(InfoBlock, {
|
|
77
|
+
props: {
|
|
78
|
+
icon: 'bell',
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
// Check for role="note"
|
|
83
|
+
expect(wrapper.attributes('role')).toBe('note')
|
|
84
|
+
|
|
85
|
+
// Check that the icon container is hidden from screen readers
|
|
86
|
+
const iconContainer = wrapper.find('[aria-hidden="true"]')
|
|
87
|
+
expect(iconContainer.exists()).toBe(true)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('renders the specific icon provided via props', () => {
|
|
91
|
+
const wrapper = mount(InfoBlock, {
|
|
92
|
+
props: {
|
|
93
|
+
icon: 'heart',
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const icon = wrapper.findComponent({ name: 'NexxtIcon' })
|
|
98
|
+
expect(icon.exists()).toBe(true)
|
|
99
|
+
expect(icon.props('name')).toBe('heart')
|
|
100
|
+
})
|
|
101
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import NexxtInputField from './InputField.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Molecules/Input field',
|
|
6
|
+
component: NexxtInputField,
|
|
7
|
+
} satisfies Meta<typeof NexxtInputField>
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof NexxtInputField>
|
|
10
|
+
|
|
11
|
+
const render = (args: Story['args']) => ({
|
|
12
|
+
components: { NexxtInputField },
|
|
13
|
+
setup() {
|
|
14
|
+
return { args }
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<NexxtInputField
|
|
18
|
+
v-bind="args"
|
|
19
|
+
:modelValue="args.modelValue"
|
|
20
|
+
@update:modelValue="args.modelValue = $event"
|
|
21
|
+
/>
|
|
22
|
+
`,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
render,
|
|
27
|
+
args: {
|
|
28
|
+
label: '',
|
|
29
|
+
placeholder: 'Placeholder...',
|
|
30
|
+
modelValue: '',
|
|
31
|
+
error: false,
|
|
32
|
+
errorMessage: '',
|
|
33
|
+
leftIcon: 'search',
|
|
34
|
+
required: false,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const WithLabel: Story = {
|
|
39
|
+
render,
|
|
40
|
+
args: {
|
|
41
|
+
...Default.args,
|
|
42
|
+
label: 'Email address',
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Focused: Story = {
|
|
47
|
+
render,
|
|
48
|
+
args: {
|
|
49
|
+
...Default.args,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const Error: Story = {
|
|
54
|
+
render,
|
|
55
|
+
args: {
|
|
56
|
+
...Default.args,
|
|
57
|
+
error: true,
|
|
58
|
+
errorMessage: 'Dit veld is verplicht',
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const WithValue: Story = {
|
|
63
|
+
render,
|
|
64
|
+
args: {
|
|
65
|
+
...Default.args,
|
|
66
|
+
modelValue: 'Voorbeeld tekst',
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const WithRightIcon: Story = {
|
|
71
|
+
render,
|
|
72
|
+
args: {
|
|
73
|
+
...Default.args,
|
|
74
|
+
rightIcon: 'filter',
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const WithoutIcons: Story = {
|
|
79
|
+
render,
|
|
80
|
+
args: {
|
|
81
|
+
...Default.args,
|
|
82
|
+
leftIcon: undefined,
|
|
83
|
+
rightIcon: undefined,
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const Required: Story = {
|
|
88
|
+
render,
|
|
89
|
+
args: {
|
|
90
|
+
...Default.args,
|
|
91
|
+
label: 'Required field',
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const Number: Story = {
|
|
97
|
+
render: (args) => ({
|
|
98
|
+
components: { NexxtInputField },
|
|
99
|
+
setup() {
|
|
100
|
+
return { args }
|
|
101
|
+
},
|
|
102
|
+
template: `
|
|
103
|
+
<NexxtInputField
|
|
104
|
+
v-bind="args"
|
|
105
|
+
type="number"
|
|
106
|
+
v-model="args.modelValue"
|
|
107
|
+
/>
|
|
108
|
+
`,
|
|
109
|
+
}),
|
|
110
|
+
args: {
|
|
111
|
+
...Default.args,
|
|
112
|
+
label: 'Number input',
|
|
113
|
+
placeholder: '0',
|
|
114
|
+
modelValue: 10,
|
|
115
|
+
leftIcon: undefined,
|
|
116
|
+
},
|
|
117
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import NexxtInputField from './InputField.vue'
|
|
4
|
+
|
|
5
|
+
describe('NexxtInputField', () => {
|
|
6
|
+
// Not about the (non-existent) module-scope id bug: this asserts the label
|
|
7
|
+
// association contract itself, which nothing else covers.
|
|
8
|
+
it('points the label at the input it labels', () => {
|
|
9
|
+
const wrapper = mount(NexxtInputField, { props: { label: 'A' } })
|
|
10
|
+
expect(wrapper.find('label').attributes('for')).toBe(wrapper.find('input').attributes('id'))
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
describe('exposed focus API', () => {
|
|
14
|
+
it('exposes the input element and a focus method', () => {
|
|
15
|
+
const wrapper = mount(NexxtInputField, { attachTo: document.body })
|
|
16
|
+
const exposed = wrapper.vm as unknown as {
|
|
17
|
+
focus?: () => void
|
|
18
|
+
inputEl?: HTMLInputElement | null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
expect(typeof exposed.focus).toBe('function')
|
|
22
|
+
expect(exposed.inputEl).toBe(wrapper.find('input').element)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('actually focuses the input, so callers stop reaching for querySelector', () => {
|
|
26
|
+
const wrapper = mount(NexxtInputField, { attachTo: document.body })
|
|
27
|
+
const exposed = wrapper.vm as unknown as { focus: () => void }
|
|
28
|
+
|
|
29
|
+
exposed.focus()
|
|
30
|
+
|
|
31
|
+
expect(document.activeElement).toBe(wrapper.find('input').element)
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('renders label and placeholder', () => {
|
|
36
|
+
const wrapper = mount(NexxtInputField, {
|
|
37
|
+
props: {
|
|
38
|
+
label: 'Test Label',
|
|
39
|
+
placeholder: 'Test Placeholder',
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
expect(wrapper.text()).toContain('Test Label')
|
|
43
|
+
expect(wrapper.find('input').attributes('placeholder')).toBe('Test Placeholder')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('emits update:modelValue on input', async () => {
|
|
47
|
+
const wrapper = mount(NexxtInputField, {
|
|
48
|
+
props: { modelValue: '' },
|
|
49
|
+
})
|
|
50
|
+
const input = wrapper.find('input')
|
|
51
|
+
await input.setValue('Hello')
|
|
52
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['Hello'])
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('shows error message and error class', () => {
|
|
56
|
+
const wrapper = mount(NexxtInputField, {
|
|
57
|
+
props: {
|
|
58
|
+
error: true,
|
|
59
|
+
errorMessage: 'Error occurred',
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
expect(wrapper.text()).toContain('Error occurred')
|
|
63
|
+
expect(wrapper.find('.ring-brick-400').exists()).toBe(true)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('shows left and right icons if props are set', () => {
|
|
67
|
+
const wrapper = mount(NexxtInputField, {
|
|
68
|
+
props: {
|
|
69
|
+
leftIcon: 'search',
|
|
70
|
+
rightIcon: 'eye',
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
const icons = wrapper.findAllComponents({ name: 'NexxtIcon' })
|
|
74
|
+
expect(icons.length).toBeGreaterThanOrEqual(2)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('focus and blur events do not throw', async () => {
|
|
78
|
+
const wrapper = mount(NexxtInputField)
|
|
79
|
+
const input = wrapper.find('input')
|
|
80
|
+
await input.trigger('focus')
|
|
81
|
+
await input.trigger('blur')
|
|
82
|
+
expect(input.exists()).toBe(true)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('renders required asterisk when required prop is true', () => {
|
|
86
|
+
const wrapper = mount(NexxtInputField, {
|
|
87
|
+
props: {
|
|
88
|
+
label: 'Required Label',
|
|
89
|
+
required: true,
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
const asterisk = wrapper.find('.text-brick-500')
|
|
93
|
+
expect(asterisk.exists()).toBe(true)
|
|
94
|
+
expect(asterisk.text()).toBe('*')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('renders numeric arrows and updates value when type is number', async () => {
|
|
98
|
+
const wrapper = mount(NexxtInputField, {
|
|
99
|
+
props: {
|
|
100
|
+
type: 'number',
|
|
101
|
+
modelValue: 10,
|
|
102
|
+
},
|
|
103
|
+
attrs: {
|
|
104
|
+
type: 'number',
|
|
105
|
+
},
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
const buttons = wrapper.findAll('button')
|
|
109
|
+
expect(buttons).toHaveLength(2)
|
|
110
|
+
|
|
111
|
+
// Increment
|
|
112
|
+
await buttons[0].trigger('click')
|
|
113
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([11])
|
|
114
|
+
|
|
115
|
+
// Update prop to simulate modelValue change from parent/v-model
|
|
116
|
+
await wrapper.setProps({ modelValue: 11 })
|
|
117
|
+
|
|
118
|
+
// Decrement
|
|
119
|
+
await buttons[1].trigger('click')
|
|
120
|
+
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([10])
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
it('handles null/empty modelValue when incrementing', async () => {
|
|
124
|
+
const wrapper = mount(NexxtInputField, {
|
|
125
|
+
props: {
|
|
126
|
+
type: 'number',
|
|
127
|
+
modelValue: undefined,
|
|
128
|
+
},
|
|
129
|
+
attrs: {
|
|
130
|
+
type: 'number',
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
const buttons = wrapper.findAll('button')
|
|
135
|
+
await buttons[0].trigger('click')
|
|
136
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([1])
|
|
137
|
+
})
|
|
138
|
+
})
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import NexxtInputSelect from './InputSelect.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Molecules/Input Select',
|
|
6
|
+
component: NexxtInputSelect,
|
|
7
|
+
decorators: [
|
|
8
|
+
() => ({
|
|
9
|
+
template:
|
|
10
|
+
'<div style="min-height: 250px; padding: 16px; display: flex; justify-content: center;"><story /></div>',
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
} satisfies Meta<typeof NexxtInputSelect>
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof NexxtInputSelect>
|
|
16
|
+
|
|
17
|
+
const unitOptions = [
|
|
18
|
+
{ label: 'km', value: 'km' },
|
|
19
|
+
{ label: 'mi', value: 'mi' },
|
|
20
|
+
{ label: 'm', value: 'm' },
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
const currencyOptions = [
|
|
24
|
+
{ label: 'EUR', value: 'eur' },
|
|
25
|
+
{ label: 'USD', value: 'usd' },
|
|
26
|
+
{ label: 'GBP', value: 'gbp' },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
const render = (args: Story['args']) => ({
|
|
30
|
+
components: { NexxtInputSelect },
|
|
31
|
+
setup() {
|
|
32
|
+
return { args }
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<div style="display: flex; flex-direction: column; gap: 16px; align-items: flex-start;">
|
|
36
|
+
<NexxtInputSelect
|
|
37
|
+
v-bind="args"
|
|
38
|
+
:input="args.input"
|
|
39
|
+
:select="args.select"
|
|
40
|
+
@update:input="args.input = $event"
|
|
41
|
+
@update:select="args.select = $event"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
render,
|
|
49
|
+
args: {
|
|
50
|
+
options: unitOptions,
|
|
51
|
+
placeholder: '0',
|
|
52
|
+
selectPlaceholder: 'Eenheid',
|
|
53
|
+
input: '',
|
|
54
|
+
select: null,
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const WithLabel: Story = {
|
|
59
|
+
render,
|
|
60
|
+
args: {
|
|
61
|
+
...Default.args,
|
|
62
|
+
label: 'Afstand',
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const WithValue: Story = {
|
|
68
|
+
render,
|
|
69
|
+
args: {
|
|
70
|
+
...Default.args,
|
|
71
|
+
label: 'Afstand',
|
|
72
|
+
input: '42',
|
|
73
|
+
select: 'km',
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const WithLeftIcon: Story = {
|
|
78
|
+
render,
|
|
79
|
+
args: {
|
|
80
|
+
...Default.args,
|
|
81
|
+
label: 'Bedrag',
|
|
82
|
+
options: currencyOptions,
|
|
83
|
+
selectPlaceholder: 'Valuta',
|
|
84
|
+
leftIcon: 'dollar-sign',
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Required: Story = {
|
|
89
|
+
render,
|
|
90
|
+
args: {
|
|
91
|
+
...Default.args,
|
|
92
|
+
label: 'Verplicht veld',
|
|
93
|
+
required: true,
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const SelectBefore: Story = {
|
|
98
|
+
render,
|
|
99
|
+
args: {
|
|
100
|
+
...Default.args,
|
|
101
|
+
label: 'Afstand',
|
|
102
|
+
input: '42',
|
|
103
|
+
select: 'km',
|
|
104
|
+
selectPosition: 'before',
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const Error: Story = {
|
|
109
|
+
render,
|
|
110
|
+
args: {
|
|
111
|
+
...Default.args,
|
|
112
|
+
label: 'Afstand',
|
|
113
|
+
error: true,
|
|
114
|
+
errorMessage: 'Dit veld is verplicht',
|
|
115
|
+
},
|
|
116
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest'
|
|
2
|
+
import { mount, flushPromises } from '@vue/test-utils'
|
|
3
|
+
import { ref, nextTick } from 'vue'
|
|
4
|
+
import NexxtInputSelect from './InputSelect.vue'
|
|
5
|
+
|
|
6
|
+
vi.mock('@floating-ui/vue', async (importOriginal) => {
|
|
7
|
+
const actual = await importOriginal<typeof import('@floating-ui/vue')>()
|
|
8
|
+
return {
|
|
9
|
+
...actual,
|
|
10
|
+
useFloating: () => ({
|
|
11
|
+
floatingStyles: ref({}),
|
|
12
|
+
placement: ref('bottom-end'),
|
|
13
|
+
isPositioned: ref(true),
|
|
14
|
+
}),
|
|
15
|
+
autoUpdate: () => () => {},
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const unitOptions = [
|
|
20
|
+
{ label: 'km', value: 'km' },
|
|
21
|
+
{ label: 'mi', value: 'mi' },
|
|
22
|
+
{ label: 'm', value: 'm' },
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
const openSelect = async (wrapper: ReturnType<typeof mount>) => {
|
|
26
|
+
await wrapper.find('[role="combobox"]').trigger('click')
|
|
27
|
+
await flushPromises()
|
|
28
|
+
await nextTick()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('NexxtInputSelect', () => {
|
|
32
|
+
it('renders label and placeholder', () => {
|
|
33
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
34
|
+
props: { options: unitOptions, label: 'Afstand', placeholder: '0' },
|
|
35
|
+
})
|
|
36
|
+
expect(wrapper.text()).toContain('Afstand')
|
|
37
|
+
expect(wrapper.find('input').attributes('placeholder')).toBe('0')
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('renders select placeholder', () => {
|
|
41
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
42
|
+
props: { options: unitOptions, selectPlaceholder: 'Eenheid' },
|
|
43
|
+
})
|
|
44
|
+
expect(wrapper.text()).toContain('Eenheid')
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('emits update:input when the input value changes', async () => {
|
|
48
|
+
const wrapper = mount(NexxtInputSelect, { props: { options: unitOptions, input: '' } })
|
|
49
|
+
await wrapper.find('input').setValue('42')
|
|
50
|
+
expect(wrapper.emitted()['update:input'][0]).toEqual(['42'])
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('opens dropdown and shows options on click', async () => {
|
|
54
|
+
const wrapper = mount(NexxtInputSelect, { props: { options: unitOptions } })
|
|
55
|
+
await openSelect(wrapper)
|
|
56
|
+
const items = wrapper.findAll('[role="option"]')
|
|
57
|
+
expect(items).toHaveLength(unitOptions.length)
|
|
58
|
+
expect(items[0].text()).toBe('km')
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('emits update:select when an option is selected', async () => {
|
|
62
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
63
|
+
props: { options: unitOptions, select: null },
|
|
64
|
+
})
|
|
65
|
+
await openSelect(wrapper)
|
|
66
|
+
await wrapper.find('[role="option"]').trigger('click')
|
|
67
|
+
expect(wrapper.emitted()['update:select'][0]).toEqual(['km'])
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('displays the selected label when a select value is set', () => {
|
|
71
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
72
|
+
props: { options: unitOptions, select: 'mi' },
|
|
73
|
+
})
|
|
74
|
+
expect(wrapper.text()).toContain('mi')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('marks the selected option with aria-selected', async () => {
|
|
78
|
+
const wrapper = mount(NexxtInputSelect, { props: { options: unitOptions, select: 'km' } })
|
|
79
|
+
await openSelect(wrapper)
|
|
80
|
+
const selected = wrapper.find('[aria-selected="true"]')
|
|
81
|
+
expect(selected.text()).toBe('km')
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('shows error ring and error message', () => {
|
|
85
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
86
|
+
props: { options: unitOptions, error: true, errorMessage: 'Dit veld is verplicht' },
|
|
87
|
+
})
|
|
88
|
+
expect(wrapper.find('.ring-brick-400').exists()).toBe(true)
|
|
89
|
+
expect(wrapper.text()).toContain('Dit veld is verplicht')
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
it('renders required asterisk when required is true', () => {
|
|
93
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
94
|
+
props: { options: unitOptions, label: 'Afstand', required: true },
|
|
95
|
+
})
|
|
96
|
+
const asterisk = wrapper.find('.text-brick-500')
|
|
97
|
+
expect(asterisk.exists()).toBe(true)
|
|
98
|
+
expect(asterisk.text()).toBe('*')
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it('places select after input by default (flex-row-reverse)', () => {
|
|
102
|
+
const wrapper = mount(NexxtInputSelect, { props: { options: unitOptions } })
|
|
103
|
+
expect(wrapper.find('.flex-row-reverse').exists()).toBe(true)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it('places select before input when selectPosition is before (flex-row)', () => {
|
|
107
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
108
|
+
props: { options: unitOptions, selectPosition: 'before' },
|
|
109
|
+
})
|
|
110
|
+
expect(wrapper.find('.flex-row').exists()).toBe(true)
|
|
111
|
+
expect(wrapper.find('.flex-row-reverse').exists()).toBe(false)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
it('select trigger has border-l when selectPosition is after', () => {
|
|
115
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
116
|
+
props: { options: unitOptions, selectPosition: 'after' },
|
|
117
|
+
})
|
|
118
|
+
expect(wrapper.find('[role="combobox"]').classes()).toContain('border-l')
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('select trigger has border-r when selectPosition is before', () => {
|
|
122
|
+
const wrapper = mount(NexxtInputSelect, {
|
|
123
|
+
props: { options: unitOptions, selectPosition: 'before' },
|
|
124
|
+
})
|
|
125
|
+
expect(wrapper.find('[role="combobox"]').classes()).toContain('border-r')
|
|
126
|
+
})
|
|
127
|
+
})
|