@getmicdrop/svelte-components 5.5.4 → 5.5.5
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/calendar/AboutShow/AboutShow.spec.d.ts +2 -0
- package/dist/calendar/AboutShow/AboutShow.spec.d.ts.map +1 -0
- package/dist/calendar/AboutShow/AboutShow.spec.js +791 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.d.ts +2 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.d.ts.map +1 -0
- package/dist/calendar/Calendar/MiniMonthCalendar.spec.js +1191 -0
- package/dist/calendar/FAQs/FAQs.spec.d.ts +2 -0
- package/dist/calendar/FAQs/FAQs.spec.d.ts.map +1 -0
- package/dist/calendar/FAQs/FAQs.spec.js +238 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.d.ts +2 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.d.ts.map +1 -0
- package/dist/calendar/MonthSwitcher/MonthSwitcher.spec.js +420 -0
- package/dist/calendar/OrderSummary/OrderSummary.spec.d.ts +2 -0
- package/dist/calendar/OrderSummary/OrderSummary.spec.d.ts.map +1 -0
- package/dist/calendar/OrderSummary/OrderSummary.spec.js +808 -0
- package/dist/calendar/PublicCard/PublicCard.spec.d.ts +2 -0
- package/dist/calendar/PublicCard/PublicCard.spec.d.ts.map +1 -0
- package/dist/calendar/PublicCard/PublicCard.spec.js +301 -0
- package/dist/calendar/ShowCard/ShowCard.spec.d.ts +2 -0
- package/dist/calendar/ShowCard/ShowCard.spec.d.ts.map +1 -0
- package/dist/calendar/ShowCard/ShowCard.spec.js +714 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.d.ts +2 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.d.ts.map +1 -0
- package/dist/calendar/ShowTimeCard/ShowTimeCard.spec.js +241 -0
- package/dist/components/Layout/Section.spec.d.ts +2 -0
- package/dist/components/Layout/Section.spec.d.ts.map +1 -0
- package/dist/components/Layout/Section.spec.js +149 -0
- package/dist/components/Layout/Sidebar.spec.d.ts +2 -0
- package/dist/components/Layout/Sidebar.spec.d.ts.map +1 -0
- package/dist/components/Layout/Sidebar.spec.js +186 -0
- package/dist/components/Layout/Stack.spec.js +3 -3
- package/dist/constants/formOptions.spec.js +9 -5
- package/dist/datetime/__tests__/format.test.js +1 -1
- package/dist/datetime/__tests__/parse.test.js +1 -1
- package/dist/datetime/__tests__/timezone.test.js +124 -2
- package/dist/datetime/parse.js +1 -1
- package/dist/forms/createFieldTracker.spec.d.ts +2 -0
- package/dist/forms/createFieldTracker.spec.d.ts.map +1 -0
- package/dist/forms/createFieldTracker.spec.js +343 -0
- package/dist/forms/createFormStore.spec.d.ts +2 -0
- package/dist/forms/createFormStore.spec.d.ts.map +1 -0
- package/dist/forms/createFormStore.spec.js +689 -0
- package/dist/forms/createFormStore.svelte.js +0 -1
- package/dist/index.d.ts +4 -112
- package/dist/index.js +4 -190
- package/dist/patterns/data/DataGrid.spec.d.ts +2 -0
- package/dist/patterns/data/DataGrid.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataGrid.spec.js +159 -0
- package/dist/patterns/data/DataList.spec.d.ts +2 -0
- package/dist/patterns/data/DataList.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataList.spec.js +158 -0
- package/dist/patterns/data/DataTable.spec.d.ts +2 -0
- package/dist/patterns/data/DataTable.spec.d.ts.map +1 -0
- package/dist/patterns/data/DataTable.spec.js +196 -0
- package/dist/patterns/forms/FormActions.spec.js +10 -3
- package/dist/patterns/forms/FormGrid.spec.d.ts +2 -0
- package/dist/patterns/forms/FormGrid.spec.d.ts.map +1 -0
- package/dist/patterns/forms/FormGrid.spec.js +125 -0
- package/dist/patterns/forms/FormSection.spec.d.ts +2 -0
- package/dist/patterns/forms/FormSection.spec.d.ts.map +1 -0
- package/dist/patterns/forms/FormSection.spec.js +153 -0
- package/dist/patterns/layout/Sidebar.spec.d.ts +2 -0
- package/dist/patterns/layout/Sidebar.spec.d.ts.map +1 -0
- package/dist/patterns/layout/Sidebar.spec.js +159 -0
- package/dist/patterns/navigation/BottomNav.svelte +4 -4
- package/dist/patterns/navigation/Header.spec.js +33 -24
- package/dist/patterns/page/PageHeader.spec.d.ts +2 -0
- package/dist/patterns/page/PageHeader.spec.d.ts.map +1 -0
- package/dist/patterns/page/PageHeader.spec.js +167 -0
- package/dist/patterns/page/PageLayout.spec.d.ts +2 -0
- package/dist/patterns/page/PageLayout.spec.d.ts.map +1 -0
- package/dist/patterns/page/PageLayout.spec.js +145 -0
- package/dist/patterns/page/PageLoader.spec.js +5 -2
- package/dist/patterns/page/SectionHeader.spec.d.ts +2 -0
- package/dist/patterns/page/SectionHeader.spec.d.ts.map +1 -0
- package/dist/patterns/page/SectionHeader.spec.js +197 -0
- package/dist/presets/badges.spec.d.ts +2 -0
- package/dist/presets/badges.spec.d.ts.map +1 -0
- package/dist/presets/badges.spec.js +172 -0
- package/dist/presets/buttons.spec.d.ts +2 -0
- package/dist/presets/buttons.spec.d.ts.map +1 -0
- package/dist/presets/buttons.spec.js +135 -0
- package/dist/primitives/Accordion/Accordion.spec.d.ts +2 -0
- package/dist/primitives/Accordion/Accordion.spec.d.ts.map +1 -0
- package/dist/primitives/Accordion/Accordion.spec.js +83 -0
- package/dist/primitives/Accordion/AccordionItem.spec.d.ts +2 -0
- package/dist/primitives/Accordion/AccordionItem.spec.d.ts.map +1 -0
- package/dist/primitives/Accordion/AccordionItem.spec.js +661 -0
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte +107 -0
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts +35 -0
- package/dist/primitives/Accordion/AccordionItemWrapper.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Alert/Alert.spec.js +5 -2
- package/dist/primitives/Avatar/Avatar.spec.d.ts +2 -0
- package/dist/primitives/Avatar/Avatar.spec.d.ts.map +1 -0
- package/dist/primitives/Avatar/Avatar.spec.js +211 -0
- package/dist/primitives/Badges/Badge.spec.js +109 -68
- package/dist/primitives/BottomSheet/BottomSheet.spec.js +36 -27
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte +13 -0
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte.d.ts +7 -0
- package/dist/primitives/BottomSheet/BottomSheetWrapper.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Breadcrumb/Breadcrumb.spec.js +15 -13
- package/dist/primitives/Breadcrumb/Breadcrumb.svelte +5 -5
- package/dist/primitives/Button/Button.spec.js +83 -71
- package/dist/primitives/Button/ButtonSaveDemo.spec.js +100 -2
- package/dist/primitives/Button/ButtonVariantShowcase.spec.d.ts +2 -0
- package/dist/primitives/Button/ButtonVariantShowcase.spec.d.ts.map +1 -0
- package/dist/primitives/Button/ButtonVariantShowcase.spec.js +202 -0
- package/dist/primitives/Card.spec.js +1 -1
- package/dist/primitives/Checkbox/Checkbox.spec.d.ts +2 -0
- package/dist/primitives/Checkbox/Checkbox.spec.d.ts.map +1 -0
- package/dist/primitives/Checkbox/Checkbox.spec.js +252 -0
- package/dist/primitives/DarkModeToggle.spec.js +84 -51
- package/dist/primitives/Drawer/Drawer.spec.d.ts +2 -0
- package/dist/primitives/Drawer/Drawer.spec.d.ts.map +1 -0
- package/dist/primitives/Drawer/Drawer.spec.js +212 -0
- package/dist/primitives/Dropdown/Dropdown.spec.d.ts +2 -0
- package/dist/primitives/Dropdown/Dropdown.spec.d.ts.map +1 -0
- package/dist/primitives/Dropdown/Dropdown.spec.js +366 -0
- package/dist/primitives/Dropdown/DropdownItem.spec.d.ts +2 -0
- package/dist/primitives/Dropdown/DropdownItem.spec.d.ts.map +1 -0
- package/dist/primitives/Dropdown/DropdownItem.spec.js +182 -0
- package/dist/primitives/Icons/iconTestUtils.spec.d.ts +2 -0
- package/dist/primitives/Icons/iconTestUtils.spec.d.ts.map +1 -0
- package/dist/primitives/Icons/iconTestUtils.spec.js +235 -0
- package/dist/primitives/Input/Input.spec.js +14 -14
- package/dist/primitives/Input/Input.svelte +1 -14
- package/dist/primitives/Input/Input.svelte.d.ts.map +1 -1
- package/dist/primitives/Input/Select.spec.js +11 -17
- package/dist/primitives/Input/Textarea.spec.d.ts +2 -0
- package/dist/primitives/Input/Textarea.spec.d.ts.map +1 -0
- package/dist/primitives/Input/Textarea.spec.js +255 -0
- package/dist/primitives/Label/Label.spec.d.ts +2 -0
- package/dist/primitives/Label/Label.spec.d.ts.map +1 -0
- package/dist/primitives/Label/Label.spec.js +157 -0
- package/dist/primitives/Modal/Modal.spec.js +29 -25
- package/dist/primitives/Modal/ModalTestWrapper.svelte +65 -0
- package/dist/primitives/Modal/ModalTestWrapper.svelte.d.ts +23 -0
- package/dist/primitives/Modal/ModalTestWrapper.svelte.d.ts.map +1 -0
- package/dist/primitives/NumberInput/NumberInput.spec.d.ts +2 -0
- package/dist/primitives/NumberInput/NumberInput.spec.d.ts.map +1 -0
- package/dist/primitives/NumberInput/NumberInput.spec.js +235 -0
- package/dist/primitives/Pagination/Pagination.spec.d.ts +2 -0
- package/dist/primitives/Pagination/Pagination.spec.d.ts.map +1 -0
- package/dist/primitives/Pagination/Pagination.spec.js +266 -0
- package/dist/primitives/Radio/Radio.spec.d.ts +2 -0
- package/dist/primitives/Radio/Radio.spec.d.ts.map +1 -0
- package/dist/primitives/Radio/Radio.spec.js +206 -0
- package/dist/primitives/Skeleton/CardPlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/CardPlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/CardPlaceholder.spec.js +156 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/ImagePlaceholder.spec.js +120 -0
- package/dist/primitives/Skeleton/ListPlaceholder.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/ListPlaceholder.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/ListPlaceholder.spec.js +220 -0
- package/dist/primitives/Skeleton/Skeleton.spec.d.ts +2 -0
- package/dist/primitives/Skeleton/Skeleton.spec.d.ts.map +1 -0
- package/dist/primitives/Skeleton/Skeleton.spec.js +173 -0
- package/dist/primitives/Spinner/Spinner.spec.js +25 -29
- package/dist/primitives/Tabs/TabItem.spec.d.ts +2 -0
- package/dist/primitives/Tabs/TabItem.spec.d.ts.map +1 -0
- package/dist/primitives/Tabs/TabItem.spec.js +130 -0
- package/dist/primitives/Tabs/Tabs.spec.d.ts +2 -0
- package/dist/primitives/Tabs/Tabs.spec.d.ts.map +1 -0
- package/dist/primitives/Tabs/Tabs.spec.js +295 -0
- package/dist/primitives/Tabs/TabsWithItems.test.svelte +18 -0
- package/dist/primitives/Tabs/TabsWithItems.test.svelte.d.ts +16 -0
- package/dist/primitives/Tabs/TabsWithItems.test.svelte.d.ts.map +1 -0
- package/dist/primitives/Toggle.spec.js +93 -77
- package/dist/primitives/Typography/Typography.spec.d.ts +2 -0
- package/dist/primitives/Typography/Typography.spec.d.ts.map +1 -0
- package/dist/primitives/Typography/Typography.spec.js +183 -0
- package/dist/primitives/ValidationError.spec.js +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +3 -0
- package/dist/recipes/CropImage/CropImage.spec.js +1 -9
- package/dist/recipes/ImageUploader/ImageUploader.spec.d.ts +2 -0
- package/dist/recipes/ImageUploader/ImageUploader.spec.d.ts.map +1 -0
- package/dist/recipes/ImageUploader/ImageUploader.spec.js +1351 -0
- package/dist/recipes/SuperLogin/SuperLogin.spec.d.ts +2 -0
- package/dist/recipes/SuperLogin/SuperLogin.spec.d.ts.map +1 -0
- package/dist/recipes/SuperLogin/SuperLogin.spec.js +1436 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.d.ts +2 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.d.ts.map +1 -0
- package/dist/recipes/feedback/EmptyState/EmptyState.spec.js +202 -0
- package/dist/recipes/feedback/ErrorDisplay.spec.js +6 -6
- package/dist/recipes/feedback/StatusIndicator/StatusIndicator.spec.js +21 -17
- package/dist/recipes/fields/CheckboxField.spec.d.ts +2 -0
- package/dist/recipes/fields/CheckboxField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/CheckboxField.spec.js +135 -0
- package/dist/recipes/fields/FormField.spec.d.ts +2 -0
- package/dist/recipes/fields/FormField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/FormField.spec.js +159 -0
- package/dist/recipes/fields/RadioGroup.spec.d.ts +2 -0
- package/dist/recipes/fields/RadioGroup.spec.d.ts.map +1 -0
- package/dist/recipes/fields/RadioGroup.spec.js +199 -0
- package/dist/recipes/fields/SelectField.spec.d.ts +2 -0
- package/dist/recipes/fields/SelectField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/SelectField.spec.js +188 -0
- package/dist/recipes/fields/TextareaField.spec.d.ts +2 -0
- package/dist/recipes/fields/TextareaField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/TextareaField.spec.js +205 -0
- package/dist/recipes/fields/ToggleField.spec.d.ts +2 -0
- package/dist/recipes/fields/ToggleField.spec.d.ts.map +1 -0
- package/dist/recipes/fields/ToggleField.spec.js +153 -0
- package/dist/recipes/inputs/MultiSelect.spec.js +4 -3
- package/dist/recipes/inputs/MultiSelect.svelte +10 -3
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts +2 -0
- package/dist/recipes/inputs/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/recipes/inputs/OTPInput.spec.js +52 -39
- package/dist/recipes/inputs/PasswordInput.spec.d.ts +2 -0
- package/dist/recipes/inputs/PasswordInput.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/PasswordInput.spec.js +410 -0
- package/dist/recipes/inputs/PasswordStrengthIndicator/PasswordStrengthIndicator.spec.js +253 -173
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte +71 -0
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte.d.ts +9 -0
- package/dist/recipes/inputs/PasswordStrengthIndicator/TestWrapper.svelte.d.ts.map +1 -0
- package/dist/recipes/inputs/PlaceAutocomplete/PlaceAutocomplete.spec.js +1246 -300
- package/dist/recipes/inputs/Search.spec.d.ts +2 -0
- package/dist/recipes/inputs/Search.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/Search.spec.js +177 -0
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts +2 -0
- package/dist/recipes/inputs/SelectDropdown.spec.d.ts.map +1 -0
- package/dist/recipes/inputs/SelectDropdown.spec.js +512 -0
- package/dist/recipes/modals/AlertModal.spec.d.ts +2 -0
- package/dist/recipes/modals/AlertModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/AlertModal.spec.js +432 -0
- package/dist/recipes/modals/ConfirmationModal.spec.js +36 -21
- package/dist/recipes/modals/InputModal.spec.d.ts +2 -0
- package/dist/recipes/modals/InputModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/InputModal.spec.js +872 -0
- package/dist/recipes/modals/ModalTestWrapper.spec.d.ts +2 -0
- package/dist/recipes/modals/ModalTestWrapper.spec.d.ts.map +1 -0
- package/dist/recipes/modals/ModalTestWrapper.spec.js +502 -0
- package/dist/recipes/modals/StatusModal.spec.d.ts +2 -0
- package/dist/recipes/modals/StatusModal.spec.d.ts.map +1 -0
- package/dist/recipes/modals/StatusModal.spec.js +599 -0
- package/dist/services/ShowService.spec.js +18 -15
- package/dist/stories/ButtonAuditDashboard.spec.d.ts +2 -0
- package/dist/stories/ButtonAuditDashboard.spec.d.ts.map +1 -0
- package/dist/stories/ButtonAuditDashboard.spec.js +913 -0
- package/dist/stories/ButtonAuditReview.spec.d.ts +2 -0
- package/dist/stories/ButtonAuditReview.spec.d.ts.map +1 -0
- package/dist/stories/ButtonAuditReview.spec.js +422 -0
- package/dist/stories/ButtonGridView.spec.d.ts +2 -0
- package/dist/stories/ButtonGridView.spec.d.ts.map +1 -0
- package/dist/stories/ButtonGridView.spec.js +667 -0
- package/dist/stories/ButtonShowcase.spec.d.ts +2 -0
- package/dist/stories/ButtonShowcase.spec.d.ts.map +1 -0
- package/dist/stories/ButtonShowcase.spec.js +499 -0
- package/dist/stories/PatternsGallery.spec.d.ts +2 -0
- package/dist/stories/PatternsGallery.spec.d.ts.map +1 -0
- package/dist/stories/PatternsGallery.spec.js +514 -0
- package/dist/stories/PrimitivesGallery.spec.d.ts +2 -0
- package/dist/stories/PrimitivesGallery.spec.d.ts.map +1 -0
- package/dist/stories/PrimitivesGallery.spec.js +813 -0
- package/dist/stories/RecipesGallery.spec.d.ts +2 -0
- package/dist/stories/RecipesGallery.spec.d.ts.map +1 -0
- package/dist/stories/RecipesGallery.spec.js +299 -0
- package/dist/stripe/useStripeTheme.spec.d.ts +2 -0
- package/dist/stripe/useStripeTheme.spec.d.ts.map +1 -0
- package/dist/stripe/useStripeTheme.spec.js +793 -0
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +6 -5
- package/dist/telemetry.spec.js +495 -12
- package/dist/tokens/__tests__/colors.test.d.ts +2 -0
- package/dist/tokens/__tests__/colors.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/colors.test.js +152 -0
- package/dist/tokens/__tests__/radius.test.d.ts +2 -0
- package/dist/tokens/__tests__/radius.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/radius.test.js +118 -0
- package/dist/tokens/__tests__/shadows.test.d.ts +2 -0
- package/dist/tokens/__tests__/shadows.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/shadows.test.js +105 -0
- package/dist/tokens/__tests__/spacing.test.js +11 -8
- package/dist/tokens/__tests__/typography.test.d.ts +2 -0
- package/dist/tokens/__tests__/typography.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/typography.test.js +156 -0
- package/dist/tokens/__tests__/z-index.test.d.ts +2 -0
- package/dist/tokens/__tests__/z-index.test.d.ts.map +1 -0
- package/dist/tokens/__tests__/z-index.test.js +121 -0
- package/dist/utils/apiConfig.spec.js +102 -1
- package/dist/utils/formatters.spec.d.ts +2 -0
- package/dist/utils/formatters.spec.d.ts.map +1 -0
- package/dist/utils/formatters.spec.js +82 -0
- package/dist/utils/transitions.spec.d.ts +2 -0
- package/dist/utils/transitions.spec.d.ts.map +1 -0
- package/dist/utils/transitions.spec.js +130 -0
- package/package.json +8 -3
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { testIconProps, createIconTestSuite, batchTestIcons } from './iconTestUtils';
|
|
3
|
+
import ChevronUpOutline from './ChevronUpOutline.svelte';
|
|
4
|
+
import ChevronDownOutline from './ChevronDownOutline.svelte';
|
|
5
|
+
|
|
6
|
+
describe('iconTestUtils', () => {
|
|
7
|
+
describe('testIconProps', () => {
|
|
8
|
+
it('returns an object with test methods', () => {
|
|
9
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
10
|
+
|
|
11
|
+
expect(typeof tests.rendersAsSvg).toBe('function');
|
|
12
|
+
expect(typeof tests.hasDefaultSize).toBe('function');
|
|
13
|
+
expect(typeof tests.acceptsCustomSize).toBe('function');
|
|
14
|
+
expect(typeof tests.hasDefaultColor).toBe('function');
|
|
15
|
+
expect(typeof tests.acceptsCustomColor).toBe('function');
|
|
16
|
+
expect(typeof tests.acceptsCustomClass).toBe('function');
|
|
17
|
+
expect(typeof tests.hasAriaHidden).toBe('function');
|
|
18
|
+
expect(typeof tests.hasViewBox).toBe('function');
|
|
19
|
+
expect(typeof tests.runAllTests).toBe('function');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('rendersAsSvg', () => {
|
|
23
|
+
it('verifies SVG element exists', () => {
|
|
24
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
25
|
+
const svg = tests.rendersAsSvg();
|
|
26
|
+
expect(svg).toBeTruthy();
|
|
27
|
+
expect(svg?.tagName).toBe('svg');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('hasDefaultSize', () => {
|
|
32
|
+
it('verifies default size attribute', () => {
|
|
33
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
34
|
+
// Should not throw
|
|
35
|
+
expect(() => tests.hasDefaultSize()).not.toThrow();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('accepts custom default size', () => {
|
|
39
|
+
const tests = testIconProps(ChevronUpOutline, { defaultSize: '16' });
|
|
40
|
+
// This will fail if the icon doesn't have size 16 by default
|
|
41
|
+
// But the function should run without throwing
|
|
42
|
+
expect(typeof tests.hasDefaultSize).toBe('function');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('acceptsCustomSize', () => {
|
|
47
|
+
it('verifies custom size is applied', () => {
|
|
48
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
49
|
+
expect(() => tests.acceptsCustomSize('48')).not.toThrow();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('uses default custom size of 32', () => {
|
|
53
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
54
|
+
expect(() => tests.acceptsCustomSize()).not.toThrow();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('hasDefaultColor', () => {
|
|
59
|
+
it('checks for currentColor stroke', () => {
|
|
60
|
+
const tests = testIconProps(ChevronUpOutline, { usesStroke: true });
|
|
61
|
+
expect(() => tests.hasDefaultColor()).not.toThrow();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('checks for currentColor fill when usesFill is true', () => {
|
|
65
|
+
const tests = testIconProps(ChevronUpOutline, { usesFill: true });
|
|
66
|
+
expect(() => tests.hasDefaultColor()).not.toThrow();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('handles icons with no stroke', () => {
|
|
70
|
+
const tests = testIconProps(ChevronUpOutline, { usesStroke: false });
|
|
71
|
+
expect(() => tests.hasDefaultColor()).not.toThrow();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('acceptsCustomColor', () => {
|
|
76
|
+
it('verifies custom color is applied', () => {
|
|
77
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
78
|
+
expect(() => tests.acceptsCustomColor('blue')).not.toThrow();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('uses default custom color of red', () => {
|
|
82
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
83
|
+
expect(() => tests.acceptsCustomColor()).not.toThrow();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('handles fill-based icons', () => {
|
|
87
|
+
const tests = testIconProps(ChevronUpOutline, { usesFill: true });
|
|
88
|
+
expect(() => tests.acceptsCustomColor('green')).not.toThrow();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe('acceptsCustomClass', () => {
|
|
93
|
+
it('verifies custom class is applied', () => {
|
|
94
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
95
|
+
expect(() => tests.acceptsCustomClass('my-icon-class')).not.toThrow();
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('uses default custom class', () => {
|
|
99
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
100
|
+
expect(() => tests.acceptsCustomClass()).not.toThrow();
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('hasAriaHidden', () => {
|
|
105
|
+
it('verifies aria-hidden attribute', () => {
|
|
106
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
107
|
+
expect(() => tests.hasAriaHidden()).not.toThrow();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('hasViewBox', () => {
|
|
112
|
+
it('verifies viewBox attribute exists', () => {
|
|
113
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
114
|
+
expect(() => tests.hasViewBox()).not.toThrow();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('verifies specific viewBox value', () => {
|
|
118
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
119
|
+
// Pass expected viewBox to test specific value
|
|
120
|
+
expect(typeof tests.hasViewBox).toBe('function');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
describe('runAllTests', () => {
|
|
125
|
+
it('runs all test methods', () => {
|
|
126
|
+
const tests = testIconProps(ChevronUpOutline);
|
|
127
|
+
expect(() => tests.runAllTests()).not.toThrow();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
describe('createIconTestSuite', () => {
|
|
133
|
+
it('returns an object with tests and getTestCases', () => {
|
|
134
|
+
const suite = createIconTestSuite('ChevronUpOutline', ChevronUpOutline);
|
|
135
|
+
|
|
136
|
+
expect(suite).toHaveProperty('tests');
|
|
137
|
+
expect(suite).toHaveProperty('getTestCases');
|
|
138
|
+
expect(typeof suite.getTestCases).toBe('function');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('getTestCases returns an array of test tuples', () => {
|
|
142
|
+
const suite = createIconTestSuite('ChevronUpOutline', ChevronUpOutline);
|
|
143
|
+
const testCases = suite.getTestCases();
|
|
144
|
+
|
|
145
|
+
expect(Array.isArray(testCases)).toBe(true);
|
|
146
|
+
expect(testCases.length).toBe(8);
|
|
147
|
+
|
|
148
|
+
// Each test case is a tuple of [name, testFn]
|
|
149
|
+
testCases.forEach(([name, testFn]) => {
|
|
150
|
+
expect(typeof name).toBe('string');
|
|
151
|
+
expect(typeof testFn).toBe('function');
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('test cases have expected names', () => {
|
|
156
|
+
const suite = createIconTestSuite('ChevronUpOutline', ChevronUpOutline);
|
|
157
|
+
const testCases = suite.getTestCases();
|
|
158
|
+
const testNames = testCases.map(([name]) => name);
|
|
159
|
+
|
|
160
|
+
expect(testNames).toContain('renders an SVG element');
|
|
161
|
+
expect(testNames).toContain('has default size');
|
|
162
|
+
expect(testNames).toContain('accepts custom size');
|
|
163
|
+
expect(testNames).toContain('has default color (currentColor)');
|
|
164
|
+
expect(testNames).toContain('accepts custom color');
|
|
165
|
+
expect(testNames).toContain('accepts custom class');
|
|
166
|
+
expect(testNames).toContain('has aria-hidden attribute');
|
|
167
|
+
expect(testNames).toContain('has viewBox attribute');
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('accepts custom options', () => {
|
|
171
|
+
const suite = createIconTestSuite('ChevronUpOutline', ChevronUpOutline, {
|
|
172
|
+
defaultSize: '16',
|
|
173
|
+
usesStroke: true,
|
|
174
|
+
usesFill: false,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
expect(suite.tests).toBeDefined();
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
describe('batchTestIcons', () => {
|
|
182
|
+
it('returns an array of icon test suites', () => {
|
|
183
|
+
const icons = [
|
|
184
|
+
{ name: 'ChevronUpOutline', component: ChevronUpOutline },
|
|
185
|
+
{ name: 'ChevronDownOutline', component: ChevronDownOutline },
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
const result = batchTestIcons(icons);
|
|
189
|
+
|
|
190
|
+
expect(Array.isArray(result)).toBe(true);
|
|
191
|
+
expect(result.length).toBe(2);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it('each result has name, component, and suite', () => {
|
|
195
|
+
const icons = [
|
|
196
|
+
{ name: 'ChevronUpOutline', component: ChevronUpOutline },
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
const result = batchTestIcons(icons);
|
|
200
|
+
|
|
201
|
+
expect(result[0]).toHaveProperty('name', 'ChevronUpOutline');
|
|
202
|
+
expect(result[0]).toHaveProperty('component');
|
|
203
|
+
expect(result[0]).toHaveProperty('suite');
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('supports custom options per icon', () => {
|
|
207
|
+
const icons = [
|
|
208
|
+
{
|
|
209
|
+
name: 'ChevronUpOutline',
|
|
210
|
+
component: ChevronUpOutline,
|
|
211
|
+
options: { defaultSize: '20' }
|
|
212
|
+
},
|
|
213
|
+
];
|
|
214
|
+
|
|
215
|
+
const result = batchTestIcons(icons);
|
|
216
|
+
|
|
217
|
+
expect(result[0].suite).toBeDefined();
|
|
218
|
+
expect(result[0].suite.tests).toBeDefined();
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('handles empty array', () => {
|
|
222
|
+
const result = batchTestIcons([]);
|
|
223
|
+
expect(result).toEqual([]);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it('handles icons without options', () => {
|
|
227
|
+
const icons = [
|
|
228
|
+
{ name: 'ChevronUpOutline', component: ChevronUpOutline },
|
|
229
|
+
];
|
|
230
|
+
|
|
231
|
+
const result = batchTestIcons(icons);
|
|
232
|
+
expect(result[0].suite).toBeDefined();
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
});
|
|
@@ -5,8 +5,8 @@ import Input from "./Input.svelte";
|
|
|
5
5
|
|
|
6
6
|
function setupTest(args) {
|
|
7
7
|
const user = userEvent.setup();
|
|
8
|
-
const
|
|
9
|
-
return { user, component };
|
|
8
|
+
const result = render(Input, { props: { ...args } });
|
|
9
|
+
return { user, component: result.component, container: result.container };
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
describe("Input Component Tests", () => {
|
|
@@ -112,9 +112,9 @@ describe("Input Component Tests", () => {
|
|
|
112
112
|
setupTest({
|
|
113
113
|
type: "text",
|
|
114
114
|
id: "test-input",
|
|
115
|
-
size: "
|
|
115
|
+
size: "lg",
|
|
116
116
|
});
|
|
117
|
-
expect(screen.getByRole("textbox")).toHaveClass("
|
|
117
|
+
expect(screen.getByRole("textbox")).toHaveClass("h-12");
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
test("Applies correct content float class", () => {
|
|
@@ -196,9 +196,9 @@ describe("Input Component Tests", () => {
|
|
|
196
196
|
setupTest({
|
|
197
197
|
type: "text",
|
|
198
198
|
id: "small-size-input",
|
|
199
|
-
size: "
|
|
199
|
+
size: "sm",
|
|
200
200
|
});
|
|
201
|
-
expect(screen.getByRole("textbox")).toHaveClass("
|
|
201
|
+
expect(screen.getByRole("textbox")).toHaveClass("h-9");
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
test("Input adheres to maxlength attribute", async () => {
|
|
@@ -269,14 +269,14 @@ describe("Input Component Tests", () => {
|
|
|
269
269
|
});
|
|
270
270
|
|
|
271
271
|
test("Custom class is applied correctly", () => {
|
|
272
|
-
setupTest({
|
|
272
|
+
const { container } = setupTest({
|
|
273
273
|
type: "text",
|
|
274
274
|
id: "custom-class-input",
|
|
275
275
|
className: "custom-class",
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
const
|
|
279
|
-
expect(
|
|
278
|
+
const wrapper = container.querySelector('.custom-class');
|
|
279
|
+
expect(wrapper).toBeInTheDocument();
|
|
280
280
|
});
|
|
281
281
|
});
|
|
282
282
|
|
|
@@ -492,7 +492,7 @@ describe("Input States", () => {
|
|
|
492
492
|
});
|
|
493
493
|
const statusText = screen.getByText("(verified)");
|
|
494
494
|
expect(statusText).toBeInTheDocument();
|
|
495
|
-
expect(statusText).toHaveClass("
|
|
495
|
+
expect(statusText).toHaveClass("text-green-600");
|
|
496
496
|
});
|
|
497
497
|
|
|
498
498
|
test("Shows status text with error type", () => {
|
|
@@ -505,7 +505,7 @@ describe("Input States", () => {
|
|
|
505
505
|
});
|
|
506
506
|
const statusText = screen.getByText("(unverified)");
|
|
507
507
|
expect(statusText).toBeInTheDocument();
|
|
508
|
-
expect(statusText).toHaveClass("
|
|
508
|
+
expect(statusText).toHaveClass("text-red-500");
|
|
509
509
|
});
|
|
510
510
|
|
|
511
511
|
test("Applies animate focus class when enabled", () => {
|
|
@@ -515,7 +515,7 @@ describe("Input States", () => {
|
|
|
515
515
|
animateFocus: true,
|
|
516
516
|
});
|
|
517
517
|
const input = screen.getByRole("textbox");
|
|
518
|
-
expect(input).toHaveClass("
|
|
518
|
+
expect(input).toHaveClass("focus:scale-[1.01]");
|
|
519
519
|
});
|
|
520
520
|
|
|
521
521
|
test("Does not apply animate focus when disabled", () => {
|
|
@@ -525,7 +525,7 @@ describe("Input States", () => {
|
|
|
525
525
|
animateFocus: false,
|
|
526
526
|
});
|
|
527
527
|
const input = screen.getByRole("textbox");
|
|
528
|
-
expect(input).not.toHaveClass("
|
|
528
|
+
expect(input).not.toHaveClass("focus:scale-[1.01]");
|
|
529
529
|
});
|
|
530
530
|
|
|
531
531
|
test("Does not apply animate focus on disabled input", () => {
|
|
@@ -536,7 +536,7 @@ describe("Input States", () => {
|
|
|
536
536
|
disabled: true,
|
|
537
537
|
});
|
|
538
538
|
const input = screen.getByRole("textbox");
|
|
539
|
-
expect(input).not.toHaveClass("
|
|
539
|
+
expect(input).not.toHaveClass("focus:scale-[1.01]");
|
|
540
540
|
});
|
|
541
541
|
});
|
|
542
542
|
|
|
@@ -410,22 +410,9 @@
|
|
|
410
410
|
{#if helperIcon || hintIcon}
|
|
411
411
|
<img src={helperIcon || hintIcon} alt="Helper icon" class="w-4 h-4 mr-2" />
|
|
412
412
|
{/if}
|
|
413
|
+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
|
413
414
|
<span>{@html helperText || hintText}</span>
|
|
414
415
|
</div>
|
|
415
416
|
{/if}
|
|
416
417
|
</div>
|
|
417
418
|
</div>
|
|
418
|
-
|
|
419
|
-
<style>
|
|
420
|
-
/* Hide number input spinners globally */
|
|
421
|
-
:global(input[type="number"]::-webkit-outer-spin-button),
|
|
422
|
-
:global(input[type="number"]::-webkit-inner-spin-button) {
|
|
423
|
-
-webkit-appearance: none;
|
|
424
|
-
margin: 0;
|
|
425
|
-
}
|
|
426
|
-
:global(input[type="number"]) {
|
|
427
|
-
-moz-appearance: textfield;
|
|
428
|
-
-webkit-appearance: textfield;
|
|
429
|
-
appearance: textfield;
|
|
430
|
-
}
|
|
431
|
-
</style>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Input.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Input/Input.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmZA;;eA9Ce,OAAO;eACP,OAAO;eACP,OAAO;WACX,MAAM,GAAG,IAAI;iBACP,MAAM,GAAG,IAAI;iBACb,MAAM,GAAG,IAAI;gBACd,MAAM,GAAG,IAAI;gBACb,MAAM,GAAG,IAAI;WAClB,MAAM;kBACC,MAAM;YACZ,MAAM;SACT,MAAM;WACJ,MAAM;gBACD,MAAM;WACX,IAAI,GAAG,IAAI,GAAG,IAAI;mBACV,MAAM;gBACT,MAAM;YACV,MAAM,GAAG,KAAK;iBACT,MAAM;iBACN,MAAM;eACR,MAAM;eACN,MAAM;mBACF,MAAM;eACV,OAAO;iBACL,OAAO;oBACJ,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI;YACxC,MAAM,GAAG,MAAM,GAAG,IAAI;mBACf,MAAM,GAAG,IAAI;gBAChB,OAAO;yBACE,OAAO;mBACb,OAAO;iBACT,MAAM;iBACN,MAAM;qBACF,OAAO;gBACZ,MAAM,GAAG,IAAI;oBACT,OAAO;iBACV,MAAM;qBACF,MAAM;sBACL,OAAO;eACd,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;cACpC,MAAM,IAAI;aACX,MAAM,IAAI;oBACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;eAC5B,GAAG;gBAGkC"}
|
|
@@ -77,16 +77,17 @@ describe("Select Component Tests", () => {
|
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
test("Dispatches change event on selection", async () => {
|
|
80
|
-
const { user, component } = setupTest();
|
|
81
80
|
const changeSpy = vi.fn();
|
|
82
|
-
|
|
81
|
+
const { user } = setupTest({
|
|
82
|
+
onchange: changeSpy,
|
|
83
|
+
});
|
|
83
84
|
|
|
84
85
|
const trigger = screen.getByRole("button");
|
|
85
86
|
await user.click(trigger);
|
|
86
87
|
await user.click(screen.getByText("Option 3"));
|
|
87
88
|
|
|
88
89
|
expect(changeSpy).toHaveBeenCalled();
|
|
89
|
-
expect(changeSpy.mock.calls[0][0]
|
|
90
|
+
expect(changeSpy.mock.calls[0][0]).toEqual({
|
|
90
91
|
value: "opt3",
|
|
91
92
|
item: { name: "Option 3", value: "opt3" },
|
|
92
93
|
});
|
|
@@ -162,18 +163,11 @@ describe("Select Component Tests", () => {
|
|
|
162
163
|
expect(screen.getByRole("listbox")).toBeInTheDocument();
|
|
163
164
|
});
|
|
164
165
|
|
|
165
|
-
test("Applies
|
|
166
|
-
setupTest();
|
|
167
|
-
const trigger = screen.getByRole("button");
|
|
168
|
-
expect(trigger).toHaveClass("select-animate-focus");
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("Does not apply animate focus when disabled", () => {
|
|
172
|
-
setupTest({
|
|
173
|
-
animateFocus: false,
|
|
174
|
-
});
|
|
166
|
+
test("Applies focus ring on focus", async () => {
|
|
167
|
+
const { user } = setupTest();
|
|
175
168
|
const trigger = screen.getByRole("button");
|
|
176
|
-
expect(trigger).
|
|
169
|
+
expect(trigger).toHaveClass("focus:ring-4");
|
|
170
|
+
expect(trigger).toHaveClass("focus:ring-blue-300");
|
|
177
171
|
});
|
|
178
172
|
|
|
179
173
|
test("Closes dropdown when clicking outside", async () => {
|
|
@@ -188,7 +182,7 @@ describe("Select Component Tests", () => {
|
|
|
188
182
|
expect(screen.queryByRole("listbox")).not.toBeInTheDocument();
|
|
189
183
|
});
|
|
190
184
|
|
|
191
|
-
test("
|
|
185
|
+
test("Marks selected option with aria-selected", async () => {
|
|
192
186
|
const { user } = setupTest({
|
|
193
187
|
value: "opt1",
|
|
194
188
|
});
|
|
@@ -196,11 +190,11 @@ describe("Select Component Tests", () => {
|
|
|
196
190
|
|
|
197
191
|
await user.click(trigger);
|
|
198
192
|
|
|
199
|
-
// The selected option should have
|
|
193
|
+
// The selected option should have aria-selected="true"
|
|
200
194
|
const options = screen.getAllByRole("option");
|
|
201
195
|
const selectedOption = options.find(opt => opt.getAttribute("aria-selected") === "true");
|
|
202
196
|
expect(selectedOption).toBeInTheDocument();
|
|
203
|
-
expect(selectedOption.
|
|
197
|
+
expect(selectedOption).toHaveTextContent("Option 1");
|
|
204
198
|
});
|
|
205
199
|
|
|
206
200
|
test("Sets aria-expanded correctly", async () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/primitives/Input/Textarea.spec.js"],"names":[],"mappings":""}
|