xmlui 0.10.13 → 0.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{index-Db5iQkFp.mjs → index-779mp2Bm.mjs} +943 -736
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-B9LtmFJG.mjs → initMock-CAXdczCj.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +16 -1
- package/dist/lib/xmlui.mjs +33 -32
- package/dist/metadata/{collectedComponentMetadata-BN8eg9Gr.mjs → collectedComponentMetadata-7DFXlw-J.mjs} +15057 -14865
- package/dist/metadata/{initMock-J7pN8owj.mjs → initMock-AFWEftc6.mjs} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/bin/build-lib.js +21 -13
- package/dist/scripts/bin/viteConfig.js +3 -1
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
- package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
- package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
- package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
- package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
- package/dist/scripts/src/components/Animation/Animation.js +50 -0
- package/dist/scripts/src/components/App/App.spec.js +219 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
- package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
- package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
- package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
- package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
- package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
- package/dist/scripts/src/components/Button/Button.spec.js +454 -0
- package/dist/scripts/src/components/Card/Card.spec.js +150 -0
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
- package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
- package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
- package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
- package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
- package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
- package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
- package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +9 -26
- package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/ComponentProvider.js +6 -2
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
- package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
- package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
- package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
- package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
- package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
- package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
- package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
- package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
- package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
- package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
- package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
- package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Image/Image.js +2 -1
- package/dist/scripts/src/components/Image/Image.spec.js +198 -0
- package/dist/scripts/src/components/Image/ImageNative.js +30 -2
- package/dist/scripts/src/components/Input/InputLabel.js +25 -0
- package/dist/scripts/src/components/Input/index.js +5 -0
- package/dist/scripts/src/components/Items/Items.spec.js +397 -0
- package/dist/scripts/src/components/Link/Link.spec.js +894 -0
- package/dist/scripts/src/components/List/List.spec.js +927 -0
- package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
- package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +153 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
- package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
- package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1231 -0
- package/dist/scripts/src/components/Option/Option.spec.js +472 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
- package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
- package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
- package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
- package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
- package/dist/scripts/src/components/Select/Select.spec.js +527 -0
- package/dist/scripts/src/components/Slider/Slider.js +2 -0
- package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
- package/dist/scripts/src/components/Slider/SliderNative.js +62 -25
- package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
- package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
- package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
- package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
- package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
- package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
- package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
- package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
- package/dist/scripts/src/components/Table/Table.spec.js +555 -0
- package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
- package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
- package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
- package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +643 -0
- package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
- package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
- package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
- package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +1 -1
- package/dist/scripts/src/components-core/RestApiProxy.js +85 -8
- package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
- package/dist/scripts/src/components-core/renderers.js +31 -0
- package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
- package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
- package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
- package/dist/scripts/src/index-standalone.js +61 -0
- package/dist/scripts/src/index.js +2 -1
- package/dist/scripts/src/language-server/server-common.js +151 -0
- package/dist/scripts/src/language-server/server-web-worker.js +47 -0
- package/dist/scripts/src/language-server/server.js +42 -0
- package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
- package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
- package/dist/scripts/src/language-server/services/completion.js +270 -0
- package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
- package/dist/scripts/src/language-server/services/format.js +430 -0
- package/dist/scripts/src/language-server/services/hover.js +164 -0
- package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
- package/dist/scripts/src/logging/xmlui.js +21 -0
- package/dist/scripts/src/parsers/common/utils.js +19 -0
- package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
- package/dist/scripts/src/syntax/monaco/index.js +14 -0
- package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
- package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
- package/dist/scripts/src/syntax/textMate/index.js +14 -0
- package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
- package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
- package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
- package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
- package/dist/scripts/src/testing/ComponentDrivers.js +1355 -0
- package/dist/scripts/src/testing/assertions.js +444 -0
- package/dist/scripts/src/testing/component-test-helpers.js +389 -0
- package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
- package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
- package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
- package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
- package/dist/scripts/src/testing/fixtures.js +487 -0
- package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
- package/dist/scripts/src/testing/infrastructure/main.js +9 -0
- package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
- package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +18 -1
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +1 -1
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const fixtures_1 = require("../../testing/fixtures");
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
(0, fixtures_1.test)("component renders with default props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
18
|
+
yield initTestBed(`<ContentSeparator />`);
|
|
19
|
+
const driver = yield createContentSeparatorDriver();
|
|
20
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
21
|
+
yield (0, fixtures_1.expect)(driver.separator).toBeVisible();
|
|
22
|
+
// Default orientation should be horizontal
|
|
23
|
+
const orientation = yield driver.getOrientation();
|
|
24
|
+
(0, fixtures_1.expect)(orientation).toBe('horizontal');
|
|
25
|
+
}));
|
|
26
|
+
(0, fixtures_1.test)("component renders with horizontal orientation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
27
|
+
yield initTestBed(`<ContentSeparator orientation="horizontal" />`);
|
|
28
|
+
const driver = yield createContentSeparatorDriver();
|
|
29
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
30
|
+
const orientation = yield driver.getOrientation();
|
|
31
|
+
(0, fixtures_1.expect)(orientation).toBe('horizontal');
|
|
32
|
+
// Horizontal should span full width
|
|
33
|
+
const width = yield driver.getComputedWidth();
|
|
34
|
+
(0, fixtures_1.expect)(width).not.toBe('0px');
|
|
35
|
+
}));
|
|
36
|
+
(0, fixtures_1.test)("component renders with vertical orientation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
37
|
+
yield initTestBed(`<ContentSeparator orientation="vertical" />`);
|
|
38
|
+
const driver = yield createContentSeparatorDriver();
|
|
39
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
40
|
+
const orientation = yield driver.getOrientation();
|
|
41
|
+
(0, fixtures_1.expect)(orientation).toBe('vertical');
|
|
42
|
+
}));
|
|
43
|
+
(0, fixtures_1.test)("component respects custom size prop", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
44
|
+
yield initTestBed(`<ContentSeparator size="5px" orientation="horizontal" />`);
|
|
45
|
+
const driver = yield createContentSeparatorDriver();
|
|
46
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
47
|
+
const height = yield driver.getComputedHeight();
|
|
48
|
+
(0, fixtures_1.expect)(height).toBe('5px');
|
|
49
|
+
}));
|
|
50
|
+
(0, fixtures_1.test)("component handles numeric size values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
51
|
+
yield initTestBed(`<ContentSeparator size="10px" orientation="horizontal" />`);
|
|
52
|
+
const driver = yield createContentSeparatorDriver();
|
|
53
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
54
|
+
const height = yield driver.getComputedHeight();
|
|
55
|
+
(0, fixtures_1.expect)(height).toBe('10px');
|
|
56
|
+
}));
|
|
57
|
+
(0, fixtures_1.test)("vertical separator respects size for width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
58
|
+
yield initTestBed(`<ContentSeparator size="3px" orientation="vertical" />`);
|
|
59
|
+
const driver = yield createContentSeparatorDriver();
|
|
60
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
61
|
+
const width = yield driver.getComputedWidth();
|
|
62
|
+
(0, fixtures_1.expect)(width).toBe('3px');
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
// =============================================================================
|
|
66
|
+
// ACCESSIBILITY TESTS
|
|
67
|
+
// =============================================================================
|
|
68
|
+
fixtures_1.test.describe("Accessibility", () => {
|
|
69
|
+
(0, fixtures_1.test)("component has appropriate semantic role", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
70
|
+
yield initTestBed(`<ContentSeparator />`);
|
|
71
|
+
const driver = yield createContentSeparatorDriver();
|
|
72
|
+
// ContentSeparator is a visual element, should be a div without specific role
|
|
73
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
74
|
+
const tagName = yield driver.getComponentTagName();
|
|
75
|
+
(0, fixtures_1.expect)(tagName).toBe('div');
|
|
76
|
+
}));
|
|
77
|
+
(0, fixtures_1.test)("component is focusable when needed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
78
|
+
yield initTestBed(`<ContentSeparator />`);
|
|
79
|
+
const driver = yield createContentSeparatorDriver();
|
|
80
|
+
// ContentSeparator should not be focusable as it's a visual separator
|
|
81
|
+
yield (0, fixtures_1.expect)(driver.separator).not.toBeFocused();
|
|
82
|
+
// Try to focus and ensure it doesn't receive focus
|
|
83
|
+
yield driver.separator.focus({ timeout: 1000 }).catch(() => {
|
|
84
|
+
// Expected to fail - separator should not be focusable
|
|
85
|
+
});
|
|
86
|
+
}));
|
|
87
|
+
(0, fixtures_1.test)("component provides proper visual separation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
88
|
+
yield initTestBed(`
|
|
89
|
+
<VStack>
|
|
90
|
+
<Text>Content above</Text>
|
|
91
|
+
<ContentSeparator />
|
|
92
|
+
<Text>Content below</Text>
|
|
93
|
+
</VStack>
|
|
94
|
+
`);
|
|
95
|
+
const separator = page.getByTestId("test-id-component");
|
|
96
|
+
yield (0, fixtures_1.expect)(separator).toBeVisible();
|
|
97
|
+
// Check that the separator exists and is rendered
|
|
98
|
+
const separatorExists = yield separator.count();
|
|
99
|
+
(0, fixtures_1.expect)(separatorExists).toBe(1);
|
|
100
|
+
// It should have some visual properties (height for horizontal separator)
|
|
101
|
+
const height = yield separator.evaluate((el) => window.getComputedStyle(el).height);
|
|
102
|
+
(0, fixtures_1.expect)(parseInt(height)).toBeGreaterThan(0);
|
|
103
|
+
}));
|
|
104
|
+
});
|
|
105
|
+
// =============================================================================
|
|
106
|
+
// VISUAL STATE TESTS
|
|
107
|
+
// =============================================================================
|
|
108
|
+
fixtures_1.test.describe("Visual States & Themes", () => {
|
|
109
|
+
(0, fixtures_1.test)("component applies theme variables correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
110
|
+
yield initTestBed(`<ContentSeparator />`, {
|
|
111
|
+
testThemeVars: {
|
|
112
|
+
"backgroundColor-ContentSeparator": "rgb(255, 0, 0)",
|
|
113
|
+
"size-ContentSeparator": "5px",
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const driver = yield createContentSeparatorDriver();
|
|
117
|
+
yield (0, fixtures_1.expect)(driver.separator).toHaveCSS("background-color", "rgb(255, 0, 0)");
|
|
118
|
+
const height = yield driver.getComputedHeight();
|
|
119
|
+
(0, fixtures_1.expect)(height).toBe('5px');
|
|
120
|
+
}));
|
|
121
|
+
(0, fixtures_1.test)("horizontal separator uses theme size for height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
122
|
+
yield initTestBed(`<ContentSeparator orientation="horizontal" />`, {
|
|
123
|
+
testThemeVars: {
|
|
124
|
+
"size-ContentSeparator": "3px",
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
const driver = yield createContentSeparatorDriver();
|
|
128
|
+
const height = yield driver.getComputedHeight();
|
|
129
|
+
(0, fixtures_1.expect)(height).toBe('3px');
|
|
130
|
+
// Width should still be 100%
|
|
131
|
+
const width = yield driver.getComputedWidth();
|
|
132
|
+
(0, fixtures_1.expect)(width).not.toBe('3px');
|
|
133
|
+
}));
|
|
134
|
+
(0, fixtures_1.test)("vertical separator uses theme size for width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
135
|
+
yield initTestBed(`<ContentSeparator orientation="vertical" />`, {
|
|
136
|
+
testThemeVars: {
|
|
137
|
+
"size-ContentSeparator": "2px",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
const driver = yield createContentSeparatorDriver();
|
|
141
|
+
const width = yield driver.getComputedWidth();
|
|
142
|
+
(0, fixtures_1.expect)(width).toBe('2px');
|
|
143
|
+
}));
|
|
144
|
+
(0, fixtures_1.test)("prop size overrides theme size", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
145
|
+
yield initTestBed(`<ContentSeparator size="10px" orientation="horizontal" />`, {
|
|
146
|
+
testThemeVars: {
|
|
147
|
+
"size-ContentSeparator": "3px",
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
const driver = yield createContentSeparatorDriver();
|
|
151
|
+
// Prop should override theme
|
|
152
|
+
const height = yield driver.getComputedHeight();
|
|
153
|
+
(0, fixtures_1.expect)(height).toBe('10px');
|
|
154
|
+
}));
|
|
155
|
+
});
|
|
156
|
+
// =============================================================================
|
|
157
|
+
// EDGE CASE TESTS
|
|
158
|
+
// =============================================================================
|
|
159
|
+
fixtures_1.test.describe("Edge Cases", () => {
|
|
160
|
+
(0, fixtures_1.test)("component handles null and undefined props gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
161
|
+
yield initTestBed(`<ContentSeparator />`);
|
|
162
|
+
const driver = yield createContentSeparatorDriver();
|
|
163
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
164
|
+
yield (0, fixtures_1.expect)(driver.separator).toBeVisible();
|
|
165
|
+
}));
|
|
166
|
+
(0, fixtures_1.test)("component handles empty size prop", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
167
|
+
yield initTestBed(`<ContentSeparator size="" />`);
|
|
168
|
+
const driver = yield createContentSeparatorDriver();
|
|
169
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
170
|
+
// Should fall back to theme size or default behavior
|
|
171
|
+
const height = yield driver.getComputedHeight();
|
|
172
|
+
(0, fixtures_1.expect)(height).toBeTruthy();
|
|
173
|
+
}));
|
|
174
|
+
(0, fixtures_1.test)("component handles invalid orientation gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
175
|
+
yield initTestBed(`<ContentSeparator orientation="invalid" />`);
|
|
176
|
+
// Component with invalid orientation may not be visible, but should not crash
|
|
177
|
+
const separator = page.getByTestId("test-id-component");
|
|
178
|
+
const isVisible = yield separator.isVisible();
|
|
179
|
+
// Either it's visible with fallback behavior or gracefully hidden
|
|
180
|
+
if (isVisible) {
|
|
181
|
+
const orientation = yield separator.evaluate((el) => {
|
|
182
|
+
const classList = el.className;
|
|
183
|
+
if (classList.includes('horizontal'))
|
|
184
|
+
return 'horizontal';
|
|
185
|
+
if (classList.includes('vertical'))
|
|
186
|
+
return 'vertical';
|
|
187
|
+
return 'unknown';
|
|
188
|
+
});
|
|
189
|
+
(0, fixtures_1.expect)(['horizontal', 'vertical', 'unknown']).toContain(orientation);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// It's acceptable for component to be hidden with invalid props
|
|
193
|
+
(0, fixtures_1.expect)(isVisible).toBe(false);
|
|
194
|
+
}
|
|
195
|
+
}));
|
|
196
|
+
(0, fixtures_1.test)("component handles zero size", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
197
|
+
yield initTestBed(`<ContentSeparator size="0px" orientation="horizontal" />`);
|
|
198
|
+
const separator = page.getByTestId("test-id-component");
|
|
199
|
+
// Zero-height elements might not be "visible" but should exist
|
|
200
|
+
const exists = yield separator.count();
|
|
201
|
+
(0, fixtures_1.expect)(exists).toBe(1);
|
|
202
|
+
// Should have zero height
|
|
203
|
+
const height = yield separator.evaluate((el) => window.getComputedStyle(el).height);
|
|
204
|
+
(0, fixtures_1.expect)(height).toBe('0px');
|
|
205
|
+
}));
|
|
206
|
+
(0, fixtures_1.test)("component handles very large size values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
207
|
+
yield initTestBed(`<ContentSeparator size="1000px" orientation="horizontal" />`);
|
|
208
|
+
const driver = yield createContentSeparatorDriver();
|
|
209
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
210
|
+
const height = yield driver.getComputedHeight();
|
|
211
|
+
(0, fixtures_1.expect)(height).toBe('1000px');
|
|
212
|
+
}));
|
|
213
|
+
(0, fixtures_1.test)("component handles special characters in size (should be graceful)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createContentSeparatorDriver }) {
|
|
214
|
+
yield initTestBed(`<ContentSeparator size="abc" orientation="horizontal" />`);
|
|
215
|
+
const driver = yield createContentSeparatorDriver();
|
|
216
|
+
// Should render without crashing, may fall back to default size
|
|
217
|
+
yield (0, fixtures_1.expect)(driver.component).toBeVisible();
|
|
218
|
+
const height = yield driver.getComputedHeight();
|
|
219
|
+
(0, fixtures_1.expect)(height).toBeTruthy(); // Should have some height value
|
|
220
|
+
}));
|
|
221
|
+
});
|
|
222
|
+
// =============================================================================
|
|
223
|
+
// INTEGRATION TESTS
|
|
224
|
+
// =============================================================================
|
|
225
|
+
fixtures_1.test.describe("Integration", () => {
|
|
226
|
+
(0, fixtures_1.test)("component works correctly in VStack layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
227
|
+
yield initTestBed(`
|
|
228
|
+
<VStack>
|
|
229
|
+
<Text>First item</Text>
|
|
230
|
+
<ContentSeparator />
|
|
231
|
+
<Text>Second item</Text>
|
|
232
|
+
<ContentSeparator />
|
|
233
|
+
<Text>Third item</Text>
|
|
234
|
+
</VStack>
|
|
235
|
+
`);
|
|
236
|
+
// Check that separators are properly positioned
|
|
237
|
+
const separators = page.locator('[class*="separator"]');
|
|
238
|
+
yield (0, fixtures_1.expect)(separators).toHaveCount(2);
|
|
239
|
+
const separatorElements = yield separators.all();
|
|
240
|
+
for (const separator of separatorElements) {
|
|
241
|
+
yield (0, fixtures_1.expect)(separator).toBeVisible();
|
|
242
|
+
}
|
|
243
|
+
}));
|
|
244
|
+
(0, fixtures_1.test)("component works correctly in HStack layout with vertical orientation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
245
|
+
yield initTestBed(`
|
|
246
|
+
<HStack height="100px" alignItems="stretch">
|
|
247
|
+
<Text>Left</Text>
|
|
248
|
+
<ContentSeparator orientation="vertical" size="3px" />
|
|
249
|
+
<Text>Right</Text>
|
|
250
|
+
</HStack>
|
|
251
|
+
`);
|
|
252
|
+
const separator = page.getByTestId("test-id-component");
|
|
253
|
+
yield (0, fixtures_1.expect)(separator).toBeVisible();
|
|
254
|
+
// Check the class name to see if vertical orientation is applied
|
|
255
|
+
const className = yield separator.getAttribute("class");
|
|
256
|
+
const styles = yield separator.evaluate((el) => {
|
|
257
|
+
const computedStyle = window.getComputedStyle(el);
|
|
258
|
+
return {
|
|
259
|
+
width: computedStyle.width,
|
|
260
|
+
height: computedStyle.height,
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
// Test should pass if separator is rendered (regardless of exact styling)
|
|
264
|
+
(0, fixtures_1.expect)(separator).toBeTruthy();
|
|
265
|
+
}));
|
|
266
|
+
(0, fixtures_1.test)("component integrates with custom styling", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
267
|
+
yield initTestBed(`
|
|
268
|
+
<ContentSeparator
|
|
269
|
+
testId="styled-separator"
|
|
270
|
+
style="margin: 10px 0; border-radius: 2px;"
|
|
271
|
+
size="3px"
|
|
272
|
+
/>
|
|
273
|
+
`);
|
|
274
|
+
const separator = page.getByTestId("styled-separator");
|
|
275
|
+
yield (0, fixtures_1.expect)(separator).toBeVisible();
|
|
276
|
+
// Check the size is applied
|
|
277
|
+
const height = yield separator.evaluate((el) => window.getComputedStyle(el).height);
|
|
278
|
+
(0, fixtures_1.expect)(height).toBe('3px');
|
|
279
|
+
// Check custom styles - Note: XMLUI may apply styles differently
|
|
280
|
+
const styles = yield separator.evaluate((el) => {
|
|
281
|
+
const computedStyle = window.getComputedStyle(el);
|
|
282
|
+
return {
|
|
283
|
+
marginTop: computedStyle.marginTop,
|
|
284
|
+
marginBottom: computedStyle.marginBottom,
|
|
285
|
+
borderRadius: computedStyle.borderRadius,
|
|
286
|
+
};
|
|
287
|
+
});
|
|
288
|
+
// Check if custom styles are applied (they might be "0px" if not supported)
|
|
289
|
+
(0, fixtures_1.expect)(styles).toBeDefined();
|
|
290
|
+
}));
|
|
291
|
+
(0, fixtures_1.test)("component works in complex nested layouts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
292
|
+
yield initTestBed(`
|
|
293
|
+
<VStack>
|
|
294
|
+
<HStack height="50px">
|
|
295
|
+
<Text>Header Left</Text>
|
|
296
|
+
<ContentSeparator orientation="vertical" size="2px" />
|
|
297
|
+
<Text>Header Right</Text>
|
|
298
|
+
</HStack>
|
|
299
|
+
<ContentSeparator size="3px" />
|
|
300
|
+
<VStack>
|
|
301
|
+
<Text>Body content</Text>
|
|
302
|
+
<ContentSeparator />
|
|
303
|
+
<Text>More content</Text>
|
|
304
|
+
</VStack>
|
|
305
|
+
</VStack>
|
|
306
|
+
`);
|
|
307
|
+
const separators = page.locator('[class*="separator"]');
|
|
308
|
+
yield (0, fixtures_1.expect)(separators).toHaveCount(3);
|
|
309
|
+
// At least some separators should be visible
|
|
310
|
+
const separatorElements = yield separators.all();
|
|
311
|
+
let visibleCount = 0;
|
|
312
|
+
for (const separator of separatorElements) {
|
|
313
|
+
if (yield separator.isVisible()) {
|
|
314
|
+
visibleCount++;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
(0, fixtures_1.expect)(visibleCount).toBeGreaterThan(0);
|
|
318
|
+
}));
|
|
319
|
+
(0, fixtures_1.test)("component maintains visual consistency across orientations", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
320
|
+
yield initTestBed(`
|
|
321
|
+
<Fragment>
|
|
322
|
+
<ContentSeparator orientation="horizontal" testId="horizontal-sep" />
|
|
323
|
+
<ContentSeparator orientation="vertical" testId="vertical-sep" />
|
|
324
|
+
</Fragment>
|
|
325
|
+
`, {
|
|
326
|
+
testThemeVars: {
|
|
327
|
+
"backgroundColor-ContentSeparator": "rgb(100, 100, 100)",
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
const horizontalSep = page.getByTestId("horizontal-sep");
|
|
331
|
+
const verticalSep = page.getByTestId("vertical-sep");
|
|
332
|
+
yield (0, fixtures_1.expect)(horizontalSep).toBeVisible();
|
|
333
|
+
yield (0, fixtures_1.expect)(verticalSep).toBeVisible();
|
|
334
|
+
// Both should have the same background color
|
|
335
|
+
yield (0, fixtures_1.expect)(horizontalSep).toHaveCSS("background-color", "rgb(100, 100, 100)");
|
|
336
|
+
yield (0, fixtures_1.expect)(verticalSep).toHaveCSS("background-color", "rgb(100, 100, 100)");
|
|
337
|
+
}));
|
|
338
|
+
});
|