Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 107 additions & 0 deletions semcore/carousel/__tests__/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,110 @@ exports[`Carousel > Verify data-ui-name 1`] = `
"uiName": null,
}
`;

exports[`Carousel > Verify data-ui-name 2`] = `
{
"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,
}
`;
14 changes: 14 additions & 0 deletions semcore/carousel/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ describe('Carousel', () => {
expect(result).toMatchSnapshot();
});

test('Verify data-ui-name', () => {
const carousel = (
<Carousel>
<Carousel.Item />
<Carousel.Item />
</Carousel>
);

const { container } = render(carousel);
const result = extractUIName(container);

expect(result).toMatchSnapshot();
});

test('Verify control mode', () => {
const spy = vi.fn();

Expand Down
30 changes: 30 additions & 0 deletions semcore/drag-and-drop/__tests__/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -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,
}
`;
32 changes: 31 additions & 1 deletion semcore/drag-and-drop/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
@@ -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 = (
<DragAndDrop aria-label='Sortable list' onDnD={() => {}}>
<DragAndDrop.Draggable id='first' aria-label='First item'>
First item
</DragAndDrop.Draggable>
<DragAndDrop.Draggable id='second' aria-label='Second item'>
Second item
</DragAndDrop.Draggable>
<DragAndDrop.DropZone aria-label='Drop zone'>
Drop zone
</DragAndDrop.DropZone>
</DragAndDrop>
);

const { container } = render(dragAndDrop);
const result = extractUIName(container);

expect(result).toMatchSnapshot();
});
});
132 changes: 132 additions & 0 deletions semcore/dropdown-menu/__tests__/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
// 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",
},
{
"children": [],
"uiName": "Box",
},
],
"uiName": null,
},
],
"uiName": "ScrollArea.Container",
},
],
"uiName": "DropdownMenu.Menu",
},
],
"uiName": "DropdownMenu.Popper",
},
{
"children": [],
"uiName": null,
},
],
"uiName": null,
}
`;
Loading
Loading