From 39452e9b7e9934164bed89165070396406a342ec Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 12 Jun 2026 11:54:08 +0200 Subject: [PATCH 01/17] [chore] added snapshots --- .../__snapshots__/index.test.tsx.snap | 175 ++++++++++++++++ semcore/add-filter/__tests__/index.test.tsx | 44 ++++ .../__snapshots__/index.test.tsx.snap | 13 ++ semcore/badge/__tests__/index.test.tsx | 14 ++ .../__snapshots__/index.test.tsx.snap | 167 ++++++++++++++++ semcore/base-trigger/__tests__/index.test.tsx | 71 ++++++- .../__snapshots__/index.test.tsx.snap | 88 ++++++++ semcore/breadcrumbs/__tests__/index.test.tsx | 26 ++- .../__snapshots__/index.test.tsx.snap | 103 ++++++++++ .../bulk-textarea/__tests__/index.test.tsx | 23 +++ .../__snapshots__/index.test.tsx.snap | 53 +++++ semcore/button/__tests__/index.test.tsx | 35 +++- .../__snapshots__/index.test.tsx.snap | 31 +++ semcore/card/__tests__/index.test.tsx | 30 ++- .../__snapshots__/index.test.tsx.snap | 108 ++++++++++ semcore/carousel/__tests__/index.test.tsx | 15 ++ .../__snapshots__/index.test.tsx.snap | 26 +++ semcore/checkbox/__tests__/index.test.tsx | 18 ++ .../__snapshots__/index.test.tsx.snap | 188 ++++++++++++++++++ semcore/color-picker/__tests__/index.test.tsx | 21 ++ .../__snapshots__/index.test.tsx.snap | 18 ++ semcore/counter/__tests__/index.test.tsx | 20 +- .../__snapshots__/index.test.tsx.snap | 13 ++ semcore/divider/__tests__/index.test.tsx | 20 +- .../__snapshots__/index.test.tsx.snap | 13 ++ semcore/dot/__tests__/index.test.tsx | 14 +- 26 files changed, 1336 insertions(+), 11 deletions(-) create mode 100644 semcore/add-filter/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/badge/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/base-trigger/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/breadcrumbs/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/bulk-textarea/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/button/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/card/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/carousel/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/checkbox/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/color-picker/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/counter/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/divider/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/dot/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/add-filter/__tests__/__snapshots__/index.test.tsx.snap b/semcore/add-filter/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..056c7761fe --- /dev/null +++ b/semcore/add-filter/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,175 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AddFilter > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "AddFilterInput.Value", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "AddFilter.Input", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "FilterTrigger.Text", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "FilterTrigger.TriggerButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.TriggerButton", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "FilterTrigger.Addon", + }, + ], + "uiName": "FilterTrigger.ClearButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.ClearButton", + }, + ], + "uiName": "AddFilterSelect.Trigger", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "AddFilterSelect.Option", + }, + ], + "uiName": null, + }, + ], + "uiName": "ScrollArea.Container", + }, + ], + "uiName": "AddFilterSelect.Menu", + }, + ], + "uiName": "Select.Popper", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "FilterTrigger.Text", + }, + ], + "uiName": "FilterTrigger.TriggerButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.TriggerButton", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "FilterTrigger.Addon", + }, + ], + "uiName": "FilterTrigger.ClearButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.ClearButton", + }, + ], + "uiName": "AddFilterDropdown.Trigger", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": "AddFilterDropdown.Popper", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "AddFilter", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/add-filter/__tests__/index.test.tsx b/semcore/add-filter/__tests__/index.test.tsx index d87ad43b60..73bed93fb6 100644 --- a/semcore/add-filter/__tests__/index.test.tsx +++ b/semcore/add-filter/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, waitFor, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -22,6 +23,49 @@ describe('AddFilter', (test) => { window.IntersectionObserver = mockIntersectionObserver; }); + test('Verify data-ui-name', () => { + const addFilter = ( + {}} + > + + + + + + + + Blue + + + + + {}}> + Keywords + + + Dropdown content + + + + ); + + const { container } = render(addFilter); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('should render two menuitems in dropdown with displayName as text', async () => { const { queryByText, getByText } = render( {}}> diff --git a/semcore/badge/__tests__/__snapshots__/index.test.tsx.snap b/semcore/badge/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..e33f9a926e --- /dev/null +++ b/semcore/badge/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Badge > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [], + "uiName": "Badge", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/badge/__tests__/index.test.tsx b/semcore/badge/__tests__/index.test.tsx index 8ecc713110..591fe08a93 100644 --- a/semcore/badge/__tests__/index.test.tsx +++ b/semcore/badge/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup } from '@semcore/testing-utils/testing-library'; import { describe, test, expect, beforeEach, vi, afterEach } from '@semcore/testing-utils/vitest'; @@ -9,6 +10,19 @@ describe('Badge Dependency imports', () => { runDependencyCheckTests('badge'); }); +describe('Badge', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const badge = ; + + const { container } = render(badge); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + describe('Badge backward compatibility (deprecated props)', () => { beforeEach(cleanup); diff --git a/semcore/base-trigger/__tests__/__snapshots__/index.test.tsx.snap b/semcore/base-trigger/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..8e3e9bbaec --- /dev/null +++ b/semcore/base-trigger/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,167 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`BaseTrigger > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "BaseTrigger.Addon", + }, + { + "children": [], + "uiName": "BaseTrigger.Text", + }, + ], + "uiName": "BaseTrigger.InnerTriggerWrapper", + }, + ], + "uiName": "BaseTrigger", + }, + ], + "uiName": null, +} +`; + +exports[`ButtonTrigger > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ButtonTrigger.Addon", + }, + { + "children": [], + "uiName": "ButtonTrigger.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "ButtonTrigger.Addon", + }, + ], + "uiName": "ButtonTrigger.InnerTriggerWrapper", + }, + ], + "uiName": "ButtonTrigger", + }, + ], + "uiName": null, +} +`; + +exports[`FilterTrigger > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "FilterTrigger.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": null, + }, + ], + "uiName": "FilterTrigger.Counter", + }, + ], + "uiName": "FilterTrigger.TriggerButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.TriggerButton", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "FilterTrigger.Addon", + }, + ], + "uiName": "FilterTrigger.ClearButton.InnerTriggerWrapper", + }, + ], + "uiName": "FilterTrigger.ClearButton", + }, + ], + "uiName": "FilterTrigger", + }, + ], + "uiName": null, +} +`; + +exports[`LinkTrigger > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "LinkTrigger.Addon", + }, + { + "children": [], + "uiName": "LinkTrigger.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "LinkTrigger.Addon", + }, + ], + "uiName": "LinkTrigger.InnerWrapper", + }, + ], + "uiName": "LinkTrigger", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/base-trigger/__tests__/index.test.tsx b/semcore/base-trigger/__tests__/index.test.tsx index f9fac0758c..dc6c53b3b1 100644 --- a/semcore/base-trigger/__tests__/index.test.tsx +++ b/semcore/base-trigger/__tests__/index.test.tsx @@ -1,17 +1,50 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach } from '@semcore/testing-utils/vitest'; import React from 'react'; -import { ButtonTrigger } from '../src'; +import BaseTrigger, { ButtonTrigger, FilterTrigger, LinkTrigger } from '../src'; describe('BaseTrigger Dependency imports', () => { runDependencyCheckTests('base-trigger'); }); +describe('BaseTrigger', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const baseTrigger = ( + + + + + ); + + const { container } = render(baseTrigger); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + describe('ButtonTrigger', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const buttonTrigger = ( + + + + + ); + + const { container } = render(buttonTrigger); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Should work as button with labels', async () => { const component = ( <> @@ -29,3 +62,39 @@ describe('ButtonTrigger', () => { expect(getByTestId('buttonTrigger')).toHaveFocus(); }); }); + +describe('LinkTrigger', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const linkTrigger = ( + + + + + ); + + const { container } = render(linkTrigger); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + +describe('FilterTrigger', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const filterTrigger = ( + {}}> + Filter trigger + + + ); + + const { container } = render(filterTrigger); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/breadcrumbs/__tests__/__snapshots__/index.test.tsx.snap b/semcore/breadcrumbs/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..c16f9dca96 --- /dev/null +++ b/semcore/breadcrumbs/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,88 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Breadcrumbs > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Breadcrumbs.Item", + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronRight", + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": "Breadcrumbs.Item", + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronRight", + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": "Breadcrumbs.Item", + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronRight", + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "Breadcrumbs", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/breadcrumbs/__tests__/index.test.tsx b/semcore/breadcrumbs/__tests__/index.test.tsx index fab8427ac6..1c57d90133 100644 --- a/semcore/breadcrumbs/__tests__/index.test.tsx +++ b/semcore/breadcrumbs/__tests__/index.test.tsx @@ -1,6 +1,30 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import Breadcrumbs from '../src'; describe('breadcrumbs Dependency imports', () => { runDependencyCheckTests('breadcrumbs'); }); + +describe('Breadcrumbs', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const breadcrumbs = ( + + Home + Projects + Current project + + ); + + const { container } = render(breadcrumbs); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/bulk-textarea/__tests__/__snapshots__/index.test.tsx.snap b/semcore/bulk-textarea/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..0eae2ec18d --- /dev/null +++ b/semcore/bulk-textarea/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,103 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`BulkTextarea OnChange > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": null, + }, + ], + "uiName": "BulkTextarea.Counter", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "BulkTextarea.InputField", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronUp", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + { + "children": [], + "uiName": "Text", + }, + ], + "uiName": "Flex", + }, + ], + "uiName": "BulkTextarea", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/bulk-textarea/__tests__/index.test.tsx b/semcore/bulk-textarea/__tests__/index.test.tsx index 89bd747cae..5b24148fb8 100644 --- a/semcore/bulk-textarea/__tests__/index.test.tsx +++ b/semcore/bulk-textarea/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, userEvent, cleanup, waitFor } from '@semcore/testing-utils/testing-library'; import { describe, test, vi, assertType, expect, afterEach, beforeEach } from '@semcore/testing-utils/vitest'; @@ -16,6 +17,28 @@ describe('BulkTextarea OnChange', () => { afterEach(() => { cleanup(); }); + + test('Verify data-ui-name', () => { + const bulkTextarea = ( + + + + + + + ); + + const { container } = render(bulkTextarea); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify value&onChange relation', () => { assertType( { }} />); assertType( { }} />); diff --git a/semcore/button/__tests__/__snapshots__/index.test.tsx.snap b/semcore/button/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..9931f394d8 --- /dev/null +++ b/semcore/button/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,53 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Button > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Addon", + }, + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": null, +} +`; + +exports[`ButtonLink > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ButtonLink.Addon", + }, + { + "children": [], + "uiName": "ButtonLink.Text", + }, + ], + "uiName": "ButtonLink.InnerWrapper", + }, + ], + "uiName": "ButtonLink", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/button/__tests__/index.test.tsx b/semcore/button/__tests__/index.test.tsx index b1e25288cf..1be2bc70d8 100644 --- a/semcore/button/__tests__/index.test.tsx +++ b/semcore/button/__tests__/index.test.tsx @@ -1,10 +1,11 @@ import Link from '@semcore/link'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { beforeEach, expect, test, describe, vi } from '@semcore/testing-utils/vitest'; import React from 'react'; -import Button, { } from '../src'; +import Button, { ButtonLink } from '../src'; describe('Button Dependency imports', () => { runDependencyCheckTests('button'); @@ -13,6 +14,20 @@ describe('Button Dependency imports', () => { describe('Button', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const button = ( + + ); + + const { container } = render(button); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify supports user click handler', async () => { const spy = vi.fn(); const { getByTestId } = render( @@ -73,3 +88,21 @@ describe('Button', () => { expect((buttonElement?.attributes as any)['aria-busy'].value).toBe('true'); }); }); + +describe('ButtonLink', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const buttonLink = ( + + + + + ); + + const { container } = render(buttonLink); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/card/__tests__/__snapshots__/index.test.tsx.snap b/semcore/card/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..fd5fb32925 --- /dev/null +++ b/semcore/card/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,31 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Card > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Card.Title", + }, + { + "children": [], + "uiName": "Card.Description", + }, + ], + "uiName": "Card.Header", + }, + { + "children": [], + "uiName": "Card.Body", + }, + ], + "uiName": "Card", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/card/__tests__/index.test.tsx b/semcore/card/__tests__/index.test.tsx index bb5c5dd01e..479fc31fb6 100644 --- a/semcore/card/__tests__/index.test.tsx +++ b/semcore/card/__tests__/index.test.tsx @@ -1,6 +1,34 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import Card from '../src'; describe('Card Dependency imports', () => { runDependencyCheckTests('card'); }); + +describe('Card', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const card = ( + + + Card title + Card description + + + Card body + + + ); + + const { container } = render(card); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/carousel/__tests__/__snapshots__/index.test.tsx.snap b/semcore/carousel/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..9a58a738a6 --- /dev/null +++ b/semcore/carousel/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,108 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Carousel > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronLeft", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": "Carousel.Prev", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Carousel.Item", + }, + { + "children": [], + "uiName": "Carousel.Item", + }, + ], + "uiName": "Carousel.Container", + }, + ], + "uiName": "Carousel.ContentBox", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronRight", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": "Carousel.Next", + }, + ], + "uiName": "Flex", + }, + { + "children": [ + { + "children": [], + "uiName": "Carousel.Indicator", + }, + { + "children": [], + "uiName": "Carousel.Indicator", + }, + ], + "uiName": "Carousel.Indicators", + }, + ], + "uiName": "Carousel", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/carousel/__tests__/index.test.tsx b/semcore/carousel/__tests__/index.test.tsx index 3bcf861670..4ca50c1de1 100644 --- a/semcore/carousel/__tests__/index.test.tsx +++ b/semcore/carousel/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -20,6 +21,20 @@ const Items = () => ( describe('Carousel', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const carousel = ( + + + + + ); + + const { container } = render(carousel); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify control mode', () => { const spy = vi.fn(); diff --git a/semcore/checkbox/__tests__/__snapshots__/index.test.tsx.snap b/semcore/checkbox/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..9dc1436085 --- /dev/null +++ b/semcore/checkbox/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,26 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Checkbox > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Checkbox.Value", + }, + { + "children": [], + "uiName": "Value.CheckMark", + }, + { + "children": [], + "uiName": "Checkbox.Text", + }, + ], + "uiName": "Checkbox", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/checkbox/__tests__/index.test.tsx b/semcore/checkbox/__tests__/index.test.tsx index 9e27979694..04a9e68b86 100644 --- a/semcore/checkbox/__tests__/index.test.tsx +++ b/semcore/checkbox/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,23 @@ describe('Checkbox Dependency imports', () => { describe('Checkbox', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const checkbox = ( + + + + + + + + ); + + const { container } = render(checkbox); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent( 'Verify Control has aria-label, aria-labelledby, aria-describedby from root', async () => { diff --git a/semcore/color-picker/__tests__/__snapshots__/index.test.tsx.snap b/semcore/color-picker/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..0fa2b75789 --- /dev/null +++ b/semcore/color-picker/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,188 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ColorPicker > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Flex", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "ColorPicker.Trigger", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ColorPicker.Item", + }, + { + "children": [], + "uiName": "ColorPicker.Item", + }, + ], + "uiName": "ColorPicker.Colors", + }, + { + "children": [], + "uiName": "Divider", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": "PaletteManager.Item", + }, + ], + "uiName": "PaletteManager.Colors", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "MathPlus", + }, + ], + "uiName": null, + }, + ], + "uiName": "Flex", + }, + { + "children": [ + { + "children": [], + "uiName": "Box", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "PaletteManager.InputColor", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Check", + }, + ], + "uiName": "ButtonLink.Addon", + }, + ], + "uiName": "Input.Addon.InnerWrapper", + }, + ], + "uiName": "Input.Addon", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "ButtonLink.Addon", + }, + ], + "uiName": "Input.Addon.InnerWrapper", + }, + ], + "uiName": "Input.Addon", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Input", + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "Box", + }, + ], + "uiName": "ColorPicker.Popper", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, +} +`; diff --git a/semcore/color-picker/__tests__/index.test.tsx b/semcore/color-picker/__tests__/index.test.tsx index 7aa63e9c0b..a7c2a8353c 100644 --- a/semcore/color-picker/__tests__/index.test.tsx +++ b/semcore/color-picker/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,26 @@ describe('color-picker Dependency imports', () => { describe('ColorPicker', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const colorPicker = ( + + + + + + + + + + + ); + + const { container } = render(colorPicker); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Verify call onChange once function when click on item color', async () => { const value = '#2BB3FF'; const spy = vi.fn(); diff --git a/semcore/counter/__tests__/__snapshots__/index.test.tsx.snap b/semcore/counter/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..22dcf38fd8 --- /dev/null +++ b/semcore/counter/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,18 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Counter > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Counter", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/counter/__tests__/index.test.tsx b/semcore/counter/__tests__/index.test.tsx index af56cb1bb8..1b7e0117a2 100644 --- a/semcore/counter/__tests__/index.test.tsx +++ b/semcore/counter/__tests__/index.test.tsx @@ -1,6 +1,24 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import Counter from '../src'; describe('Counter Dependency imports', () => { runDependencyCheckTests('counter'); }); + +describe('Counter', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const counter = 42; + + const { container } = render(counter); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/divider/__tests__/__snapshots__/index.test.tsx.snap b/semcore/divider/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..b78bf1ebba --- /dev/null +++ b/semcore/divider/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Divider > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [], + "uiName": "Divider", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/divider/__tests__/index.test.tsx b/semcore/divider/__tests__/index.test.tsx index ba4e65e709..9568c04a7a 100644 --- a/semcore/divider/__tests__/index.test.tsx +++ b/semcore/divider/__tests__/index.test.tsx @@ -1,6 +1,24 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import Divider from '../src'; describe('Divider Dependency imports', () => { runDependencyCheckTests('divider'); }); + +describe('Divider', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const divider = ; + + const { container } = render(divider); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/dot/__tests__/__snapshots__/index.test.tsx.snap b/semcore/dot/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..4278a2b46f --- /dev/null +++ b/semcore/dot/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Dot > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [], + "uiName": "Dot", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/dot/__tests__/index.test.tsx b/semcore/dot/__tests__/index.test.tsx index 510be3b945..a093cc1f4e 100644 --- a/semcore/dot/__tests__/index.test.tsx +++ b/semcore/dot/__tests__/index.test.tsx @@ -1,7 +1,8 @@ import Button from '@semcore/button'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render } from '@semcore/testing-utils/testing-library'; -import { expect, test, describe, beforeEach, vi, afterEach } from '@semcore/testing-utils/vitest'; +import { expect, test, describe, beforeEach } from '@semcore/testing-utils/vitest'; import React from 'react'; import Dot from '../src'; @@ -13,12 +14,15 @@ describe('dot Dependency imports', () => { describe('Dot', () => { beforeEach(() => { cleanup(); - document.body.innerHTML = ''; - vi.spyOn(console, 'warn').mockImplementation(() => {}); }); - afterEach(() => { - vi.restoreAllMocks(); + test('Verify data-ui-name', () => { + const dot = ; + + const { container } = render(dot); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); }); test('Verify no "alert" for screenreaders when hidden', async () => { From 888cdfde5729952125921353376344fb9d400a89 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 12 Jun 2026 12:33:12 +0200 Subject: [PATCH 02/17] [chore] added snapshots --- .../__snapshots__/index.test.tsx.snap | 30 +++ .../drag-and-drop/__tests__/index.test.tsx | 32 +++- .../__snapshots__/index.test.tsx.snap | 128 +++++++++++++ .../dropdown-menu/__tests__/index.test.tsx | 38 +++- .../__snapshots__/index.test.tsx.snap | 25 +++ semcore/dropdown/__tests__/index.test.tsx | 17 ++ .../__snapshots__/index.test.tsx.snap | 104 +++++++++++ semcore/errors/__tests__/index.test.tsx | 37 +++- .../__snapshots__/index.test.tsx.snap | 59 ++++++ .../__tests__/index.test.tsx | 172 +++++++++++++++++- .../__snapshots__/index.test.jsx.snap | 57 ++++++ .../feature-popover/__tests__/index.test.jsx | 20 ++ .../__snapshots__/index.test.tsx.snap | 110 +++++++++++ .../fullscreen-modal/__tests__/index.test.tsx | 22 +++ 14 files changed, 830 insertions(+), 21 deletions(-) create mode 100644 semcore/drag-and-drop/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/dropdown-menu/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/dropdown/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/errors/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/feature-highlight/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/feature-popover/__tests__/__snapshots__/index.test.jsx.snap create mode 100644 semcore/fullscreen-modal/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/drag-and-drop/__tests__/__snapshots__/index.test.tsx.snap b/semcore/drag-and-drop/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..7f9acf1815 --- /dev/null +++ b/semcore/drag-and-drop/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,30 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`DragAndDrop > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "DragAndDrop.Draggable", + }, + { + "children": [], + "uiName": "DragAndDrop.Draggable", + }, + { + "children": [], + "uiName": "DragAndDrop.DropZone", + }, + ], + "uiName": "DragAndDrop", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/drag-and-drop/__tests__/index.test.tsx b/semcore/drag-and-drop/__tests__/index.test.tsx index 6b6b3d5f75..d871bfb755 100644 --- a/semcore/drag-and-drop/__tests__/index.test.tsx +++ b/semcore/drag-and-drop/__tests__/index.test.tsx @@ -1,6 +1,36 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import DragAndDrop from '../src'; describe('drag-and-drop Dependency imports', () => { runDependencyCheckTests('drag-and-drop'); }); + +describe('DragAndDrop', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const dragAndDrop = ( + {}}> + + First item + + + Second item + + + Drop zone + + + ); + + const { container } = render(dragAndDrop); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); diff --git a/semcore/dropdown-menu/__tests__/__snapshots__/index.test.tsx.snap b/semcore/dropdown-menu/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..2ef9db50dd --- /dev/null +++ b/semcore/dropdown-menu/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,128 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`DropdownMenu > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ButtonTrigger.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "ButtonTrigger.Addon", + }, + ], + "uiName": "DropdownMenu.Trigger.InnerTriggerWrapper", + }, + ], + "uiName": "DropdownMenu.Trigger", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Flex", + }, + ], + "uiName": "Dropdown.Item", + }, + { + "children": [ + { + "children": [], + "uiName": "DropdownMenu.Item", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "DropdownMenu.Item.Addon", + }, + { + "children": [], + "uiName": "DropdownMenu.Item.Text", + }, + ], + "uiName": "DropdownMenu.Item.Content", + }, + { + "children": [], + "uiName": "DropdownMenu.Item.Hint", + }, + ], + "uiName": "DropdownMenu.Item", + }, + ], + "uiName": "DropdownMenu.Group", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": "DropdownMenu.Actions", + }, + { + "children": [], + "uiName": "DropdownMenu.StatusItem", + }, + ], + "uiName": null, + }, + ], + "uiName": "ScrollArea.Container", + }, + ], + "uiName": "DropdownMenu.Menu", + }, + ], + "uiName": "DropdownMenu.Popper", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, +} +`; diff --git a/semcore/dropdown-menu/__tests__/index.test.tsx b/semcore/dropdown-menu/__tests__/index.test.tsx index 39d56496bb..efaf76c18f 100644 --- a/semcore/dropdown-menu/__tests__/index.test.tsx +++ b/semcore/dropdown-menu/__tests__/index.test.tsx @@ -1,6 +1,7 @@ import { Box } from '@semcore/base-components'; import { ButtonTrigger } from '@semcore/base-trigger'; import Button from '@semcore/button'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -15,14 +16,37 @@ describe('dropdown-menu Dependency imports', () => { describe('DropdownMenu', () => { beforeEach(() => { cleanup(); + }); + + test('Verify data-ui-name', () => { + const dropdownMenu = ( + + + Trigger + + + + Item 1 + + + Before + Item 2 + + Hint text + + + + + + + + + ); + + const { container } = render(dropdownMenu); + const result = extractUIName(container); - const mockIntersectionObserver = vi.fn(); - mockIntersectionObserver.mockReturnValue({ - observe: () => null, - unobserve: () => null, - disconnect: () => null, - }); - window.IntersectionObserver = mockIntersectionObserver; + expect(result).toMatchSnapshot(); }); test.sequential('Verify does not trigger visibility change on Space key in input', async () => { diff --git a/semcore/dropdown/__tests__/__snapshots__/index.test.tsx.snap b/semcore/dropdown/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..fc291e2b61 --- /dev/null +++ b/semcore/dropdown/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,25 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Dropdown > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [], + "uiName": "Dropdown.Trigger", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": "Dropdown.Popper", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, +} +`; diff --git a/semcore/dropdown/__tests__/index.test.tsx b/semcore/dropdown/__tests__/index.test.tsx index 7e6af5bea0..a56afd2a1d 100644 --- a/semcore/dropdown/__tests__/index.test.tsx +++ b/semcore/dropdown/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, @@ -77,6 +78,22 @@ describe('Dropdown', () => { window.IntersectionObserver = mockIntersectionObserver; }); + test('Verify data-ui-name', () => { + const dropdown = ( + + + Trigger + + + + ); + + const { container } = render(dropdown); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify not open popper by keyboard enter if interaction none', async () => { const spy = vi.fn(); render( diff --git a/semcore/errors/__tests__/__snapshots__/index.test.tsx.snap b/semcore/errors/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..5ace18444d --- /dev/null +++ b/semcore/errors/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,104 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Error > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": "Error.Title", + }, + { + "children": [], + "uiName": "Error.Description", + }, + { + "children": [], + "uiName": "Error.Controls", + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "Error", + }, + ], + "uiName": null, +} +`; + +exports[`PageError > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": "Error.Title", + }, + { + "children": [], + "uiName": "Error.Description", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": "Error.Controls", + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "PageError", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/errors/__tests__/index.test.tsx b/semcore/errors/__tests__/index.test.tsx index 79e4128e85..55e3b6863b 100644 --- a/semcore/errors/__tests__/index.test.tsx +++ b/semcore/errors/__tests__/index.test.tsx @@ -1,15 +1,46 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { render, screen, userEvent } from '@semcore/testing-utils/testing-library'; -import { describe, it, expect, vi } from '@semcore/testing-utils/vitest'; +import { cleanup, render, screen, userEvent } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, it, expect, vi } from '@semcore/testing-utils/vitest'; import React from 'react'; -import { PageError } from '../src'; +import BaseError, { PageError } from '../src'; describe('errors Dependency imports', () => { runDependencyCheckTests('errors'); }); +describe('Error', () => { + beforeEach(cleanup); + + it('Verify data-ui-name', () => { + const error = ( + + Error title + Error description + Controls + + ); + + const { container } = render(error); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + describe('PageError', () => { + beforeEach(cleanup); + + it('Verify data-ui-name', () => { + const pageError = ; + + const { container } = render(pageError); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + it('Verify calls onClick when reload button is clicked', async () => { const handleClick = vi.fn((event: React.MouseEvent) => { event.preventDefault(); diff --git a/semcore/feature-highlight/__tests__/__snapshots__/index.test.tsx.snap b/semcore/feature-highlight/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..d3068830ac --- /dev/null +++ b/semcore/feature-highlight/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,59 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`NoticeFH > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "NoticeFH.Label", + }, + { + "children": [ + { + "children": [], + "uiName": "NoticeFH.Title", + }, + { + "children": [], + "uiName": "NoticeFH.Text", + }, + { + "children": [], + "uiName": "NoticeFH.Actions", + }, + ], + "uiName": "NoticeFH.Content", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "NoticeFH.Close.InnerWrapper", + }, + ], + "uiName": "NoticeFH.Close", + }, + ], + "uiName": "NoticeFH", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/feature-highlight/__tests__/index.test.tsx b/semcore/feature-highlight/__tests__/index.test.tsx index 796c408d09..419aadc0f3 100644 --- a/semcore/feature-highlight/__tests__/index.test.tsx +++ b/semcore/feature-highlight/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { render } from '@semcore/testing-utils/testing-library'; import { expect, test, describe } from '@semcore/testing-utils/vitest'; import React, { createRef } from 'react'; @@ -9,11 +10,21 @@ import { InputFH } from '../src/components/input/Input'; import { NoticeFH } from '../src/components/notice/Notice'; import { PillsFH } from '../src/components/pills/Pills'; import { RadioFH } from '../src/components/radio/Radio'; +import { SelectFH } from '../src/components/select/Select'; import { SwitchFH } from '../src/components/switch/Switch'; import { TabLineFH } from '../src/components/tab-line/TabLine'; +import { ButtonTriggerFH } from '../src/inner-components/button-trigger/ButtonTrigger'; +import { AnimatedSparkles } from '../src/inner-components/sparkle/AnimatedSparkles'; import SvgSparkle from '../src/inner-components/sparkle/Sparkle'; -describe('SvgSparkle', () => { +const expectUINameToMatchSnapshot = (component: React.ReactElement) => { + const { container } = render(component); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); +}; + +describe('SvgSparkle', (test) => { test('Verify renders an SVG element', () => { const { container } = render(); const svg = container.querySelector('svg'); @@ -37,7 +48,27 @@ const verifyDataTestIds = (container: HTMLElement, ids: string[], texts?: Record }); }; -describe('PillsFH', () => { +describe('BadgeFH', (test) => { + test('Verify data-ui-name', () => { + expectUINameToMatchSnapshot(AI-powered); + }); +}); + +describe('PillsFH', (test) => { + test('Verify data-ui-name', () => { + const pills = ( + + One + + Two + {999} + + + ); + + expectUINameToMatchSnapshot(pills); + }); + test('Verify allow adding data-test-id everywhere', () => { const { container } = render( @@ -58,7 +89,21 @@ describe('PillsFH', () => { }); }); -describe('ButtonFH', () => { +describe('ButtonFH', (test) => { + test('Verify data-ui-name', () => { + const button = ( + + + Button + + AI-powered + + + ); + + expectUINameToMatchSnapshot(button); + }); + test('Verify allow adding data-test-id everywhere', () => { const { container } = render( @@ -77,7 +122,31 @@ describe('ButtonFH', () => { }); }); -describe('CheckboxFH', () => { +describe('ButtonTriggerFH', (test) => { + test('Verify data-ui-name', () => { + const buttonTrigger = ( + + + Button trigger + + ); + + expectUINameToMatchSnapshot(buttonTrigger); + }); +}); + +describe('CheckboxFH', (test) => { + test('Verify data-ui-name', () => { + const checkbox = ( + + + First option + + ); + + expectUINameToMatchSnapshot(checkbox); + }); + test('Verify allow adding data-test-id everywhere', () => { const { container } = render( @@ -92,7 +161,18 @@ describe('CheckboxFH', () => { }); }); -describe('InputFH', () => { +describe('InputFH', (test) => { + test('Verify data-ui-name', () => { + const input = ( + + + + + ); + + expectUINameToMatchSnapshot(input); + }); + test('Verify allow adding data-test-id everywhere', () => { const { container } = render( @@ -105,7 +185,43 @@ describe('InputFH', () => { }); }); -describe('NoticeFH', () => { +describe('SelectFH', (test) => { + test('Verify data-ui-name', () => { + const select = ( + + + + One + + + + One + + + + ); + + expectUINameToMatchSnapshot(select); + }); +}); + +describe('NoticeFH', (test) => { + test.sequential('Verify data-ui-name', () => { + const notice = ( + + + + + + + + + + ); + + expectUINameToMatchSnapshot(notice); + }); + test('Verify render closable notice with data-test-id', () => { const { container } = render( , @@ -132,7 +248,7 @@ describe('NoticeFH', () => { expect(container.querySelector('[data-testid="label-icon"]')).toBeTruthy(); }); - test('Should render in advanced mode with subcomponents', () => { + test.sequential('Should render in advanced mode with subcomponents', () => { const { getByText, container } = render( @@ -185,7 +301,18 @@ describe('NoticeFH', () => { }); }); -describe('RadioFH', () => { +describe('RadioFH', (test) => { + test('Verify data-ui-name', () => { + const radio = ( + + + First option + + ); + + expectUINameToMatchSnapshot(radio); + }); + test('Verify allow adding data-test-id to all subcomponents', () => { const { container } = render( @@ -200,7 +327,18 @@ describe('RadioFH', () => { }); }); -describe('SwitchFH', () => { +describe('SwitchFH', (test) => { + test('Verify data-ui-name', () => { + const switchFH = ( + + + Medium switch + + ); + + expectUINameToMatchSnapshot(switchFH); + }); + test('Verify allow adding data-test-id to all subcomponents', () => { const { container } = render( @@ -215,7 +353,21 @@ describe('SwitchFH', () => { }); }); -describe('TabLineFH', () => { +describe('TabLineFH', (test) => { + test('Verify data-ui-name', () => { + const tabLine = ( + + First option + + + Second option + + + ); + + expectUINameToMatchSnapshot(tabLine); + }); + test('Verify allow adding data-test-id to all subcomponents', () => { const { container } = render( diff --git a/semcore/feature-popover/__tests__/__snapshots__/index.test.jsx.snap b/semcore/feature-popover/__tests__/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000000..6b08d5f39b --- /dev/null +++ b/semcore/feature-popover/__tests__/__snapshots__/index.test.jsx.snap @@ -0,0 +1,57 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`FeaturePopover.Popper > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "FeaturePopover.Spot", + }, + ], + "uiName": "FeaturePopover.Trigger", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + ], + "uiName": "FeaturePopover.Popper", + }, + ], + "uiName": "Animation", + }, + ], + "uiName": "Popper.Popper", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/feature-popover/__tests__/index.test.jsx b/semcore/feature-popover/__tests__/index.test.jsx index 4f25ec0868..8f9e247fd2 100644 --- a/semcore/feature-popover/__tests__/index.test.jsx +++ b/semcore/feature-popover/__tests__/index.test.jsx @@ -1,4 +1,5 @@ import Button from '@semcore/button'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render } from '@semcore/testing-utils/testing-library'; import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; @@ -13,6 +14,25 @@ describe('feature-popover Dependency imports', () => { describe('FeaturePopover.Popper', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const featurePopover = ( + + + Trigger + + + + Feature content + + + ); + + const { container } = render(featurePopover); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify supports custom tag', () => { const { getByTestId } = render( diff --git a/semcore/fullscreen-modal/__tests__/__snapshots__/index.test.tsx.snap b/semcore/fullscreen-modal/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..5997ac9dca --- /dev/null +++ b/semcore/fullscreen-modal/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,110 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`FullscreenModal > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "FullscreenModal.Close.InnerWrapper", + }, + ], + "uiName": "FullscreenModal.Close", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ArrowLeft", + }, + ], + "uiName": "Link.Addon", + }, + { + "children": [], + "uiName": "ButtonLink.Text", + }, + ], + "uiName": "FullscreenModal.Back.InnerWrapper", + }, + ], + "uiName": "FullscreenModal.Back", + }, + { + "children": [ + { + "children": [], + "uiName": "FullscreenModal.Title", + }, + { + "children": [], + "uiName": "FullscreenModal.Description", + }, + ], + "uiName": "FullscreenModal.Header", + }, + { + "children": [ + { + "children": [], + "uiName": "FullscreenModal.Section", + }, + ], + "uiName": "FullscreenModal.Body", + }, + { + "children": [], + "uiName": "FullscreenModal.Footer", + }, + ], + "uiName": "FullscreenModal", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Modal.Overlay.ContentWrapper", + }, + ], + "uiName": "Modal.Overlay", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/fullscreen-modal/__tests__/index.test.tsx b/semcore/fullscreen-modal/__tests__/index.test.tsx index 07988ba154..2221905acf 100644 --- a/semcore/fullscreen-modal/__tests__/index.test.tsx +++ b/semcore/fullscreen-modal/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, screen, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,27 @@ describe('fullscreen-modal Dependency imports', () => { describe('FullscreenModal', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const fullscreenModal = ( + + Back + + Modal title + Modal description + + + Modal content + + Modal footer + + ); + + const { container } = render(fullscreenModal); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('should support hidden props', () => { const { rerender, queryByText } = render(Text); expect(queryByText(/Text/)).toBeNull(); From e15d24bfc0e35495ef445fa9b714568086eb38dc Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 12 Jun 2026 12:56:50 +0200 Subject: [PATCH 03/17] [chore] added snapshots --- .../__snapshots__/index.test.jsx.snap | 234 ++++++++++++++++ .../feedback-form/__tests__/index.test.jsx | 41 +++ .../__snapshots__/index.test.tsx.snap | 18 ++ semcore/inline-edit/__tests__/index.test.tsx | 15 + .../__snapshots__/index.test.tsx.snap | 85 ++++++ semcore/inline-input/__tests__/index.test.tsx | 19 ++ .../__snapshots__/index.test.tsx.snap | 59 ++++ semcore/input-number/__tests__/index.test.tsx | 16 ++ .../__snapshots__/index.test.tsx.snap | 87 ++++++ semcore/input-tags/__tests__/index.test.tsx | 24 ++ .../__snapshots__/index.test.tsx.snap | 26 ++ semcore/input/__tests__/index.test.tsx | 15 + .../__snapshots__/index.test.tsx.snap | 27 ++ semcore/link/__tests__/index.test.tsx | 15 + .../__snapshots__/index.test.tsx.snap | 265 ++++++++++++++++++ semcore/mini-chart/__tests__/index.test.tsx | 78 +++++- 16 files changed, 1023 insertions(+), 1 deletion(-) create mode 100644 semcore/feedback-form/__tests__/__snapshots__/index.test.jsx.snap create mode 100644 semcore/inline-edit/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/inline-input/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/input-number/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/input-tags/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/input/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/link/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/mini-chart/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/feedback-form/__tests__/__snapshots__/index.test.jsx.snap b/semcore/feedback-form/__tests__/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000000..a1255af563 --- /dev/null +++ b/semcore/feedback-form/__tests__/__snapshots__/index.test.jsx.snap @@ -0,0 +1,234 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`FeedbackForm > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Notice.Content", + }, + ], + "uiName": "FeedbackForm.Notice", + }, + { + "children": [ + { + "children": [], + "uiName": "FeedbackForm.Item", + }, + ], + "uiName": "Tooltip.Trigger", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "FeedbackForm.Success", + }, + { + "children": [ + { + "children": [], + "uiName": "FeedbackForm.Cancel.InnerWrapper", + }, + ], + "uiName": "FeedbackForm.Cancel", + }, + { + "children": [ + { + "children": [], + "uiName": "FeedbackForm.Submit.InnerWrapper", + }, + ], + "uiName": "FeedbackForm.Submit", + }, + ], + "uiName": "FeedbackForm", + }, + ], + "uiName": "SpinContainer.Content", + }, + ], + "uiName": "SpinContainer", + }, + ], + "uiName": null, +} +`; + +exports[`FeedbackRating - Props and Rendering > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Feedback", + }, + ], + "uiName": "Notice.Label", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Text", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SliderRating.Star", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SliderRating.Star", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SliderRating.Star", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SliderRating.Star", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SliderRating.Star", + }, + ], + "uiName": "SliderRating", + }, + ], + "uiName": "Notice.Actions", + }, + ], + "uiName": "Notice.Text", + }, + ], + "uiName": "Notice.Content", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Notice.Close.InnerWrapper", + }, + ], + "uiName": "Notice.Close", + }, + ], + "uiName": "Notice", + }, + ], + "uiName": "FeedbackRatingForm", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/feedback-form/__tests__/index.test.jsx b/semcore/feedback-form/__tests__/index.test.jsx index ad8f141131..0ca06d5a8e 100644 --- a/semcore/feedback-form/__tests__/index.test.jsx +++ b/semcore/feedback-form/__tests__/index.test.jsx @@ -1,4 +1,5 @@ import CongratsIllustration from '@semcore/illustration/Congrats'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -13,6 +14,25 @@ describe('feedback-form Dependency imports', () => { describe('FeedbackForm', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const feedbackForm = ( + {}}> + + + {({ input }) => } + + + + + + ); + + const { container } = render(feedbackForm); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Verify call onSubmit', async () => { const onSubmit = vi.fn(); @@ -171,6 +191,27 @@ describe('FeedbackRating - Props and Rendering', () => { errorFeedbackEmail: 'test@example.com', }; + test('Verify data-ui-name', () => { + const feedbackRating = ( + Feedback header} + /> + ); + + const { container } = render(feedbackRating); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Should render with default props', () => { const { getByText } = render(); diff --git a/semcore/inline-edit/__tests__/__snapshots__/index.test.tsx.snap b/semcore/inline-edit/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..60e4b2ec5d --- /dev/null +++ b/semcore/inline-edit/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,18 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`InlineEdit > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "InlineEdit.View", + }, + ], + "uiName": "InlineEdit", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/inline-edit/__tests__/index.test.tsx b/semcore/inline-edit/__tests__/index.test.tsx index 6c355de8c3..b4871da0be 100644 --- a/semcore/inline-edit/__tests__/index.test.tsx +++ b/semcore/inline-edit/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, vi } from '@semcore/testing-utils/vitest'; @@ -10,6 +11,20 @@ describe('inline-edit Dependency imports', () => { }); describe('InlineEdit', () => { + test('Verify data-ui-name', () => { + const inlineEdit = ( + + + + + ); + + const { container } = render(inlineEdit); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify throws error when rendered without children', () => { const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}); expect(() => render()).toThrow( diff --git a/semcore/inline-input/__tests__/__snapshots__/index.test.tsx.snap b/semcore/inline-input/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..ec4a1ca5a1 --- /dev/null +++ b/semcore/inline-input/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,85 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`InlineInput > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "InlineInput.Addon", + }, + { + "children": [], + "uiName": "InlineInput.Value", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Check", + }, + ], + "uiName": "Link.Addon", + }, + ], + "uiName": "ButtonLink.InnerWrapper", + }, + ], + "uiName": "ButtonLink", + }, + ], + "uiName": "InlineInput.ConfirmControl", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Link.Addon", + }, + ], + "uiName": "ButtonLink.InnerWrapper", + }, + ], + "uiName": "ButtonLink", + }, + ], + "uiName": "InlineInput.CancelControl", + }, + ], + "uiName": null, + }, + ], + "uiName": "InlineInput", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/inline-input/__tests__/index.test.tsx b/semcore/inline-input/__tests__/index.test.tsx index 401357e510..8455eaaa52 100644 --- a/semcore/inline-input/__tests__/index.test.tsx +++ b/semcore/inline-input/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent, waitFor } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,24 @@ describe('inline-input Dependency imports', () => { describe('InlineInput', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const inlineInput = ( + <> + + + + + + + + ); + + const { container } = render(inlineInput); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.sequential('Verify blur behavior', async () => { const spyCancel = vi.fn(); const spyConfirm = vi.fn(); diff --git a/semcore/input-number/__tests__/__snapshots__/index.test.tsx.snap b/semcore/input-number/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..8e10e63562 --- /dev/null +++ b/semcore/input-number/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,59 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`InputNumber > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "InputNumber.Addon", + }, + { + "children": [], + "uiName": "InputNumber.Value", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "InputNumber.Controls", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "InputNumber", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/input-number/__tests__/index.test.tsx b/semcore/input-number/__tests__/index.test.tsx index 8183c1d7ed..e5748df0e4 100644 --- a/semcore/input-number/__tests__/index.test.tsx +++ b/semcore/input-number/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,21 @@ describe('input-number Dependency imports', () => { describe('InputNumber', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const inputNumber = ( + + + + + + ); + + const { container } = render(inputNumber); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + const focusInput = async (input: HTMLElement) => { await userEvent.click(input); expect(input).toHaveFocus(); diff --git a/semcore/input-tags/__tests__/__snapshots__/index.test.tsx.snap b/semcore/input-tags/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..2b78090335 --- /dev/null +++ b/semcore/input-tags/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,87 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`InputTags > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "InputTags.Tag.Circle", + }, + ], + "uiName": "Box", + }, + { + "children": [], + "uiName": "InputTags.Tag.Addon", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "InputTags.Tag.Text.Content", + }, + ], + "uiName": "Tag.Text", + }, + ], + "uiName": "InputTags.Tag.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "InputTags.Tag.Close", + }, + ], + "uiName": "InputTags.Tag", + }, + ], + "uiName": null, + }, + { + "children": [], + "uiName": "InputTags.Value", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "ScrollArea.Container", + }, + ], + "uiName": "InputTags", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/input-tags/__tests__/index.test.tsx b/semcore/input-tags/__tests__/index.test.tsx index 510ceaee92..24d686df30 100644 --- a/semcore/input-tags/__tests__/index.test.tsx +++ b/semcore/input-tags/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, userEvent, cleanup } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,29 @@ describe('input-tags Dependency imports', () => { describe('InputTags', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const inputTags = ( + + + + + + + + + + + + + + ); + + const { container } = render(inputTags); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify calls onClick', async () => { const onClick = vi.fn(); const { getByRole } = render( diff --git a/semcore/input/__tests__/__snapshots__/index.test.tsx.snap b/semcore/input/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..8b5e602711 --- /dev/null +++ b/semcore/input/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,26 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Input > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Input.Addon", + }, + { + "children": [], + "uiName": "Input.Value", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Input", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/input/__tests__/index.test.tsx b/semcore/input/__tests__/index.test.tsx index a30c5630e3..058b83e15b 100644 --- a/semcore/input/__tests__/index.test.tsx +++ b/semcore/input/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,20 @@ describe('input Dependency imports', () => { describe('Input', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const input = ( + + + + + ); + + const { container } = render(input); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Verify value changes when rerender', () => { const { getByTestId, rerender } = render( diff --git a/semcore/link/__tests__/__snapshots__/index.test.tsx.snap b/semcore/link/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..eccabddb21 --- /dev/null +++ b/semcore/link/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,27 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Link > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Link.Addon", + }, + { + "children": [], + "uiName": "Link.Text", + }, + ], + "uiName": "Link.InnerWrapper", + }, + ], + "uiName": "Link", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/link/__tests__/index.test.tsx b/semcore/link/__tests__/index.test.tsx index 9a071bdbc1..549a1fdebc 100644 --- a/semcore/link/__tests__/index.test.tsx +++ b/semcore/link/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,20 @@ describe('link Dependency imports', () => { describe('Link', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const link = ( + + + + + ); + + const { container } = render(link); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify not use ', () => { const { getByTestId } = render( diff --git a/semcore/mini-chart/__tests__/__snapshots__/index.test.tsx.snap b/semcore/mini-chart/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..5ffc1c925c --- /dev/null +++ b/semcore/mini-chart/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,265 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`MiniCharts > Verify data-ui-name for ScoreDonut 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.ScoreDonut", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for ScoreLine 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ScoreLine.Segment", + }, + ], + "uiName": "Flex", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": "MiniChart.ScoreLine", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for ScoreSemiDonut 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.ScoreSemiDonut", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for TrendArea 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.TrendArea", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for TrendBar 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.TrendBar", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for TrendHistogram 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.TrendHistogram", + }, + ], + "uiName": null, +} +`; + +exports[`MiniCharts > Verify data-ui-name for TrendLine 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + ], + "uiName": "MiniChart.TrendLine", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/mini-chart/__tests__/index.test.tsx b/semcore/mini-chart/__tests__/index.test.tsx index 43de4a0113..5433eb186e 100644 --- a/semcore/mini-chart/__tests__/index.test.tsx +++ b/semcore/mini-chart/__tests__/index.test.tsx @@ -1,6 +1,82 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { cleanup, render } from '@semcore/testing-utils/testing-library'; +import { beforeEach, describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import MiniCharts from '../src'; describe('mini-chart Dependency imports', () => { runDependencyCheckTests('mini-chart'); }); + +describe('MiniCharts', () => { + beforeEach(cleanup); + + test('Verify data-ui-name for ScoreLine', () => { + const scoreLine = ( + + + + ); + + const { container } = render(scoreLine); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for ScoreDonut', () => { + const scoreDonut = ; + + const { container } = render(scoreDonut); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for ScoreSemiDonut', () => { + const scoreSemiDonut = ; + + const { container } = render(scoreSemiDonut); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for TrendLine', () => { + const trendLine = ; + + const { container } = render(trendLine); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for TrendArea', () => { + const trendArea = ; + + const { container } = render(trendArea); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for TrendBar', () => { + const trendBar = ; + + const { container } = render(trendBar); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + + test('Verify data-ui-name for TrendHistogram', () => { + const trendHistogram = ; + + const { container } = render(trendHistogram); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); From c2c458978e68d050e116473b11b188c88a9ba29d Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Fri, 12 Jun 2026 12:58:34 +0200 Subject: [PATCH 04/17] [chore] added snapshots --- .../__tests__/index.test.tsx | 3 +- semcore/mini-chart/__tests__/index.test.tsx | 56 +++++++------------ 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/semcore/feature-highlight/__tests__/index.test.tsx b/semcore/feature-highlight/__tests__/index.test.tsx index 419aadc0f3..273c5575a1 100644 --- a/semcore/feature-highlight/__tests__/index.test.tsx +++ b/semcore/feature-highlight/__tests__/index.test.tsx @@ -1,6 +1,6 @@ import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { render } from '@semcore/testing-utils/testing-library'; -import { expect, test, describe } from '@semcore/testing-utils/vitest'; +import { expect, describe } from '@semcore/testing-utils/vitest'; import React, { createRef } from 'react'; import { BadgeFH } from '../src/components/badge/Badge'; @@ -14,7 +14,6 @@ import { SelectFH } from '../src/components/select/Select'; import { SwitchFH } from '../src/components/switch/Switch'; import { TabLineFH } from '../src/components/tab-line/TabLine'; import { ButtonTriggerFH } from '../src/inner-components/button-trigger/ButtonTrigger'; -import { AnimatedSparkles } from '../src/inner-components/sparkle/AnimatedSparkles'; import SvgSparkle from '../src/inner-components/sparkle/Sparkle'; const expectUINameToMatchSnapshot = (component: React.ReactElement) => { diff --git a/semcore/mini-chart/__tests__/index.test.tsx b/semcore/mini-chart/__tests__/index.test.tsx index 5433eb186e..dd9e750e00 100644 --- a/semcore/mini-chart/__tests__/index.test.tsx +++ b/semcore/mini-chart/__tests__/index.test.tsx @@ -6,6 +6,13 @@ import React from 'react'; import MiniCharts from '../src'; +const expectUINameToMatchSnapshot = (component: React.ReactElement) => { + const { container } = render(component); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); +}; + describe('mini-chart Dependency imports', () => { runDependencyCheckTests('mini-chart'); }); @@ -14,69 +21,48 @@ describe('MiniCharts', () => { beforeEach(cleanup); test('Verify data-ui-name for ScoreLine', () => { - const scoreLine = ( + const component = ( ); - const { container } = render(scoreLine); - const result = extractUIName(container); - - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for ScoreDonut', () => { - const scoreDonut = ; + const component = ; - const { container } = render(scoreDonut); - const result = extractUIName(container); - - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for ScoreSemiDonut', () => { - const scoreSemiDonut = ; - - const { container } = render(scoreSemiDonut); - const result = extractUIName(container); + const component = ; - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for TrendLine', () => { - const trendLine = ; + const component = ; - const { container } = render(trendLine); - const result = extractUIName(container); - - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for TrendArea', () => { - const trendArea = ; - - const { container } = render(trendArea); - const result = extractUIName(container); + const component = ; - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for TrendBar', () => { - const trendBar = ; + const component = ; - const { container } = render(trendBar); - const result = extractUIName(container); - - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); test('Verify data-ui-name for TrendHistogram', () => { - const trendHistogram = ; - - const { container } = render(trendHistogram); - const result = extractUIName(container); + const component = ; - expect(result).toMatchSnapshot(); + expectUINameToMatchSnapshot(component); }); }); From 346d583b287728a5b5852ae559560681dfe7a3fa Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 14:29:08 +0200 Subject: [PATCH 05/17] [input-mask] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 49 +++++++++++++++++++ semcore/input-mask/__tests__/index.test.tsx | 16 ++++++ semcore/input-mask/package.json | 1 + 3 files changed, 66 insertions(+) create mode 100644 semcore/input-mask/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/input-mask/__tests__/__snapshots__/index.test.tsx.snap b/semcore/input-mask/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..26fca3aa8e --- /dev/null +++ b/semcore/input-mask/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,49 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`InputMask > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Badge", + }, + ], + "uiName": "InputMask.Addon", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Box", + }, + { + "children": [], + "uiName": "InputMask.Value", + }, + ], + "uiName": "Flex", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "InputMask", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/input-mask/__tests__/index.test.tsx b/semcore/input-mask/__tests__/index.test.tsx index e3ac3f6b68..2e5cd6efd7 100644 --- a/semcore/input-mask/__tests__/index.test.tsx +++ b/semcore/input-mask/__tests__/index.test.tsx @@ -1,3 +1,5 @@ +import Badge from '@semcore/badge'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach } from '@semcore/testing-utils/vitest'; @@ -12,6 +14,20 @@ describe('input-mask Dependency imports', () => { describe('InputMask', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const inputMask = ( + + + + + ); + + const { container } = render(inputMask); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.sequential('Should renders correctly', async () => { const Component = ({ value = '' }) => ( diff --git a/semcore/input-mask/package.json b/semcore/input-mask/package.json index 945b01bb92..c156641b3e 100644 --- a/semcore/input-mask/package.json +++ b/semcore/input-mask/package.json @@ -30,6 +30,7 @@ }, "devDependencies": { "@semcore/core": "workspace:*", + "@semcore/badge": "workspace:*", "@semcore/base-components": "workspace:*", "@semcore/testing-utils": "workspace:*" } From fdf285f7a1b5f5c91007ed789fb0fd7e3a232536 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 14:31:14 +0200 Subject: [PATCH 06/17] [modal] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 50 +++++++++++++++++++ semcore/modal/__tests__/index.test.tsx | 19 +++++++ 2 files changed, 69 insertions(+) create mode 100644 semcore/modal/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/modal/__tests__/__snapshots__/index.test.tsx.snap b/semcore/modal/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..b208d1b7b1 --- /dev/null +++ b/semcore/modal/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,50 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Modal > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [], + "uiName": "Modal.Title", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Modal.Close.InnerWrapper", + }, + ], + "uiName": "Modal.Close", + }, + ], + "uiName": "Modal.Window", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Modal.Overlay.ContentWrapper", + }, + ], + "uiName": "Modal.Overlay", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/modal/__tests__/index.test.tsx b/semcore/modal/__tests__/index.test.tsx index b9aaac9f3a..eaa43a0e12 100644 --- a/semcore/modal/__tests__/index.test.tsx +++ b/semcore/modal/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, queryByAttribute, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -13,6 +14,24 @@ describe('modal Dependency imports', () => { describe('Modal', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const modal = ( + + + + Modal title + Close + + + + ); + + const { container } = render(modal); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.sequential('Verify onClose event for Escape', async () => { const spy = vi.fn(); const { getByTestId } = render(); From 8b41a04987a45522e8aa29b343c165df1fb37785 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 14:33:23 +0200 Subject: [PATCH 07/17] [notice] added data-ui-name test --- .../__snapshots__/index.test.jsx.snap | 117 ++++++++++++++++++ semcore/notice/__tests__/index.test.jsx | 31 +++++ 2 files changed, 148 insertions(+) create mode 100644 semcore/notice/__tests__/__snapshots__/index.test.jsx.snap diff --git a/semcore/notice/__tests__/__snapshots__/index.test.jsx.snap b/semcore/notice/__tests__/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000000..34118054b6 --- /dev/null +++ b/semcore/notice/__tests__/__snapshots__/index.test.jsx.snap @@ -0,0 +1,117 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Notice > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Notice.Label", + }, + { + "children": [ + { + "children": [], + "uiName": "Notice.Title", + }, + { + "children": [], + "uiName": "Notice.Text", + }, + { + "children": [], + "uiName": "Notice.Actions", + }, + ], + "uiName": "Notice.Content", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Notice.Close.InnerWrapper", + }, + ], + "uiName": "Notice.Close", + }, + ], + "uiName": "Notice", + }, + ], + "uiName": null, +} +`; + +exports[`NoticeSmart > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Notice.Label", + }, + { + "children": [ + { + "children": [], + "uiName": "Notice.Title", + }, + { + "children": [], + "uiName": "Notice.Text", + }, + { + "children": [], + "uiName": "Notice.Actions", + }, + ], + "uiName": "Notice.Content", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Notice.Close.InnerWrapper", + }, + ], + "uiName": "Notice.Close", + }, + ], + "uiName": "NoticeSmart", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/notice/__tests__/index.test.jsx b/semcore/notice/__tests__/index.test.jsx index d6b00b59a4..632d440307 100644 --- a/semcore/notice/__tests__/index.test.jsx +++ b/semcore/notice/__tests__/index.test.jsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,25 @@ describe('notice Dependency imports', () => { describe('Notice', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const notice = ( + + Label + + Title + Text + Actions + + + + ); + + const { container } = render(notice); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify supports custom close icon', () => { const component = ( @@ -51,6 +71,17 @@ describe('Notice', () => { describe('NoticeSmart', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const noticeSmart = ( + + ); + + const { container } = render(noticeSmart); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify renders title and text from props', () => { const { container } = render( , From 45709a386db0210228acd58aa7f05398fe360d51 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 15:14:04 +0200 Subject: [PATCH 08/17] [notice-bubble] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 103 ++++++++++++++++++ .../notice-bubble/__tests__/index.test.tsx | 30 +++++ 2 files changed, 133 insertions(+) create mode 100644 semcore/notice-bubble/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/notice-bubble/__tests__/__snapshots__/index.test.tsx.snap b/semcore/notice-bubble/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..f6080f303c --- /dev/null +++ b/semcore/notice-bubble/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,103 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`NoticeBubbleContainer > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Flex", + }, + ], + "uiName": "Flex", + }, + ], + "uiName": "Animation", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Button.Addon", + }, + ], + "uiName": "Button.InnerWrapper", + }, + ], + "uiName": "Button", + }, + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Flex", + }, + ], + "uiName": "Flex", + }, + ], + "uiName": "Animation", + }, + ], + "uiName": null, + }, + ], + "uiName": "NoticeBubbleContainer", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/notice-bubble/__tests__/index.test.tsx b/semcore/notice-bubble/__tests__/index.test.tsx index 488a4c837c..c5ea4ed4e7 100644 --- a/semcore/notice-bubble/__tests__/index.test.tsx +++ b/semcore/notice-bubble/__tests__/index.test.tsx @@ -1,5 +1,7 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { + act, render, cleanup, waitFor, @@ -17,6 +19,34 @@ describe('notice-bubble Dependency imports', () => { describe('NoticeBubbleContainer', () => { beforeEach(cleanup); + test('Verify data-ui-name', async () => { + const manager = new NoticeBubbleManager(); + const { container, getByText } = render( + , + ); + + manager.add({ + type: 'warning', + children: 'Warning notice', + action: 'Warning action', + duration: 0, + initialAnimation: false, + }); + manager.add({ + type: 'info', + children: 'Info notice', + action: 'Info action', + duration: 0, + initialAnimation: false, + }); + + await waitFor(() => expect(getByText('Info notice')).toBeInTheDocument()); + + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test('Verify supports rendering outside DOM', () => { const { queryByTestId } = render(
From 3c142370fbd38636009eb678bc0c03cdf657490b Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 15:26:25 +0200 Subject: [PATCH 09/17] [pagination] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 99 +++++++++++++++++++ semcore/pagination/__tests__/index.test.tsx | 25 +++++ 2 files changed, 124 insertions(+) create mode 100644 semcore/pagination/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/pagination/__tests__/__snapshots__/index.test.tsx.snap b/semcore/pagination/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..4490c7f710 --- /dev/null +++ b/semcore/pagination/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,99 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Pagination > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Pagination.FirstPage.InnerWrapper", + }, + ], + "uiName": "Pagination.FirstPage", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Pagination.PrevPage.InnerWrapper", + }, + ], + "uiName": "Pagination.PrevPage", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "Pagination.NextPage.InnerWrapper", + }, + ], + "uiName": "Pagination.NextPage", + }, + { + "children": [], + "uiName": "Text", + }, + { + "children": [ + { + "children": [], + "uiName": "Pagination.PageInput.Value", + }, + { + "children": [], + "uiName": "Pagination.PageInput.Addon", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Pagination.PageInput", + }, + { + "children": [], + "uiName": "Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Link.Text", + }, + ], + "uiName": "Pagination.TotalPages.InnerWrapper", + }, + ], + "uiName": "Pagination.TotalPages", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": "Pagination", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/pagination/__tests__/index.test.tsx b/semcore/pagination/__tests__/index.test.tsx index 507bf14ba3..b9ffbb9ed4 100644 --- a/semcore/pagination/__tests__/index.test.tsx +++ b/semcore/pagination/__tests__/index.test.tsx @@ -1,5 +1,6 @@ import Button, { ButtonLink } from '@semcore/button'; import Return from '@semcore/icon/Return/m'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -11,6 +12,30 @@ describe('pagination Dependency imports', () => { runDependencyCheckTests('pagination'); }); +describe('Pagination', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const pagination = ( + + First page + + + + + + + + + ); + + const { container } = render(pagination); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + describe('Pagination.FirstPage', () => { beforeEach(cleanup); From c9f8628517894d8607e0fd8904487263b1cd8363 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 15:44:13 +0200 Subject: [PATCH 10/17] [pills] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 27 +++++++++++++++++++ semcore/pills/__tests__/index.test.tsx | 17 ++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 semcore/pills/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/pills/__tests__/__snapshots__/index.test.tsx.snap b/semcore/pills/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..c66166b7a9 --- /dev/null +++ b/semcore/pills/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,27 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`PillGroup > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Pills.Item.Addon", + }, + { + "children": [], + "uiName": "Pills.Item.Text", + }, + ], + "uiName": "Pills.Item", + }, + ], + "uiName": "Pills", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/pills/__tests__/index.test.tsx b/semcore/pills/__tests__/index.test.tsx index 59414dcbae..5181fdfd1e 100644 --- a/semcore/pills/__tests__/index.test.tsx +++ b/semcore/pills/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import type { Intergalactic } from '@semcore/core'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi, assertType } from '@semcore/testing-utils/vitest'; @@ -29,6 +30,22 @@ describe('PillGroup', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const pills = ( + + + + Item + + + ); + + const { container } = render(pills); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Verify supports onChange callback', async () => { const spy = vi.fn(); const { getByTestId } = render( From 28faacc4bb773deffb723bde52c09de0fe9064a2 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 15:48:04 +0200 Subject: [PATCH 11/17] [product-head] added data-ui-name test --- .../__snapshots__/index.test.jsx.snap | 59 +++++++++++++++++++ semcore/product-head/__tests__/index.test.jsx | 34 ++++++++++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 semcore/product-head/__tests__/__snapshots__/index.test.jsx.snap diff --git a/semcore/product-head/__tests__/__snapshots__/index.test.jsx.snap b/semcore/product-head/__tests__/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000000..001130f5d7 --- /dev/null +++ b/semcore/product-head/__tests__/__snapshots__/index.test.jsx.snap @@ -0,0 +1,59 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ProductHead > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Title.Tool", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Title", + }, + { + "children": [], + "uiName": "ProductHead.Buttons", + }, + { + "children": [], + "uiName": "ProductHead.Links", + }, + ], + "uiName": "ProductHead.Row", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Info.Item.Label", + }, + ], + "uiName": "Info.Item", + }, + ], + "uiName": "Info", + }, + ], + "uiName": "ProductHead.Row", + }, + ], + "uiName": "ProductHead", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/product-head/__tests__/index.test.jsx b/semcore/product-head/__tests__/index.test.jsx index 17157d4ddf..a75e97141b 100644 --- a/semcore/product-head/__tests__/index.test.jsx +++ b/semcore/product-head/__tests__/index.test.jsx @@ -1,6 +1,38 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { render } from '@semcore/testing-utils/testing-library'; +import { describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import ProductHead, { Info, Title } from '../src'; describe('product-head Dependency imports', () => { runDependencyCheckTests('product-head'); }); + +describe('ProductHead', () => { + test('Verify data-ui-name', () => { + const productHead = ( + + + Title + Buttons + Links + + + + + Label + Content + + + + + ); + + const { container } = render(productHead); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); From 252c9843d8f6d29f24c96163ad3764eda1c66941 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Tue, 28 Jul 2026 15:49:15 +0200 Subject: [PATCH 12/17] [progress-bar] added data-ui-name test --- .../__snapshots__/index.test.jsx.snap | 18 +++++++++++++++ semcore/progress-bar/__tests__/index.test.jsx | 22 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 semcore/progress-bar/__tests__/__snapshots__/index.test.jsx.snap diff --git a/semcore/progress-bar/__tests__/__snapshots__/index.test.jsx.snap b/semcore/progress-bar/__tests__/__snapshots__/index.test.jsx.snap new file mode 100644 index 0000000000..a0112d48b5 --- /dev/null +++ b/semcore/progress-bar/__tests__/__snapshots__/index.test.jsx.snap @@ -0,0 +1,18 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ProgressBar > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "ProgressBar.Value", + }, + ], + "uiName": "ProgressBar", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/progress-bar/__tests__/index.test.jsx b/semcore/progress-bar/__tests__/index.test.jsx index 2f901c1d68..ba1061b5bf 100644 --- a/semcore/progress-bar/__tests__/index.test.jsx +++ b/semcore/progress-bar/__tests__/index.test.jsx @@ -1,6 +1,26 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { render } from '@semcore/testing-utils/testing-library'; +import { describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import ProgressBar from '../src'; describe('progress-bar Dependency imports', () => { runDependencyCheckTests('progress-bar'); }); + +describe('ProgressBar', () => { + test('Verify data-ui-name', () => { + const progressBar = ( + + + + ); + + const { container } = render(progressBar); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); From 9af5a8bc36b72b5e96a4ed09cce99e60fc34dc79 Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Wed, 29 Jul 2026 12:43:35 +0200 Subject: [PATCH 13/17] [radio] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 31 +++++++++++++++++++ semcore/radio/__tests__/index.test.tsx | 20 ++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 semcore/radio/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/radio/__tests__/__snapshots__/index.test.tsx.snap b/semcore/radio/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..6d26b7fa3c --- /dev/null +++ b/semcore/radio/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,31 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Radio > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Radio.Value", + }, + { + "children": [], + "uiName": "Value.RadioMark", + }, + { + "children": [], + "uiName": "Radio.Text", + }, + ], + "uiName": "Radio", + }, + ], + "uiName": "RadioGroup", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/radio/__tests__/index.test.tsx b/semcore/radio/__tests__/index.test.tsx index fe2813d923..db97db5d35 100644 --- a/semcore/radio/__tests__/index.test.tsx +++ b/semcore/radio/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,25 @@ describe('radio Dependency imports', () => { describe('Radio', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const radio = ( + + + + + + + Label + + + ); + + const { container } = render(radio); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); + test.concurrent('Verify supports custom attributes on the input', () => { const { getByTestId } = render( From b0841cb1913a638030927b095527c207ad730a9b Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Wed, 29 Jul 2026 12:53:45 +0200 Subject: [PATCH 14/17] [select] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 172 ++++++++++++++++++ semcore/select/__tests__/index.test.tsx | 40 ++++ 2 files changed, 212 insertions(+) create mode 100644 semcore/select/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/select/__tests__/__snapshots__/index.test.tsx.snap b/semcore/select/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..037d6135ab --- /dev/null +++ b/semcore/select/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,172 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Select > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Select.Trigger.Addon", + }, + { + "children": [], + "uiName": "Select.Trigger.Text", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ChevronDown", + }, + ], + "uiName": "ButtonTrigger.Addon", + }, + ], + "uiName": "Select.Trigger.InnerTriggerWrapper", + }, + ], + "uiName": "Select.Trigger", + }, + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Search", + }, + ], + "uiName": "Select.InputSearch.SearchIcon", + }, + { + "children": [], + "uiName": "Select.InputSearch.Value", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "Link.Addon", + }, + ], + "uiName": "Select.InputSearch.Clear.InnerWrapper", + }, + ], + "uiName": "Select.InputSearch.Clear", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Input", + }, + { + "children": [ + { + "children": [], + "uiName": "Flex", + }, + ], + "uiName": "Dropdown.Item", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Select.Option.Checkbox", + }, + { + "children": [], + "uiName": "Select.Option.Addon", + }, + { + "children": [], + "uiName": "Select.Option.Text", + }, + ], + "uiName": "Select.Option.Content", + }, + { + "children": [], + "uiName": "Select.Option.Hint", + }, + ], + "uiName": "Select.Option", + }, + ], + "uiName": "Select.Group", + }, + { + "children": [], + "uiName": "Select.Divider", + }, + { + "children": [], + "uiName": "Select.StatusItem", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": null, + }, + ], + "uiName": "ScrollArea.Container", + }, + ], + "uiName": "Select.Menu", + }, + ], + "uiName": "Select.Popper", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": null, +} +`; diff --git a/semcore/select/__tests__/index.test.tsx b/semcore/select/__tests__/index.test.tsx index afdcf57b88..cbfb3d136c 100644 --- a/semcore/select/__tests__/index.test.tsx +++ b/semcore/select/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, screen, userEvent, waitFor } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -9,6 +10,45 @@ describe('select Dependency imports', () => { runDependencyCheckTests('select'); }); +describe('Select', () => { + beforeEach(cleanup); + + test('Verify data-ui-name', () => { + const select = ( + + ); + + const { container } = render(select); + const result = extractUIName(container); + + expect(result).toMatchSnapshot(); + }); +}); + describe('Select Trigger', () => { beforeEach(() => { cleanup(); From e7c91c9129aca1f6c03f29e30a8ed4ae10404f3e Mon Sep 17 00:00:00 2001 From: "ilia.brauer" Date: Wed, 29 Jul 2026 13:05:03 +0200 Subject: [PATCH 15/17] [side-panel, skeleton, slider, spin, spin-container, switch, tab-line, tab-panel, tag, textarea, time-picker, tooltip, typography, widget-empty, wizard] added data-ui-name test --- .../__snapshots__/index.test.tsx.snap | 86 +++++++++++ semcore/side-panel/__tests__/index.test.tsx | 22 +++ .../__snapshots__/index.test.tsx.snap | 76 ++++++++++ semcore/skeleton/__tests__/index.test.tsx | 43 +++++- .../__snapshots__/index.test.tsx.snap | 35 +++++ semcore/slider/__tests__/index.test.tsx | 16 +++ .../__snapshots__/index.test.tsx.snap | 37 +++++ .../spin-container/__tests__/index.test.tsx | 21 ++- .../__snapshots__/index.test.tsx.snap | 18 +++ semcore/spin/__tests__/index.test.tsx | 14 +- .../__snapshots__/index.test.tsx.snap | 35 +++++ semcore/switch/__tests__/index.test.tsx | 14 ++ .../__snapshots__/index.test.tsx.snap | 27 ++++ semcore/tab-line/__tests__/index.test.tsx | 15 ++ .../__snapshots__/index.test.tsx.snap | 27 ++++ semcore/tab-panel/__tests__/index.test.tsx | 15 ++ .../__snapshots__/index.test.tsx.snap | 83 +++++++++++ semcore/tag/__tests__/index.test.tsx | 32 +++++ .../__snapshots__/index.test.tsx.snap | 13 ++ semcore/textarea/__tests__/index.test.tsx | 6 + .../__snapshots__/index.test.tsx.snap | 51 +++++++ semcore/time-picker/__tests__/index.test.tsx | 22 ++- .../__snapshots__/index.test.jsx.snap | 49 +++++++ semcore/tooltip/__tests__/index.test.jsx | 37 +++++ .../__snapshots__/index.test.tsx.snap | 49 +++++++ semcore/typography/__tests__/index.test.tsx | 24 +++- .../__snapshots__/index.test.tsx.snap | 82 +++++++++++ semcore/widget-empty/__tests__/index.test.tsx | 35 ++++- .../__snapshots__/index.test.tsx.snap | 133 ++++++++++++++++++ semcore/wizard/__tests__/index.test.tsx | 22 +++ 30 files changed, 1133 insertions(+), 6 deletions(-) create mode 100644 semcore/side-panel/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/skeleton/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/slider/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/spin-container/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/spin/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/switch/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/tab-line/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/tab-panel/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/tag/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/textarea/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/time-picker/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/tooltip/__tests__/__snapshots__/index.test.jsx.snap create mode 100644 semcore/typography/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/widget-empty/__tests__/__snapshots__/index.test.tsx.snap create mode 100644 semcore/wizard/__tests__/__snapshots__/index.test.tsx.snap diff --git a/semcore/side-panel/__tests__/__snapshots__/index.test.tsx.snap b/semcore/side-panel/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..67cb1fce74 --- /dev/null +++ b/semcore/side-panel/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,86 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SidePanel > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "ArrowLeft", + }, + ], + "uiName": "Link.Addon", + }, + { + "children": [], + "uiName": "ButtonLink.Text", + }, + ], + "uiName": "SidePanel.Back.InnerWrapper", + }, + ], + "uiName": "SidePanel.Back", + }, + { + "children": [], + "uiName": "SidePanel.Title", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Button.Text", + }, + ], + "uiName": "SidePanel.Close.InnerWrapper", + }, + ], + "uiName": "SidePanel.Close", + }, + ], + "uiName": "SidePanel.Header", + }, + { + "children": [], + "uiName": "SidePanel.Body", + }, + { + "children": [], + "uiName": "SidePanel.Footer", + }, + ], + "uiName": "SidePanel.Panel", + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SidePanel.Overlay", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/side-panel/__tests__/index.test.tsx b/semcore/side-panel/__tests__/index.test.tsx index 0792c7eb62..c299eb52be 100644 --- a/semcore/side-panel/__tests__/index.test.tsx +++ b/semcore/side-panel/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import { Portal } from '@semcore/base-components'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -13,6 +14,27 @@ describe('side-panel Dependency imports', () => { describe('SidePanel', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const sidePanel = ( + + + + + Back + Title + Close + + Body + Footer + + + + ); + + const { container } = render(sidePanel); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test('Verify visible property', () => { const component = render(Content); expect(component.queryByText('Content')).toBeNull(); diff --git a/semcore/skeleton/__tests__/__snapshots__/index.test.tsx.snap b/semcore/skeleton/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..d589cb4fbd --- /dev/null +++ b/semcore/skeleton/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,76 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Skeleton > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "SkeletonSVG.Text", + }, + { + "children": [], + "uiName": "SkeletonSVG.Text", + }, + ], + "uiName": null, + }, + ], + "uiName": null, + }, + { + "children": [], + "uiName": null, + }, + ], + "uiName": "SkeletonSVG", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/skeleton/__tests__/index.test.tsx b/semcore/skeleton/__tests__/index.test.tsx index abe8922952..c58dce48ab 100644 --- a/semcore/skeleton/__tests__/index.test.tsx +++ b/semcore/skeleton/__tests__/index.test.tsx @@ -1,6 +1,47 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { render } from '@semcore/testing-utils/testing-library'; +import { describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import SkeletonSVG, { + AreaChartSkeleton, + BarChartSkeleton, + BubbleChartSkeleton, + CompactHorizontalBarChartSkeleton, + DonutChartSkeleton, + HistogramChartSkeleton, + LineChartSkeleton, + RadialTreeChartSkeleton, + ScatterPlotChartSkeleton, + VennChartSkeleton, +} from '../src'; describe('skeleton Dependency imports', () => { runDependencyCheckTests('skeleton'); }); + +describe('Skeleton', () => { + test('Verify data-ui-name', () => { + const skeletons = ( + <> + + + + + + + + + + + + + + + ); + + const { container } = render(skeletons); + expect(extractUIName(container)).toMatchSnapshot(); + }); +}); diff --git a/semcore/slider/__tests__/__snapshots__/index.test.tsx.snap b/semcore/slider/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..17b2a9a5b5 --- /dev/null +++ b/semcore/slider/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,35 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Slider > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Slider.Bar", + }, + { + "children": [], + "uiName": "Slider.Knob", + }, + { + "children": [ + { + "children": [], + "uiName": "Slider.Item", + }, + ], + "uiName": "Slider.Options", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": "Slider", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/slider/__tests__/index.test.tsx b/semcore/slider/__tests__/index.test.tsx index edfef6bd17..70a42d262e 100644 --- a/semcore/slider/__tests__/index.test.tsx +++ b/semcore/slider/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,21 @@ describe('slider Dependency imports', () => { describe('Slider', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const slider = ( + + + + + + + + ); + + const { container } = render(slider); + expect(extractUIName(container)).toMatchSnapshot(); + }); + const focusSlider = async (slider: HTMLElement) => { await userEvent.tab(); expect(slider).toHaveFocus(); diff --git a/semcore/spin-container/__tests__/__snapshots__/index.test.tsx.snap b/semcore/spin-container/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..1b49f41f89 --- /dev/null +++ b/semcore/spin-container/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,37 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SpinContainer > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "SpinContainer.Content", + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Spin", + }, + ], + "uiName": "SpinContainer.Overlay", + }, + ], + "uiName": "FadeInOut", + }, + ], + "uiName": "SpinContainer", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/spin-container/__tests__/index.test.tsx b/semcore/spin-container/__tests__/index.test.tsx index 99c42db3e3..ed88eecc8c 100644 --- a/semcore/spin-container/__tests__/index.test.tsx +++ b/semcore/spin-container/__tests__/index.test.tsx @@ -1,6 +1,25 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { render } from '@semcore/testing-utils/testing-library'; +import { describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import SpinContainer from '../src'; describe('spin-container Dependency imports', () => { runDependencyCheckTests('spin-container'); }); + +describe('SpinContainer', () => { + test('Verify data-ui-name', () => { + const spinContainer = ( + + Content + + + ); + + const { container } = render(spinContainer); + expect(extractUIName(container)).toMatchSnapshot(); + }); +}); diff --git a/semcore/spin/__tests__/__snapshots__/index.test.tsx.snap b/semcore/spin/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..3c533d6bf6 --- /dev/null +++ b/semcore/spin/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,18 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Spin > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Spin", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/spin/__tests__/index.test.tsx b/semcore/spin/__tests__/index.test.tsx index 6f0c011907..23c8144ffa 100644 --- a/semcore/spin/__tests__/index.test.tsx +++ b/semcore/spin/__tests__/index.test.tsx @@ -1,6 +1,18 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; -import { describe } from '@semcore/testing-utils/vitest'; +import { render } from '@semcore/testing-utils/testing-library'; +import { describe, expect, test } from '@semcore/testing-utils/vitest'; +import React from 'react'; + +import Spin from '../src'; describe('spin Dependency imports', () => { runDependencyCheckTests('spin'); }); + +describe('Spin', () => { + test('Verify data-ui-name', () => { + const { container } = render(); + expect(extractUIName(container)).toMatchSnapshot(); + }); +}); diff --git a/semcore/switch/__tests__/__snapshots__/index.test.tsx.snap b/semcore/switch/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..373d0a5a05 --- /dev/null +++ b/semcore/switch/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,35 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Switch > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Switch.Addon", + }, + { + "children": [ + { + "children": [], + "uiName": "Switch.Value", + }, + { + "children": [], + "uiName": "Box", + }, + ], + "uiName": "Box", + }, + { + "children": [], + "uiName": "Switch.Addon", + }, + ], + "uiName": "Switch", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/switch/__tests__/index.test.tsx b/semcore/switch/__tests__/index.test.tsx index af13f2cc63..7ba9849af7 100644 --- a/semcore/switch/__tests__/index.test.tsx +++ b/semcore/switch/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,19 @@ describe('switch Dependency imports', () => { describe('Switch', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const switchComponent = ( + + Before + + After + + ); + + const { container } = render(switchComponent); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test('Verify supports onChange callback', async () => { const spy = vi.fn(); const { getByTestId } = render( diff --git a/semcore/tab-line/__tests__/__snapshots__/index.test.tsx.snap b/semcore/tab-line/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..18a7fefcdb --- /dev/null +++ b/semcore/tab-line/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,27 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`TabLine > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "TabLine.Item.Addon", + }, + { + "children": [], + "uiName": "TabLine.Item.Text", + }, + ], + "uiName": "TabLine.Item", + }, + ], + "uiName": "TabLine", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/tab-line/__tests__/index.test.tsx b/semcore/tab-line/__tests__/index.test.tsx index 0befe891c4..9436e9fca2 100644 --- a/semcore/tab-line/__tests__/index.test.tsx +++ b/semcore/tab-line/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import type { Intergalactic } from '@semcore/core'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi, assertType } from '@semcore/testing-utils/vitest'; @@ -29,6 +30,20 @@ describe('TabLine', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const tabLine = ( + + + + Item + + + ); + + const { container } = render(tabLine); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test('Verify supports onChange callback', async () => { const spyChange = vi.fn(); const spyClick = vi.fn(); diff --git a/semcore/tab-panel/__tests__/__snapshots__/index.test.tsx.snap b/semcore/tab-panel/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..cb949818f8 --- /dev/null +++ b/semcore/tab-panel/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,27 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`TabPanel > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "TabPanel.Item.Addon", + }, + { + "children": [], + "uiName": "TabPanel.Item.Text", + }, + ], + "uiName": "TabPanel.Item", + }, + ], + "uiName": "TabPanel", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/tab-panel/__tests__/index.test.tsx b/semcore/tab-panel/__tests__/index.test.tsx index 8e2b474110..86b9841219 100644 --- a/semcore/tab-panel/__tests__/index.test.tsx +++ b/semcore/tab-panel/__tests__/index.test.tsx @@ -1,4 +1,5 @@ import type { Intergalactic } from '@semcore/core'; +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi, assertType } from '@semcore/testing-utils/vitest'; @@ -29,6 +30,20 @@ describe('TabPanel', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const tabPanel = ( + + + + Item + + + ); + + const { container } = render(tabPanel); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test('Verify supports onChange callback', async () => { const spyChange = vi.fn(); const spyClick = vi.fn(); diff --git a/semcore/tag/__tests__/__snapshots__/index.test.tsx.snap b/semcore/tag/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..1bee0322fa --- /dev/null +++ b/semcore/tag/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,83 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Tag > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [], + "uiName": "Tag.Circle", + }, + { + "children": [], + "uiName": "Tag.Addon", + }, + { + "children": [], + "uiName": "Tag.Text", + }, + ], + "uiName": "Tag", + }, + ], + "uiName": null, +} +`; + +exports[`TagContainer > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": "TagContainer.Circle", + }, + ], + "uiName": "Box", + }, + { + "children": [], + "uiName": "TagContainer.Addon", + }, + { + "children": [ + { + "children": [], + "uiName": "Tag.Circle", + }, + { + "children": [], + "uiName": "Tag.Addon", + }, + { + "children": [], + "uiName": "Tag.Text", + }, + ], + "uiName": "TagContainer.Tag", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "uiName": null, + }, + ], + "uiName": "Close", + }, + ], + "uiName": "TagContainer.Close", + }, + ], + "uiName": "TagContainer", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/tag/__tests__/index.test.tsx b/semcore/tag/__tests__/index.test.tsx index 79a9f55c99..c075aae1cb 100644 --- a/semcore/tag/__tests__/index.test.tsx +++ b/semcore/tag/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { render, cleanup, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,19 @@ describe('tag Dependency imports', () => { describe('Tag', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const tag = ( + + + + Tag + + ); + + const { container } = render(tag); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test('Verify works as Button from keyboard', async () => { const onClick = vi.fn(); const { getByTestId } = render( @@ -54,6 +68,24 @@ describe('Tag', () => { describe('TagContainer', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const tagContainer = ( + + + + + + + Tag + + + + ); + + const { container } = render(tagContainer); + expect(extractUIName(container)).toMatchSnapshot(); + }); + test.sequential('Verify calls onClick', async () => { const onClick = vi.fn(); const { getByTestId } = render( diff --git a/semcore/textarea/__tests__/__snapshots__/index.test.tsx.snap b/semcore/textarea/__tests__/__snapshots__/index.test.tsx.snap new file mode 100644 index 0000000000..7f3eb44d91 --- /dev/null +++ b/semcore/textarea/__tests__/__snapshots__/index.test.tsx.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Textarea > Verify data-ui-name 1`] = ` +{ + "children": [ + { + "children": [], + "uiName": "Textarea", + }, + ], + "uiName": null, +} +`; diff --git a/semcore/textarea/__tests__/index.test.tsx b/semcore/textarea/__tests__/index.test.tsx index 429910dd5c..4e3c6e8840 100644 --- a/semcore/textarea/__tests__/index.test.tsx +++ b/semcore/textarea/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +import { extractUIName } from '@semcore/testing-utils/shared/extractUINameTree.ts'; import { runDependencyCheckTests } from '@semcore/testing-utils/shared-tests'; import { cleanup, render, userEvent } from '@semcore/testing-utils/testing-library'; import { expect, test, describe, beforeEach, vi } from '@semcore/testing-utils/vitest'; @@ -12,6 +13,11 @@ describe('textarea Dependency imports', () => { describe('Textarea', () => { beforeEach(cleanup); + test('Verify data-ui-name', () => { + const { container } = render(