From 1d3060d53e493ab99515b44ce379616c54fc0113 Mon Sep 17 00:00:00 2001 From: jp calvo Date: Thu, 3 Oct 2024 20:26:07 +0800 Subject: [PATCH] test: add test for toast --- packages/ui-ingredients/package.json | 1 + .../tests/{ => accordion}/accordion.svelte | 0 .../tests/{ => accordion}/accordion.test.ts | 2 +- .../src/tests/{ => avatar}/avatar.svelte | 0 .../src/tests/{ => avatar}/avatar.test.ts | 2 +- .../src/tests/{ => carousel}/carousel.svelte | 0 .../src/tests/{ => carousel}/carousel.test.ts | 2 +- .../src/tests/{ => checkbox}/checkbox.svelte | 0 .../src/tests/{ => checkbox}/checkbox.test.ts | 2 +- .../tests/{ => clipboard}/clipboard.svelte | 0 .../tests/{ => clipboard}/clipboard.test.ts | 2 +- .../{ => collapsible}/collapsible.svelte | 0 .../{ => collapsible}/collapsible.test.ts | 2 +- .../src/tests/{ => combobox}/combobox.svelte | 0 .../src/tests/{ => combobox}/combobox.test.ts | 2 +- .../{ => date-picker}/date-picker.svelte | 0 .../{ => date-picker}/date-picker.test.ts | 2 +- .../src/tests/{ => dialog}/dialog.svelte | 0 .../src/tests/{ => dialog}/dialog.test.ts | 2 +- .../src/tests/{ => editable}/editable.svelte | 0 .../src/tests/{ => editable}/editable.test.ts | 2 +- .../src/tests/{ => field}/field.svelte | 0 .../src/tests/{ => field}/field.test.ts | 2 +- .../{ => file-upload}/file-upload.svelte | 0 .../{ => file-upload}/file-upload.test.ts | 2 +- .../tests/{ => hover-card}/hover-card.svelte | 0 .../tests/{ => hover-card}/hover-card.test.ts | 2 +- .../src/tests/{ => menu}/menu.svelte | 0 .../src/tests/{ => menu}/menu.test.ts | 2 +- .../{ => number-input}/number-input.svelte | 0 .../{ => number-input}/number-input.test.ts | 2 +- .../tests/{ => pagination}/pagination.svelte | 0 .../tests/{ => pagination}/pagination.test.ts | 2 +- .../tests/{ => pin-input}/pin-input.svelte | 0 .../tests/{ => pin-input}/pin-input.test.ts | 2 +- .../src/tests/{ => popover}/popover.svelte | 0 .../src/tests/{ => popover}/popover.test.ts | 2 +- .../src/tests/{ => progress}/progress.svelte | 0 .../src/tests/{ => progress}/progress.test.ts | 2 +- .../src/tests/{ => qr-code}/qr-code.svelte | 0 .../src/tests/{ => qr-code}/qr-code.test.ts | 2 +- .../{ => radio-group}/radio-group.svelte | 0 .../{ => radio-group}/radio-group.test.ts | 2 +- .../{ => rating-group}/rating-group.svelte | 0 .../{ => rating-group}/rating-group.test.ts | 2 +- .../{ => segment-group}/segment-group.svelte | 0 .../{ => segment-group}/segment-group.test.ts | 2 +- .../src/tests/{ => select}/select.svelte | 0 .../src/tests/{ => select}/select.test.ts | 2 +- .../{ => signature-pad}/signature-pad.svelte | 0 .../{ => signature-pad}/signature-pad.test.ts | 2 +- .../src/tests/{ => slider}/slider.svelte | 0 .../src/tests/{ => slider}/slider.test.ts | 2 +- .../src/tests/{ => splitter}/splitter.svelte | 0 .../src/tests/{ => splitter}/splitter.test.ts | 2 +- .../src/tests/{ => steps}/steps.svelte | 0 .../src/tests/{ => steps}/steps.test.ts | 8 ++--- .../src/tests/{ => switch}/switch.svelte | 0 .../src/tests/{ => switch}/switch.test.ts | 2 +- .../src/tests/{ => tabs}/tabs.svelte | 0 .../src/tests/{ => tabs}/tabs.test.ts | 2 +- .../tests/{ => tags-input}/tags-input.svelte | 0 .../tests/{ => tags-input}/tags-input.test.ts | 2 +- .../{ => time-picker}/time-picker.svelte | 0 .../{ => time-picker}/time-picker.test.ts | 2 +- .../src/tests/{ => timer}/timer.svelte | 0 .../src/tests/{ => timer}/timer.test.ts | 2 +- .../src/tests/toast/toast.svelte | 27 ++++++++++++++ .../src/tests/toast/toast.test.ts | 35 +++++++++++++++++++ .../{ => toggle-group}/toggle-group.svelte | 0 .../{ => toggle-group}/toggle-group.test.ts | 2 +- .../src/tests/{ => tooltip}/tooltip.svelte | 0 .../src/tests/{ => tooltip}/tooltip.test.ts | 2 +- .../tests/{ => tree-view}/tree-view.svelte | 0 .../tests/{ => tree-view}/tree-view.test.ts | 2 +- pnpm-lock.yaml | 13 +++++++ 76 files changed, 115 insertions(+), 39 deletions(-) rename packages/ui-ingredients/src/tests/{ => accordion}/accordion.svelte (100%) rename packages/ui-ingredients/src/tests/{ => accordion}/accordion.test.ts (94%) rename packages/ui-ingredients/src/tests/{ => avatar}/avatar.svelte (100%) rename packages/ui-ingredients/src/tests/{ => avatar}/avatar.test.ts (93%) rename packages/ui-ingredients/src/tests/{ => carousel}/carousel.svelte (100%) rename packages/ui-ingredients/src/tests/{ => carousel}/carousel.test.ts (93%) rename packages/ui-ingredients/src/tests/{ => checkbox}/checkbox.svelte (100%) rename packages/ui-ingredients/src/tests/{ => checkbox}/checkbox.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => clipboard}/clipboard.svelte (100%) rename packages/ui-ingredients/src/tests/{ => clipboard}/clipboard.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => collapsible}/collapsible.svelte (100%) rename packages/ui-ingredients/src/tests/{ => collapsible}/collapsible.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => combobox}/combobox.svelte (100%) rename packages/ui-ingredients/src/tests/{ => combobox}/combobox.test.ts (93%) rename packages/ui-ingredients/src/tests/{ => date-picker}/date-picker.svelte (100%) rename packages/ui-ingredients/src/tests/{ => date-picker}/date-picker.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => dialog}/dialog.svelte (100%) rename packages/ui-ingredients/src/tests/{ => dialog}/dialog.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => editable}/editable.svelte (100%) rename packages/ui-ingredients/src/tests/{ => editable}/editable.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => field}/field.svelte (100%) rename packages/ui-ingredients/src/tests/{ => field}/field.test.ts (91%) rename packages/ui-ingredients/src/tests/{ => file-upload}/file-upload.svelte (100%) rename packages/ui-ingredients/src/tests/{ => file-upload}/file-upload.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => hover-card}/hover-card.svelte (100%) rename packages/ui-ingredients/src/tests/{ => hover-card}/hover-card.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => menu}/menu.svelte (100%) rename packages/ui-ingredients/src/tests/{ => menu}/menu.test.ts (93%) rename packages/ui-ingredients/src/tests/{ => number-input}/number-input.svelte (100%) rename packages/ui-ingredients/src/tests/{ => number-input}/number-input.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => pagination}/pagination.svelte (100%) rename packages/ui-ingredients/src/tests/{ => pagination}/pagination.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => pin-input}/pin-input.svelte (100%) rename packages/ui-ingredients/src/tests/{ => pin-input}/pin-input.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => popover}/popover.svelte (100%) rename packages/ui-ingredients/src/tests/{ => popover}/popover.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => progress}/progress.svelte (100%) rename packages/ui-ingredients/src/tests/{ => progress}/progress.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => qr-code}/qr-code.svelte (100%) rename packages/ui-ingredients/src/tests/{ => qr-code}/qr-code.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => radio-group}/radio-group.svelte (100%) rename packages/ui-ingredients/src/tests/{ => radio-group}/radio-group.test.ts (94%) rename packages/ui-ingredients/src/tests/{ => rating-group}/rating-group.svelte (100%) rename packages/ui-ingredients/src/tests/{ => rating-group}/rating-group.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => segment-group}/segment-group.svelte (100%) rename packages/ui-ingredients/src/tests/{ => segment-group}/segment-group.test.ts (94%) rename packages/ui-ingredients/src/tests/{ => select}/select.svelte (100%) rename packages/ui-ingredients/src/tests/{ => select}/select.test.ts (94%) rename packages/ui-ingredients/src/tests/{ => signature-pad}/signature-pad.svelte (100%) rename packages/ui-ingredients/src/tests/{ => signature-pad}/signature-pad.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => slider}/slider.svelte (100%) rename packages/ui-ingredients/src/tests/{ => slider}/slider.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => splitter}/splitter.svelte (100%) rename packages/ui-ingredients/src/tests/{ => splitter}/splitter.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => steps}/steps.svelte (100%) rename packages/ui-ingredients/src/tests/{ => steps}/steps.test.ts (77%) rename packages/ui-ingredients/src/tests/{ => switch}/switch.svelte (100%) rename packages/ui-ingredients/src/tests/{ => switch}/switch.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => tabs}/tabs.svelte (100%) rename packages/ui-ingredients/src/tests/{ => tabs}/tabs.test.ts (95%) rename packages/ui-ingredients/src/tests/{ => tags-input}/tags-input.svelte (100%) rename packages/ui-ingredients/src/tests/{ => tags-input}/tags-input.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => time-picker}/time-picker.svelte (100%) rename packages/ui-ingredients/src/tests/{ => time-picker}/time-picker.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => timer}/timer.svelte (100%) rename packages/ui-ingredients/src/tests/{ => timer}/timer.test.ts (91%) create mode 100644 packages/ui-ingredients/src/tests/toast/toast.svelte create mode 100644 packages/ui-ingredients/src/tests/toast/toast.test.ts rename packages/ui-ingredients/src/tests/{ => toggle-group}/toggle-group.svelte (100%) rename packages/ui-ingredients/src/tests/{ => toggle-group}/toggle-group.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => tooltip}/tooltip.svelte (100%) rename packages/ui-ingredients/src/tests/{ => tooltip}/tooltip.test.ts (92%) rename packages/ui-ingredients/src/tests/{ => tree-view}/tree-view.svelte (100%) rename packages/ui-ingredients/src/tests/{ => tree-view}/tree-view.test.ts (92%) diff --git a/packages/ui-ingredients/package.json b/packages/ui-ingredients/package.json index 27ab3d32..6a224bc9 100644 --- a/packages/ui-ingredients/package.json +++ b/packages/ui-ingredients/package.json @@ -329,6 +329,7 @@ "@sveltejs/vite-plugin-svelte": "4.0.0-next.6", "@testing-library/jest-dom": "6.5.0", "@testing-library/svelte": "5.2.3", + "@testing-library/user-event": "14.5.2", "@types/jsdom": "21.1.7", "@untitled-theme/icons-svelte": "0.10.9", "autoprefixer": "10.4.20", diff --git a/packages/ui-ingredients/src/tests/accordion.svelte b/packages/ui-ingredients/src/tests/accordion/accordion.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/accordion.svelte rename to packages/ui-ingredients/src/tests/accordion/accordion.svelte diff --git a/packages/ui-ingredients/src/tests/accordion.test.ts b/packages/ui-ingredients/src/tests/accordion/accordion.test.ts similarity index 94% rename from packages/ui-ingredients/src/tests/accordion.test.ts rename to packages/ui-ingredients/src/tests/accordion/accordion.test.ts index ce7803f3..d610a8d9 100644 --- a/packages/ui-ingredients/src/tests/accordion.test.ts +++ b/packages/ui-ingredients/src/tests/accordion/accordion.test.ts @@ -1,8 +1,8 @@ import {accordionAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Accordion from './accordion.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {value: '1', label: 'Item 1', content: 'Content 1'}, diff --git a/packages/ui-ingredients/src/tests/avatar.svelte b/packages/ui-ingredients/src/tests/avatar/avatar.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/avatar.svelte rename to packages/ui-ingredients/src/tests/avatar/avatar.svelte diff --git a/packages/ui-ingredients/src/tests/avatar.test.ts b/packages/ui-ingredients/src/tests/avatar/avatar.test.ts similarity index 93% rename from packages/ui-ingredients/src/tests/avatar.test.ts rename to packages/ui-ingredients/src/tests/avatar/avatar.test.ts index ef4bd048..ddb920d9 100644 --- a/packages/ui-ingredients/src/tests/avatar.test.ts +++ b/packages/ui-ingredients/src/tests/avatar/avatar.test.ts @@ -2,8 +2,8 @@ import {avatarAnatomy} from '$lib/index.js'; import {faker} from '@faker-js/faker'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Avatar from './avatar.svelte'; -import {getAnatomySelector} from './utils.js'; const src = faker.image.avatar(); const name = faker.person.fullName(); diff --git a/packages/ui-ingredients/src/tests/carousel.svelte b/packages/ui-ingredients/src/tests/carousel/carousel.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/carousel.svelte rename to packages/ui-ingredients/src/tests/carousel/carousel.svelte diff --git a/packages/ui-ingredients/src/tests/carousel.test.ts b/packages/ui-ingredients/src/tests/carousel/carousel.test.ts similarity index 93% rename from packages/ui-ingredients/src/tests/carousel.test.ts rename to packages/ui-ingredients/src/tests/carousel/carousel.test.ts index a026cf50..28acdc34 100644 --- a/packages/ui-ingredients/src/tests/carousel.test.ts +++ b/packages/ui-ingredients/src/tests/carousel/carousel.test.ts @@ -2,8 +2,8 @@ import {carouselAnatomy} from '$lib/index.js'; import {faker} from '@faker-js/faker'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Carousel from './carousel.svelte'; -import {getAnatomySelector} from './utils.js'; const images = Array.from({length: 5}).map(() => faker.image.url()); diff --git a/packages/ui-ingredients/src/tests/checkbox.svelte b/packages/ui-ingredients/src/tests/checkbox/checkbox.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/checkbox.svelte rename to packages/ui-ingredients/src/tests/checkbox/checkbox.svelte diff --git a/packages/ui-ingredients/src/tests/checkbox.test.ts b/packages/ui-ingredients/src/tests/checkbox/checkbox.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/checkbox.test.ts rename to packages/ui-ingredients/src/tests/checkbox/checkbox.test.ts index a912ec69..ec41673f 100644 --- a/packages/ui-ingredients/src/tests/checkbox.test.ts +++ b/packages/ui-ingredients/src/tests/checkbox/checkbox.test.ts @@ -1,8 +1,8 @@ import {checkboxAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Checkbox from './checkbox.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Checkbox', () => { it.each(getAnatomySelector(checkboxAnatomy))( diff --git a/packages/ui-ingredients/src/tests/clipboard.svelte b/packages/ui-ingredients/src/tests/clipboard/clipboard.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/clipboard.svelte rename to packages/ui-ingredients/src/tests/clipboard/clipboard.svelte diff --git a/packages/ui-ingredients/src/tests/clipboard.test.ts b/packages/ui-ingredients/src/tests/clipboard/clipboard.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/clipboard.test.ts rename to packages/ui-ingredients/src/tests/clipboard/clipboard.test.ts index a1a450db..97459df4 100644 --- a/packages/ui-ingredients/src/tests/clipboard.test.ts +++ b/packages/ui-ingredients/src/tests/clipboard/clipboard.test.ts @@ -1,8 +1,8 @@ import {clipboardAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Clipboard from './clipboard.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Clipboard', () => { it.each(getAnatomySelector(clipboardAnatomy))( diff --git a/packages/ui-ingredients/src/tests/collapsible.svelte b/packages/ui-ingredients/src/tests/collapsible/collapsible.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/collapsible.svelte rename to packages/ui-ingredients/src/tests/collapsible/collapsible.svelte diff --git a/packages/ui-ingredients/src/tests/collapsible.test.ts b/packages/ui-ingredients/src/tests/collapsible/collapsible.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/collapsible.test.ts rename to packages/ui-ingredients/src/tests/collapsible/collapsible.test.ts index 64d6264f..78b25867 100644 --- a/packages/ui-ingredients/src/tests/collapsible.test.ts +++ b/packages/ui-ingredients/src/tests/collapsible/collapsible.test.ts @@ -1,8 +1,8 @@ import {collapsibleAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Collapsible from './collapsible.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Collapsible', () => { it.each(getAnatomySelector(collapsibleAnatomy))( diff --git a/packages/ui-ingredients/src/tests/combobox.svelte b/packages/ui-ingredients/src/tests/combobox/combobox.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/combobox.svelte rename to packages/ui-ingredients/src/tests/combobox/combobox.svelte diff --git a/packages/ui-ingredients/src/tests/combobox.test.ts b/packages/ui-ingredients/src/tests/combobox/combobox.test.ts similarity index 93% rename from packages/ui-ingredients/src/tests/combobox.test.ts rename to packages/ui-ingredients/src/tests/combobox/combobox.test.ts index 33f250ef..d763a231 100644 --- a/packages/ui-ingredients/src/tests/combobox.test.ts +++ b/packages/ui-ingredients/src/tests/combobox/combobox.test.ts @@ -1,8 +1,8 @@ import {comboboxAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Combobox from './combobox.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {label: 'Item 1', value: '1'}, diff --git a/packages/ui-ingredients/src/tests/date-picker.svelte b/packages/ui-ingredients/src/tests/date-picker/date-picker.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/date-picker.svelte rename to packages/ui-ingredients/src/tests/date-picker/date-picker.svelte diff --git a/packages/ui-ingredients/src/tests/date-picker.test.ts b/packages/ui-ingredients/src/tests/date-picker/date-picker.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/date-picker.test.ts rename to packages/ui-ingredients/src/tests/date-picker/date-picker.test.ts index 6f2b11da..7621e82d 100644 --- a/packages/ui-ingredients/src/tests/date-picker.test.ts +++ b/packages/ui-ingredients/src/tests/date-picker/date-picker.test.ts @@ -1,8 +1,8 @@ import {datePickerAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import DatePicker from './date-picker.svelte'; -import {getAnatomySelector} from './utils.js'; describe('DatePicker', () => { it.skip.each(getAnatomySelector(datePickerAnatomy))( diff --git a/packages/ui-ingredients/src/tests/dialog.svelte b/packages/ui-ingredients/src/tests/dialog/dialog.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/dialog.svelte rename to packages/ui-ingredients/src/tests/dialog/dialog.svelte diff --git a/packages/ui-ingredients/src/tests/dialog.test.ts b/packages/ui-ingredients/src/tests/dialog/dialog.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/dialog.test.ts rename to packages/ui-ingredients/src/tests/dialog/dialog.test.ts index bcf52ae4..55c2a85c 100644 --- a/packages/ui-ingredients/src/tests/dialog.test.ts +++ b/packages/ui-ingredients/src/tests/dialog/dialog.test.ts @@ -1,8 +1,8 @@ import {dialogAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Dialog from './dialog.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Dialog', () => { it.each(getAnatomySelector(dialogAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/editable.svelte b/packages/ui-ingredients/src/tests/editable/editable.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/editable.svelte rename to packages/ui-ingredients/src/tests/editable/editable.svelte diff --git a/packages/ui-ingredients/src/tests/editable.test.ts b/packages/ui-ingredients/src/tests/editable/editable.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/editable.test.ts rename to packages/ui-ingredients/src/tests/editable/editable.test.ts index a0881778..4d37a613 100644 --- a/packages/ui-ingredients/src/tests/editable.test.ts +++ b/packages/ui-ingredients/src/tests/editable/editable.test.ts @@ -1,8 +1,8 @@ import {editableAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Editable from './editable.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Editable', () => { it.each(getAnatomySelector(editableAnatomy))( diff --git a/packages/ui-ingredients/src/tests/field.svelte b/packages/ui-ingredients/src/tests/field/field.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/field.svelte rename to packages/ui-ingredients/src/tests/field/field.svelte diff --git a/packages/ui-ingredients/src/tests/field.test.ts b/packages/ui-ingredients/src/tests/field/field.test.ts similarity index 91% rename from packages/ui-ingredients/src/tests/field.test.ts rename to packages/ui-ingredients/src/tests/field/field.test.ts index 71819798..df469fbc 100644 --- a/packages/ui-ingredients/src/tests/field.test.ts +++ b/packages/ui-ingredients/src/tests/field/field.test.ts @@ -1,8 +1,8 @@ import {fieldAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Field from './field.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Field', () => { it.each(getAnatomySelector(fieldAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/file-upload.svelte b/packages/ui-ingredients/src/tests/file-upload/file-upload.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/file-upload.svelte rename to packages/ui-ingredients/src/tests/file-upload/file-upload.svelte diff --git a/packages/ui-ingredients/src/tests/file-upload.test.ts b/packages/ui-ingredients/src/tests/file-upload/file-upload.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/file-upload.test.ts rename to packages/ui-ingredients/src/tests/file-upload/file-upload.test.ts index 8762d74a..1fc527a7 100644 --- a/packages/ui-ingredients/src/tests/file-upload.test.ts +++ b/packages/ui-ingredients/src/tests/file-upload/file-upload.test.ts @@ -1,8 +1,8 @@ import {fileUploadAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import FileUpload from './file-upload.svelte'; -import {getAnatomySelector} from './utils.js'; describe('FileUpload', () => { it.each(getAnatomySelector(fileUploadAnatomy))( diff --git a/packages/ui-ingredients/src/tests/hover-card.svelte b/packages/ui-ingredients/src/tests/hover-card/hover-card.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/hover-card.svelte rename to packages/ui-ingredients/src/tests/hover-card/hover-card.svelte diff --git a/packages/ui-ingredients/src/tests/hover-card.test.ts b/packages/ui-ingredients/src/tests/hover-card/hover-card.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/hover-card.test.ts rename to packages/ui-ingredients/src/tests/hover-card/hover-card.test.ts index 8720219e..f3eeb328 100644 --- a/packages/ui-ingredients/src/tests/hover-card.test.ts +++ b/packages/ui-ingredients/src/tests/hover-card/hover-card.test.ts @@ -1,8 +1,8 @@ import {hoverCardAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import HoverCard from './hover-card.svelte'; -import {getAnatomySelector} from './utils.js'; describe('HoverCard', () => { it.each(getAnatomySelector(hoverCardAnatomy))( diff --git a/packages/ui-ingredients/src/tests/menu.svelte b/packages/ui-ingredients/src/tests/menu/menu.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/menu.svelte rename to packages/ui-ingredients/src/tests/menu/menu.svelte diff --git a/packages/ui-ingredients/src/tests/menu.test.ts b/packages/ui-ingredients/src/tests/menu/menu.test.ts similarity index 93% rename from packages/ui-ingredients/src/tests/menu.test.ts rename to packages/ui-ingredients/src/tests/menu/menu.test.ts index f7ac4792..79a6f294 100644 --- a/packages/ui-ingredients/src/tests/menu.test.ts +++ b/packages/ui-ingredients/src/tests/menu/menu.test.ts @@ -1,8 +1,8 @@ import {menuAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Menu from './menu.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {label: 'Item 1', value: '1'}, diff --git a/packages/ui-ingredients/src/tests/number-input.svelte b/packages/ui-ingredients/src/tests/number-input/number-input.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/number-input.svelte rename to packages/ui-ingredients/src/tests/number-input/number-input.svelte diff --git a/packages/ui-ingredients/src/tests/number-input.test.ts b/packages/ui-ingredients/src/tests/number-input/number-input.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/number-input.test.ts rename to packages/ui-ingredients/src/tests/number-input/number-input.test.ts index d1ca5f17..6fcc56c5 100644 --- a/packages/ui-ingredients/src/tests/number-input.test.ts +++ b/packages/ui-ingredients/src/tests/number-input/number-input.test.ts @@ -1,8 +1,8 @@ import {numberInputAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import NumberInput from './number-input.svelte'; -import {getAnatomySelector} from './utils.js'; describe('NumberInput', () => { it.each(getAnatomySelector(numberInputAnatomy))( diff --git a/packages/ui-ingredients/src/tests/pagination.svelte b/packages/ui-ingredients/src/tests/pagination/pagination.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/pagination.svelte rename to packages/ui-ingredients/src/tests/pagination/pagination.svelte diff --git a/packages/ui-ingredients/src/tests/pagination.test.ts b/packages/ui-ingredients/src/tests/pagination/pagination.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/pagination.test.ts rename to packages/ui-ingredients/src/tests/pagination/pagination.test.ts index 31e9cef1..43894dd6 100644 --- a/packages/ui-ingredients/src/tests/pagination.test.ts +++ b/packages/ui-ingredients/src/tests/pagination/pagination.test.ts @@ -1,8 +1,8 @@ import {paginationAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Pagination from './pagination.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Pagination', () => { it.each(getAnatomySelector(paginationAnatomy))( diff --git a/packages/ui-ingredients/src/tests/pin-input.svelte b/packages/ui-ingredients/src/tests/pin-input/pin-input.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/pin-input.svelte rename to packages/ui-ingredients/src/tests/pin-input/pin-input.svelte diff --git a/packages/ui-ingredients/src/tests/pin-input.test.ts b/packages/ui-ingredients/src/tests/pin-input/pin-input.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/pin-input.test.ts rename to packages/ui-ingredients/src/tests/pin-input/pin-input.test.ts index a535d735..9efafff0 100644 --- a/packages/ui-ingredients/src/tests/pin-input.test.ts +++ b/packages/ui-ingredients/src/tests/pin-input/pin-input.test.ts @@ -1,8 +1,8 @@ import {pinInputAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import PinInput from './pin-input.svelte'; -import {getAnatomySelector} from './utils.js'; describe('PinInput', () => { it.each(getAnatomySelector(pinInputAnatomy))( diff --git a/packages/ui-ingredients/src/tests/popover.svelte b/packages/ui-ingredients/src/tests/popover/popover.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/popover.svelte rename to packages/ui-ingredients/src/tests/popover/popover.svelte diff --git a/packages/ui-ingredients/src/tests/popover.test.ts b/packages/ui-ingredients/src/tests/popover/popover.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/popover.test.ts rename to packages/ui-ingredients/src/tests/popover/popover.test.ts index 837476c4..78269a09 100644 --- a/packages/ui-ingredients/src/tests/popover.test.ts +++ b/packages/ui-ingredients/src/tests/popover/popover.test.ts @@ -1,8 +1,8 @@ import {popoverAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Popover from './popover.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Popover', () => { it.each(getAnatomySelector(popoverAnatomy))( diff --git a/packages/ui-ingredients/src/tests/progress.svelte b/packages/ui-ingredients/src/tests/progress/progress.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/progress.svelte rename to packages/ui-ingredients/src/tests/progress/progress.svelte diff --git a/packages/ui-ingredients/src/tests/progress.test.ts b/packages/ui-ingredients/src/tests/progress/progress.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/progress.test.ts rename to packages/ui-ingredients/src/tests/progress/progress.test.ts index 80992ae6..20ea8cc7 100644 --- a/packages/ui-ingredients/src/tests/progress.test.ts +++ b/packages/ui-ingredients/src/tests/progress/progress.test.ts @@ -1,8 +1,8 @@ import {progressAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Progress from './progress.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Progress', () => { it.each(getAnatomySelector(progressAnatomy))( diff --git a/packages/ui-ingredients/src/tests/qr-code.svelte b/packages/ui-ingredients/src/tests/qr-code/qr-code.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/qr-code.svelte rename to packages/ui-ingredients/src/tests/qr-code/qr-code.svelte diff --git a/packages/ui-ingredients/src/tests/qr-code.test.ts b/packages/ui-ingredients/src/tests/qr-code/qr-code.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/qr-code.test.ts rename to packages/ui-ingredients/src/tests/qr-code/qr-code.test.ts index bb56660b..1cb8bdb6 100644 --- a/packages/ui-ingredients/src/tests/qr-code.test.ts +++ b/packages/ui-ingredients/src/tests/qr-code/qr-code.test.ts @@ -1,8 +1,8 @@ import {qrCodeAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import QrCode from './qr-code.svelte'; -import {getAnatomySelector} from './utils.js'; describe('QrCode', () => { it.each(getAnatomySelector(qrCodeAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/radio-group.svelte b/packages/ui-ingredients/src/tests/radio-group/radio-group.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/radio-group.svelte rename to packages/ui-ingredients/src/tests/radio-group/radio-group.svelte diff --git a/packages/ui-ingredients/src/tests/radio-group.test.ts b/packages/ui-ingredients/src/tests/radio-group/radio-group.test.ts similarity index 94% rename from packages/ui-ingredients/src/tests/radio-group.test.ts rename to packages/ui-ingredients/src/tests/radio-group/radio-group.test.ts index 4f4a9a19..a34ec53a 100644 --- a/packages/ui-ingredients/src/tests/radio-group.test.ts +++ b/packages/ui-ingredients/src/tests/radio-group/radio-group.test.ts @@ -1,8 +1,8 @@ import {radioGroupAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import RadioGroup from './radio-group.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {value: '1', label: 'Item 1'}, diff --git a/packages/ui-ingredients/src/tests/rating-group.svelte b/packages/ui-ingredients/src/tests/rating-group/rating-group.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/rating-group.svelte rename to packages/ui-ingredients/src/tests/rating-group/rating-group.svelte diff --git a/packages/ui-ingredients/src/tests/rating-group.test.ts b/packages/ui-ingredients/src/tests/rating-group/rating-group.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/rating-group.test.ts rename to packages/ui-ingredients/src/tests/rating-group/rating-group.test.ts index 79c1f544..0e6cbb0d 100644 --- a/packages/ui-ingredients/src/tests/rating-group.test.ts +++ b/packages/ui-ingredients/src/tests/rating-group/rating-group.test.ts @@ -1,8 +1,8 @@ import {ratingGroupAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import RatingGroup from './rating-group.svelte'; -import {getAnatomySelector} from './utils.js'; describe('RatingGroup', () => { it.each(getAnatomySelector(ratingGroupAnatomy))( diff --git a/packages/ui-ingredients/src/tests/segment-group.svelte b/packages/ui-ingredients/src/tests/segment-group/segment-group.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/segment-group.svelte rename to packages/ui-ingredients/src/tests/segment-group/segment-group.svelte diff --git a/packages/ui-ingredients/src/tests/segment-group.test.ts b/packages/ui-ingredients/src/tests/segment-group/segment-group.test.ts similarity index 94% rename from packages/ui-ingredients/src/tests/segment-group.test.ts rename to packages/ui-ingredients/src/tests/segment-group/segment-group.test.ts index 751299cd..07950634 100644 --- a/packages/ui-ingredients/src/tests/segment-group.test.ts +++ b/packages/ui-ingredients/src/tests/segment-group/segment-group.test.ts @@ -1,8 +1,8 @@ import {segmentGroupAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import SegmentGroup from './segment-group.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {value: '1', label: 'Item 1'}, diff --git a/packages/ui-ingredients/src/tests/select.svelte b/packages/ui-ingredients/src/tests/select/select.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/select.svelte rename to packages/ui-ingredients/src/tests/select/select.svelte diff --git a/packages/ui-ingredients/src/tests/select.test.ts b/packages/ui-ingredients/src/tests/select/select.test.ts similarity index 94% rename from packages/ui-ingredients/src/tests/select.test.ts rename to packages/ui-ingredients/src/tests/select/select.test.ts index b60d924f..5147cb1b 100644 --- a/packages/ui-ingredients/src/tests/select.test.ts +++ b/packages/ui-ingredients/src/tests/select/select.test.ts @@ -1,8 +1,8 @@ import {selectAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Select from './select.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ {value: '1', label: 'Option 1'}, diff --git a/packages/ui-ingredients/src/tests/signature-pad.svelte b/packages/ui-ingredients/src/tests/signature-pad/signature-pad.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/signature-pad.svelte rename to packages/ui-ingredients/src/tests/signature-pad/signature-pad.svelte diff --git a/packages/ui-ingredients/src/tests/signature-pad.test.ts b/packages/ui-ingredients/src/tests/signature-pad/signature-pad.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/signature-pad.test.ts rename to packages/ui-ingredients/src/tests/signature-pad/signature-pad.test.ts index a5ddade4..973f57a0 100644 --- a/packages/ui-ingredients/src/tests/signature-pad.test.ts +++ b/packages/ui-ingredients/src/tests/signature-pad/signature-pad.test.ts @@ -1,8 +1,8 @@ import {signaturePadAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import SignaturePad from './signature-pad.svelte'; -import {getAnatomySelector} from './utils.js'; describe('SignaturePad', () => { it.each(getAnatomySelector(signaturePadAnatomy))( diff --git a/packages/ui-ingredients/src/tests/slider.svelte b/packages/ui-ingredients/src/tests/slider/slider.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/slider.svelte rename to packages/ui-ingredients/src/tests/slider/slider.svelte diff --git a/packages/ui-ingredients/src/tests/slider.test.ts b/packages/ui-ingredients/src/tests/slider/slider.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/slider.test.ts rename to packages/ui-ingredients/src/tests/slider/slider.test.ts index cd5dc21c..c14a0358 100644 --- a/packages/ui-ingredients/src/tests/slider.test.ts +++ b/packages/ui-ingredients/src/tests/slider/slider.test.ts @@ -1,8 +1,8 @@ import {sliderAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Slider from './slider.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Slider', () => { it.each(getAnatomySelector(sliderAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/splitter.svelte b/packages/ui-ingredients/src/tests/splitter/splitter.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/splitter.svelte rename to packages/ui-ingredients/src/tests/splitter/splitter.svelte diff --git a/packages/ui-ingredients/src/tests/splitter.test.ts b/packages/ui-ingredients/src/tests/splitter/splitter.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/splitter.test.ts rename to packages/ui-ingredients/src/tests/splitter/splitter.test.ts index 53329a71..185a26a3 100644 --- a/packages/ui-ingredients/src/tests/splitter.test.ts +++ b/packages/ui-ingredients/src/tests/splitter/splitter.test.ts @@ -1,8 +1,8 @@ import {splitterAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Splitter from './splitter.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Splitter', () => { it.each(getAnatomySelector(splitterAnatomy))( diff --git a/packages/ui-ingredients/src/tests/steps.svelte b/packages/ui-ingredients/src/tests/steps/steps.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/steps.svelte rename to packages/ui-ingredients/src/tests/steps/steps.svelte diff --git a/packages/ui-ingredients/src/tests/steps.test.ts b/packages/ui-ingredients/src/tests/steps/steps.test.ts similarity index 77% rename from packages/ui-ingredients/src/tests/steps.test.ts rename to packages/ui-ingredients/src/tests/steps/steps.test.ts index acea49e5..59bc4099 100644 --- a/packages/ui-ingredients/src/tests/steps.test.ts +++ b/packages/ui-ingredients/src/tests/steps/steps.test.ts @@ -1,8 +1,8 @@ -import { stepsAnatomy } from '$lib/index.js'; -import { render } from '@testing-library/svelte'; -import { axe } from 'vitest-axe'; +import {stepsAnatomy} from '$lib/index.js'; +import {render} from '@testing-library/svelte'; +import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Steps from './steps.svelte'; -import { getAnatomySelector } from './utils.js'; const items = [ {title: 'Step 1', content: 'Step 1 Content'}, diff --git a/packages/ui-ingredients/src/tests/switch.svelte b/packages/ui-ingredients/src/tests/switch/switch.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/switch.svelte rename to packages/ui-ingredients/src/tests/switch/switch.svelte diff --git a/packages/ui-ingredients/src/tests/switch.test.ts b/packages/ui-ingredients/src/tests/switch/switch.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/switch.test.ts rename to packages/ui-ingredients/src/tests/switch/switch.test.ts index c18788a5..5b85e05b 100644 --- a/packages/ui-ingredients/src/tests/switch.test.ts +++ b/packages/ui-ingredients/src/tests/switch/switch.test.ts @@ -1,8 +1,8 @@ import {switchAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Switch from './switch.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Switch', () => { it.each(getAnatomySelector(switchAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/tabs.svelte b/packages/ui-ingredients/src/tests/tabs/tabs.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/tabs.svelte rename to packages/ui-ingredients/src/tests/tabs/tabs.svelte diff --git a/packages/ui-ingredients/src/tests/tabs.test.ts b/packages/ui-ingredients/src/tests/tabs/tabs.test.ts similarity index 95% rename from packages/ui-ingredients/src/tests/tabs.test.ts rename to packages/ui-ingredients/src/tests/tabs/tabs.test.ts index e7fc2e18..1bb2f6d6 100644 --- a/packages/ui-ingredients/src/tests/tabs.test.ts +++ b/packages/ui-ingredients/src/tests/tabs/tabs.test.ts @@ -2,8 +2,8 @@ import {tabsAnatomy} from '$lib/index.js'; import {faker} from '@faker-js/faker'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Tabs from './tabs.svelte'; -import {getAnatomySelector} from './utils.js'; const items = [ { diff --git a/packages/ui-ingredients/src/tests/tags-input.svelte b/packages/ui-ingredients/src/tests/tags-input/tags-input.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/tags-input.svelte rename to packages/ui-ingredients/src/tests/tags-input/tags-input.svelte diff --git a/packages/ui-ingredients/src/tests/tags-input.test.ts b/packages/ui-ingredients/src/tests/tags-input/tags-input.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/tags-input.test.ts rename to packages/ui-ingredients/src/tests/tags-input/tags-input.test.ts index fe45bd8c..7773d87e 100644 --- a/packages/ui-ingredients/src/tests/tags-input.test.ts +++ b/packages/ui-ingredients/src/tests/tags-input/tags-input.test.ts @@ -1,8 +1,8 @@ import {tagsInputAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import TagsInput from './tags-input.svelte'; -import {getAnatomySelector} from './utils.js'; describe('TagsInput', () => { it.each(getAnatomySelector(tagsInputAnatomy))( diff --git a/packages/ui-ingredients/src/tests/time-picker.svelte b/packages/ui-ingredients/src/tests/time-picker/time-picker.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/time-picker.svelte rename to packages/ui-ingredients/src/tests/time-picker/time-picker.svelte diff --git a/packages/ui-ingredients/src/tests/time-picker.test.ts b/packages/ui-ingredients/src/tests/time-picker/time-picker.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/time-picker.test.ts rename to packages/ui-ingredients/src/tests/time-picker/time-picker.test.ts index 99290506..841b4478 100644 --- a/packages/ui-ingredients/src/tests/time-picker.test.ts +++ b/packages/ui-ingredients/src/tests/time-picker/time-picker.test.ts @@ -1,8 +1,8 @@ import {timePickerAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import TimePicker from './time-picker.svelte'; -import {getAnatomySelector} from './utils.js'; describe('TimePicker', () => { it.each(getAnatomySelector(timePickerAnatomy))( diff --git a/packages/ui-ingredients/src/tests/timer.svelte b/packages/ui-ingredients/src/tests/timer/timer.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/timer.svelte rename to packages/ui-ingredients/src/tests/timer/timer.svelte diff --git a/packages/ui-ingredients/src/tests/timer.test.ts b/packages/ui-ingredients/src/tests/timer/timer.test.ts similarity index 91% rename from packages/ui-ingredients/src/tests/timer.test.ts rename to packages/ui-ingredients/src/tests/timer/timer.test.ts index a56cc53c..7baaa89f 100644 --- a/packages/ui-ingredients/src/tests/timer.test.ts +++ b/packages/ui-ingredients/src/tests/timer/timer.test.ts @@ -1,8 +1,8 @@ import {timerAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Timer from './timer.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Timer', () => { it.each(getAnatomySelector(timerAnatomy))('should render %s', (selector) => { diff --git a/packages/ui-ingredients/src/tests/toast/toast.svelte b/packages/ui-ingredients/src/tests/toast/toast.svelte new file mode 100644 index 00000000..4dd77069 --- /dev/null +++ b/packages/ui-ingredients/src/tests/toast/toast.svelte @@ -0,0 +1,27 @@ + + + + + + + + + Close + Action + + diff --git a/packages/ui-ingredients/src/tests/toast/toast.test.ts b/packages/ui-ingredients/src/tests/toast/toast.test.ts new file mode 100644 index 00000000..96238816 --- /dev/null +++ b/packages/ui-ingredients/src/tests/toast/toast.test.ts @@ -0,0 +1,35 @@ +import {toastAnatomy} from '$lib/index.js'; +import {render} from '@testing-library/svelte'; +import {userEvent} from '@testing-library/user-event'; +import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; +import Toast from './toast.svelte'; + +describe('Toast', () => { + it.each(getAnatomySelector(toastAnatomy))( + 'should render %s', + async (selector) => { + const {getByRole} = render(Toast); + + const user = userEvent.setup(); + const trigger = getByRole('button', {name: 'Create toast'}); + + await user.click(trigger); + + expect(document.querySelector(selector)).toBeInTheDocument(); + }, + ); + + it('should have no a11y violations', async () => { + const {container, getByRole} = render(Toast); + + const user = userEvent.setup(); + const trigger = getByRole('button', {name: 'Create toast'}); + + await user.click(trigger); + + const results = await axe(container); + + expect(results).toHaveNoViolations(); + }); +}); diff --git a/packages/ui-ingredients/src/tests/toggle-group.svelte b/packages/ui-ingredients/src/tests/toggle-group/toggle-group.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/toggle-group.svelte rename to packages/ui-ingredients/src/tests/toggle-group/toggle-group.svelte diff --git a/packages/ui-ingredients/src/tests/toggle-group.test.ts b/packages/ui-ingredients/src/tests/toggle-group/toggle-group.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/toggle-group.test.ts rename to packages/ui-ingredients/src/tests/toggle-group/toggle-group.test.ts index 7416fc7e..f347c8ea 100644 --- a/packages/ui-ingredients/src/tests/toggle-group.test.ts +++ b/packages/ui-ingredients/src/tests/toggle-group/toggle-group.test.ts @@ -1,8 +1,8 @@ import {toggleGroupAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import ToggleGroup from './toggle-group.svelte'; -import {getAnatomySelector} from './utils.js'; describe('ToggleGroup', () => { it.each(getAnatomySelector(toggleGroupAnatomy))( diff --git a/packages/ui-ingredients/src/tests/tooltip.svelte b/packages/ui-ingredients/src/tests/tooltip/tooltip.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/tooltip.svelte rename to packages/ui-ingredients/src/tests/tooltip/tooltip.svelte diff --git a/packages/ui-ingredients/src/tests/tooltip.test.ts b/packages/ui-ingredients/src/tests/tooltip/tooltip.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/tooltip.test.ts rename to packages/ui-ingredients/src/tests/tooltip/tooltip.test.ts index fc87ec73..cfc15bb2 100644 --- a/packages/ui-ingredients/src/tests/tooltip.test.ts +++ b/packages/ui-ingredients/src/tests/tooltip/tooltip.test.ts @@ -1,8 +1,8 @@ import {tooltipAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import Tooltip from './tooltip.svelte'; -import {getAnatomySelector} from './utils.js'; describe('Tooltip', () => { it.each(getAnatomySelector(tooltipAnatomy))( diff --git a/packages/ui-ingredients/src/tests/tree-view.svelte b/packages/ui-ingredients/src/tests/tree-view/tree-view.svelte similarity index 100% rename from packages/ui-ingredients/src/tests/tree-view.svelte rename to packages/ui-ingredients/src/tests/tree-view/tree-view.svelte diff --git a/packages/ui-ingredients/src/tests/tree-view.test.ts b/packages/ui-ingredients/src/tests/tree-view/tree-view.test.ts similarity index 92% rename from packages/ui-ingredients/src/tests/tree-view.test.ts rename to packages/ui-ingredients/src/tests/tree-view/tree-view.test.ts index 3504b488..c608a5b7 100644 --- a/packages/ui-ingredients/src/tests/tree-view.test.ts +++ b/packages/ui-ingredients/src/tests/tree-view/tree-view.test.ts @@ -1,8 +1,8 @@ import {treeViewAnatomy} from '$lib/index.js'; import {render} from '@testing-library/svelte'; import {axe} from 'vitest-axe'; +import {getAnatomySelector} from '../utils.js'; import TreeView from './tree-view.svelte'; -import {getAnatomySelector} from './utils.js'; describe('TreeView', () => { it.each(getAnatomySelector(treeViewAnatomy))( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62bf0e5d..ca622cb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -207,6 +207,9 @@ importers: '@testing-library/svelte': specifier: 5.2.3 version: 5.2.3(svelte@5.0.0-next.260)(vite@5.4.8(@types/node@22.5.5))(vitest@2.1.1(@types/node@22.5.5)(jsdom@25.0.1)) + '@testing-library/user-event': + specifier: 14.5.2 + version: 14.5.2(@testing-library/dom@10.4.0) '@types/jsdom': specifier: 21.1.7 version: 21.1.7 @@ -769,6 +772,12 @@ packages: vitest: optional: true + '@testing-library/user-event@14.5.2': + resolution: {integrity: sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==} + engines: {node: '>=12', npm: '>=6'} + peerDependencies: + '@testing-library/dom': '>=7.21.4' + '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} @@ -3916,6 +3925,10 @@ snapshots: vite: 5.4.8(@types/node@22.5.5) vitest: 2.1.1(@types/node@22.5.5)(jsdom@25.0.1) + '@testing-library/user-event@14.5.2(@testing-library/dom@10.4.0)': + dependencies: + '@testing-library/dom': 10.4.0 + '@tootallnate/quickjs-emscripten@0.23.0': {} '@types/aria-query@5.0.4': {}