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.
Files changed (186) hide show
  1. package/dist/lib/{index-Db5iQkFp.mjs → index-779mp2Bm.mjs} +943 -736
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-B9LtmFJG.mjs → initMock-CAXdczCj.mjs} +1 -1
  4. package/dist/lib/xmlui.d.ts +16 -1
  5. package/dist/lib/xmlui.mjs +33 -32
  6. package/dist/metadata/{collectedComponentMetadata-BN8eg9Gr.mjs → collectedComponentMetadata-7DFXlw-J.mjs} +15057 -14865
  7. package/dist/metadata/{initMock-J7pN8owj.mjs → initMock-AFWEftc6.mjs} +1 -1
  8. package/dist/metadata/style.css +1 -1
  9. package/dist/metadata/xmlui-metadata.mjs +1 -1
  10. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  11. package/dist/scripts/bin/build-lib.js +21 -13
  12. package/dist/scripts/bin/viteConfig.js +3 -1
  13. package/dist/scripts/package.json +1 -1
  14. package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
  15. package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
  16. package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
  17. package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
  18. package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
  19. package/dist/scripts/src/components/Animation/Animation.js +50 -0
  20. package/dist/scripts/src/components/App/App.spec.js +219 -0
  21. package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
  22. package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
  23. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
  24. package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
  25. package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
  26. package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
  27. package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
  28. package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
  29. package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
  30. package/dist/scripts/src/components/Button/Button.spec.js +454 -0
  31. package/dist/scripts/src/components/Card/Card.spec.js +150 -0
  32. package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
  33. package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
  34. package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
  35. package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
  36. package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
  37. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
  38. package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
  39. package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
  40. package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
  41. package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
  42. package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
  43. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
  44. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
  45. package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
  46. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
  47. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +9 -26
  48. package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
  49. package/dist/scripts/src/components/ComponentProvider.js +6 -2
  50. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
  51. package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
  52. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
  53. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
  54. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
  55. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
  56. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
  57. package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
  58. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
  59. package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
  60. package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
  61. package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
  62. package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
  63. package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
  64. package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
  65. package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
  66. package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
  67. package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
  68. package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
  69. package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
  70. package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
  71. package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
  72. package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
  73. package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
  74. package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
  75. package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
  76. package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
  77. package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
  78. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  79. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  80. package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
  81. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  82. package/dist/scripts/src/components/Image/Image.js +2 -1
  83. package/dist/scripts/src/components/Image/Image.spec.js +198 -0
  84. package/dist/scripts/src/components/Image/ImageNative.js +30 -2
  85. package/dist/scripts/src/components/Input/InputLabel.js +25 -0
  86. package/dist/scripts/src/components/Input/index.js +5 -0
  87. package/dist/scripts/src/components/Items/Items.spec.js +397 -0
  88. package/dist/scripts/src/components/Link/Link.spec.js +894 -0
  89. package/dist/scripts/src/components/List/List.spec.js +927 -0
  90. package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
  91. package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
  92. package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
  93. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +153 -0
  94. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
  95. package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
  96. package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
  97. package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
  98. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1231 -0
  99. package/dist/scripts/src/components/Option/Option.spec.js +472 -0
  100. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
  101. package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
  102. package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
  103. package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
  104. package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
  105. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
  106. package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
  107. package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
  108. package/dist/scripts/src/components/Select/Select.spec.js +527 -0
  109. package/dist/scripts/src/components/Slider/Slider.js +2 -0
  110. package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
  111. package/dist/scripts/src/components/Slider/SliderNative.js +62 -25
  112. package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
  113. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
  114. package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
  115. package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
  116. package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
  117. package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
  118. package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
  119. package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
  120. package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
  121. package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
  122. package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
  123. package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
  124. package/dist/scripts/src/components/Table/Table.spec.js +555 -0
  125. package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
  126. package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
  127. package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
  128. package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
  129. package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
  130. package/dist/scripts/src/components/TextBox/TextBox.spec.js +643 -0
  131. package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
  132. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
  133. package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
  134. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
  135. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
  136. package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
  137. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  138. package/dist/scripts/src/components-core/CompoundComponent.js +1 -1
  139. package/dist/scripts/src/components-core/RestApiProxy.js +85 -8
  140. package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
  141. package/dist/scripts/src/components-core/renderers.js +31 -0
  142. package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
  143. package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
  144. package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
  145. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  146. package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
  147. package/dist/scripts/src/index-standalone.js +61 -0
  148. package/dist/scripts/src/index.js +2 -1
  149. package/dist/scripts/src/language-server/server-common.js +151 -0
  150. package/dist/scripts/src/language-server/server-web-worker.js +47 -0
  151. package/dist/scripts/src/language-server/server.js +42 -0
  152. package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
  153. package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
  154. package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
  155. package/dist/scripts/src/language-server/services/completion.js +270 -0
  156. package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
  157. package/dist/scripts/src/language-server/services/format.js +430 -0
  158. package/dist/scripts/src/language-server/services/hover.js +164 -0
  159. package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
  160. package/dist/scripts/src/logging/xmlui.js +21 -0
  161. package/dist/scripts/src/parsers/common/utils.js +19 -0
  162. package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
  163. package/dist/scripts/src/syntax/monaco/index.js +14 -0
  164. package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
  165. package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
  166. package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
  167. package/dist/scripts/src/syntax/textMate/index.js +14 -0
  168. package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
  169. package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
  170. package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
  171. package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
  172. package/dist/scripts/src/testing/ComponentDrivers.js +1355 -0
  173. package/dist/scripts/src/testing/assertions.js +444 -0
  174. package/dist/scripts/src/testing/component-test-helpers.js +389 -0
  175. package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
  176. package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
  177. package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
  178. package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
  179. package/dist/scripts/src/testing/fixtures.js +487 -0
  180. package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
  181. package/dist/scripts/src/testing/infrastructure/main.js +9 -0
  182. package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
  183. package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
  184. package/dist/standalone/xmlui-standalone.es.d.ts +18 -1
  185. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  186. package/package.json +1 -1
@@ -0,0 +1,608 @@
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
+ // Test data helpers - using proper XMLUI data format
14
+ const sampleData = `[
15
+ { name: 'Desktop', value: 400, fill: '#8884d8' },
16
+ { name: 'Mobile', value: 300, fill: '#82ca9d' },
17
+ { name: 'Tablet', value: 200, fill: '#ffc658' },
18
+ { name: 'Other', value: 100, fill: '#ff7300' }
19
+ ]`;
20
+ const emptyData = `[]`;
21
+ const singlePointData = `[
22
+ { name: 'Desktop', value: 400 }
23
+ ]`;
24
+ const largeDataset = `[
25
+ { name: 'Category A', value: 400 },
26
+ { name: 'Category B', value: 300 },
27
+ { name: 'Category C', value: 200 },
28
+ { name: 'Category D', value: 100 },
29
+ { name: 'Category E', value: 150 },
30
+ { name: 'Category F', value: 250 },
31
+ { name: 'Category G', value: 180 },
32
+ { name: 'Category H', value: 120 },
33
+ { name: 'Category I', value: 90 },
34
+ { name: 'Category J', value: 310 }
35
+ ]`;
36
+ const zeroValueData = `[
37
+ { name: 'Zero A', value: 0 },
38
+ { name: 'Normal B', value: 300 },
39
+ { name: 'Zero C', value: 0 },
40
+ { name: 'Normal D', value: 200 }
41
+ ]`;
42
+ // Chart selectors - DonutChart specific (inherits from PieChart)
43
+ const chartRoot = ".recharts-responsive-container";
44
+ const chartSvg = ".recharts-surface";
45
+ const pieSelector = ".recharts-pie";
46
+ const pieSectorSelector = ".recharts-pie-sector";
47
+ const legendSelector = ".recharts-legend-wrapper";
48
+ const tooltipSelector = ".recharts-tooltip-wrapper";
49
+ const labelListSelector = ".recharts-label-list";
50
+ // --- Smoke Tests
51
+ fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
52
+ (0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
53
+ yield initTestBed(`
54
+ <DonutChart
55
+ nameKey="name"
56
+ dataKey="value"
57
+ data="{${sampleData}}"
58
+ width="400px"
59
+ height="400px"
60
+ />
61
+ `);
62
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
63
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
64
+ }));
65
+ (0, fixtures_1.test)("renders donut sectors for data points", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
66
+ yield initTestBed(`
67
+ <DonutChart
68
+ nameKey="name"
69
+ dataKey="value"
70
+ data="{${sampleData}}"
71
+ width="400px"
72
+ height="400px"
73
+ />
74
+ `);
75
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
76
+ // Should have 4 pie sectors for 4 data points
77
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
78
+ }));
79
+ (0, fixtures_1.test)("renders donut chart with correct structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
80
+ yield initTestBed(`
81
+ <DonutChart
82
+ nameKey="name"
83
+ dataKey="value"
84
+ data="{${sampleData}}"
85
+ width="400px"
86
+ height="400px"
87
+ />
88
+ `);
89
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
90
+ yield (0, fixtures_1.expect)(page.locator(pieSelector)).toBeVisible();
91
+ yield (0, fixtures_1.expect)(page.locator(chartSvg)).toBeVisible();
92
+ }));
93
+ (0, fixtures_1.test)("renders with default innerRadius (donut hole)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
94
+ yield initTestBed(`
95
+ <DonutChart
96
+ nameKey="name"
97
+ dataKey="value"
98
+ data="{${sampleData}}"
99
+ width="400px"
100
+ height="400px"
101
+ />
102
+ `);
103
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
104
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
105
+ // DonutChart should have a hollow center by default (innerRadius=60)
106
+ }));
107
+ });
108
+ // --- Data Handling Tests
109
+ fixtures_1.test.describe("data handling", () => {
110
+ (0, fixtures_1.test)("renders with empty data array", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
111
+ yield initTestBed(`
112
+ <DonutChart
113
+ nameKey="name"
114
+ dataKey="value"
115
+ data="{${emptyData}}"
116
+ width="400px"
117
+ height="400px"
118
+ />
119
+ `);
120
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
121
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(0);
122
+ }));
123
+ (0, fixtures_1.test)("renders with single data point", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
124
+ yield initTestBed(`
125
+ <DonutChart
126
+ nameKey="name"
127
+ dataKey="value"
128
+ data="{${singlePointData}}"
129
+ width="400px"
130
+ height="400px"
131
+ />
132
+ `);
133
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
134
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(1);
135
+ }));
136
+ (0, fixtures_1.test)("handles non-array data gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
137
+ yield initTestBed(`
138
+ <DonutChart
139
+ nameKey="name"
140
+ dataKey="value"
141
+ data="{null}"
142
+ width="400px"
143
+ height="400px"
144
+ />
145
+ `);
146
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
147
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(0);
148
+ }));
149
+ (0, fixtures_1.test)("handles large datasets", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
150
+ yield initTestBed(`
151
+ <DonutChart
152
+ nameKey="name"
153
+ dataKey="value"
154
+ data="{${largeDataset}}"
155
+ width="400px"
156
+ height="400px"
157
+ />
158
+ `);
159
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
160
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(10);
161
+ }));
162
+ (0, fixtures_1.test)("handles data with zero values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
163
+ yield initTestBed(`
164
+ <DonutChart
165
+ nameKey="name"
166
+ dataKey="value"
167
+ data="{${zeroValueData}}"
168
+ width="400px"
169
+ height="400px"
170
+ />
171
+ `);
172
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
173
+ // Chart renders 3 sectors for this data (actual behavior observed)
174
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(3);
175
+ }));
176
+ });
177
+ // --- Inner Radius Tests (DonutChart specific)
178
+ fixtures_1.test.describe("inner radius configuration", () => {
179
+ (0, fixtures_1.test)("renders with default inner radius (60)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
180
+ yield initTestBed(`
181
+ <DonutChart
182
+ nameKey="name"
183
+ dataKey="value"
184
+ data="{${sampleData}}"
185
+ width="400px"
186
+ height="400px"
187
+ />
188
+ `);
189
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
190
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
191
+ // Default innerRadius should create a donut hole
192
+ }));
193
+ (0, fixtures_1.test)("renders with custom inner radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
194
+ yield initTestBed(`
195
+ <DonutChart
196
+ nameKey="name"
197
+ dataKey="value"
198
+ data="{${sampleData}}"
199
+ innerRadius="{80}"
200
+ width="400px"
201
+ height="400px"
202
+ />
203
+ `);
204
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
205
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
206
+ }));
207
+ (0, fixtures_1.test)("renders with small inner radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
208
+ yield initTestBed(`
209
+ <DonutChart
210
+ nameKey="name"
211
+ dataKey="value"
212
+ data="{${sampleData}}"
213
+ innerRadius="{20}"
214
+ width="400px"
215
+ height="400px"
216
+ />
217
+ `);
218
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
219
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
220
+ }));
221
+ (0, fixtures_1.test)("renders with large inner radius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
222
+ yield initTestBed(`
223
+ <DonutChart
224
+ nameKey="name"
225
+ dataKey="value"
226
+ data="{${sampleData}}"
227
+ innerRadius="{120}"
228
+ width="400px"
229
+ height="400px"
230
+ />
231
+ `);
232
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
233
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
234
+ }));
235
+ (0, fixtures_1.test)("renders with zero inner radius (becomes regular pie)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
236
+ yield initTestBed(`
237
+ <DonutChart
238
+ nameKey="name"
239
+ dataKey="value"
240
+ data="{${sampleData}}"
241
+ innerRadius="{0}"
242
+ width="400px"
243
+ height="400px"
244
+ />
245
+ `);
246
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
247
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
248
+ // With innerRadius=0, it behaves like a regular pie chart
249
+ }));
250
+ });
251
+ // --- Legend Tests
252
+ fixtures_1.test.describe("legend", () => {
253
+ (0, fixtures_1.test)("legend is hidden by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
254
+ yield initTestBed(`
255
+ <DonutChart
256
+ nameKey="name"
257
+ dataKey="value"
258
+ data="{${sampleData}}"
259
+ width="400px"
260
+ height="400px"
261
+ />
262
+ `);
263
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
264
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).not.toBeVisible();
265
+ }));
266
+ (0, fixtures_1.test)("legend is shown when showLegend is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
267
+ yield initTestBed(`
268
+ <DonutChart
269
+ nameKey="name"
270
+ dataKey="value"
271
+ data="{${sampleData}}"
272
+ showLegend
273
+ width="400px"
274
+ height="400px"
275
+ />
276
+ `);
277
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
278
+ yield (0, fixtures_1.expect)(page.locator(legendSelector)).toBeVisible();
279
+ }));
280
+ (0, fixtures_1.test)("legend shows correct data labels", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
281
+ yield initTestBed(`
282
+ <DonutChart
283
+ nameKey="name"
284
+ dataKey="value"
285
+ data="{${sampleData}}"
286
+ showLegend
287
+ width="400px"
288
+ height="400px"
289
+ />
290
+ `);
291
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
292
+ const legend = page.locator(legendSelector);
293
+ yield (0, fixtures_1.expect)(legend).toBeVisible();
294
+ yield (0, fixtures_1.expect)(legend).toContainText("Desktop");
295
+ yield (0, fixtures_1.expect)(legend).toContainText("Mobile");
296
+ yield (0, fixtures_1.expect)(legend).toContainText("Tablet");
297
+ yield (0, fixtures_1.expect)(legend).toContainText("Other");
298
+ }));
299
+ });
300
+ // --- Tooltip Tests
301
+ fixtures_1.test.describe("tooltip", () => {
302
+ (0, fixtures_1.test)("tooltip appears on hover by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
303
+ yield initTestBed(`
304
+ <DonutChart
305
+ nameKey="name"
306
+ dataKey="value"
307
+ data="{${sampleData}}"
308
+ width="400px"
309
+ height="400px"
310
+ />
311
+ `);
312
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
313
+ const pieSector = page.locator(pieSectorSelector).first();
314
+ yield pieSector.hover();
315
+ // Wait for tooltip to appear
316
+ yield page.waitForTimeout(500);
317
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
318
+ }));
319
+ (0, fixtures_1.test)("tooltip shows correct data on hover", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
320
+ yield initTestBed(`
321
+ <DonutChart
322
+ nameKey="name"
323
+ dataKey="value"
324
+ data="{${sampleData}}"
325
+ width="400px"
326
+ height="400px"
327
+ />
328
+ `);
329
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
330
+ const pieSector = page.locator(pieSectorSelector).first();
331
+ yield pieSector.hover();
332
+ yield page.waitForTimeout(500);
333
+ const tooltip = page.locator(tooltipSelector);
334
+ yield (0, fixtures_1.expect)(tooltip).toBeVisible();
335
+ // Tooltip should contain data from the first sector
336
+ yield (0, fixtures_1.expect)(tooltip).toContainText("Desktop");
337
+ yield (0, fixtures_1.expect)(tooltip).toContainText("400");
338
+ }));
339
+ (0, fixtures_1.test)("tooltip works with different data points", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
340
+ yield initTestBed(`
341
+ <DonutChart
342
+ nameKey="name"
343
+ dataKey="value"
344
+ data="{${sampleData}}"
345
+ width="400px"
346
+ height="400px"
347
+ />
348
+ `);
349
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
350
+ // Test multiple sectors
351
+ const sectors = page.locator(pieSectorSelector);
352
+ const sectorCount = yield sectors.count();
353
+ for (let i = 0; i < Math.min(sectorCount, 2); i++) {
354
+ yield sectors.nth(i).hover();
355
+ yield page.waitForTimeout(300);
356
+ yield (0, fixtures_1.expect)(page.locator(tooltipSelector)).toBeVisible();
357
+ }
358
+ }));
359
+ });
360
+ // --- Label Tests
361
+ fixtures_1.test.describe("labels", () => {
362
+ (0, fixtures_1.test)("labels are shown by default (showLabel=true)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
363
+ yield initTestBed(`
364
+ <DonutChart
365
+ nameKey="name"
366
+ dataKey="value"
367
+ data="{${sampleData}}"
368
+ width="400px"
369
+ height="400px"
370
+ />
371
+ `);
372
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
373
+ // Labels should be rendered as text elements
374
+ const labels = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
375
+ yield (0, fixtures_1.expect)(labels).toHaveCount(4);
376
+ }));
377
+ (0, fixtures_1.test)("labels are hidden when showLabel is false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
378
+ yield initTestBed(`
379
+ <DonutChart
380
+ nameKey="name"
381
+ dataKey="value"
382
+ data="{${sampleData}}"
383
+ showLabel="{false}"
384
+ width="400px"
385
+ height="400px"
386
+ />
387
+ `);
388
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
389
+ // Should have pie sectors but no labels
390
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
391
+ const labels = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
392
+ yield (0, fixtures_1.expect)(labels).toHaveCount(0);
393
+ }));
394
+ (0, fixtures_1.test)("label list is hidden by default", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
395
+ yield initTestBed(`
396
+ <DonutChart
397
+ nameKey="name"
398
+ dataKey="value"
399
+ data="{${sampleData}}"
400
+ width="400px"
401
+ height="400px"
402
+ />
403
+ `);
404
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
405
+ // When showLabelList is false (default), there should be no LabelList elements
406
+ yield (0, fixtures_1.expect)(page.locator(labelListSelector)).toHaveCount(0);
407
+ }));
408
+ (0, fixtures_1.test)("label list is shown when showLabelList is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
409
+ yield initTestBed(`
410
+ <DonutChart
411
+ nameKey="name"
412
+ dataKey="value"
413
+ data="{${sampleData}}"
414
+ showLabel="{false}"
415
+ showLabelList
416
+ width="400px"
417
+ height="400px"
418
+ />
419
+ `);
420
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
421
+ // LabelList creates text elements with the label content
422
+ const labelTexts = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
423
+ yield (0, fixtures_1.expect)(labelTexts).toHaveCount(4);
424
+ }));
425
+ (0, fixtures_1.test)("can show both external labels and label list", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
426
+ yield initTestBed(`
427
+ <DonutChart
428
+ nameKey="name"
429
+ dataKey="value"
430
+ data="{${sampleData}}"
431
+ showLabel
432
+ showLabelList
433
+ width="400px"
434
+ height="400px"
435
+ />
436
+ `);
437
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
438
+ // Should have text elements for both label types
439
+ const labelTexts = page.locator('text').filter({ hasText: /Desktop|Mobile|Tablet|Other/ });
440
+ yield (0, fixtures_1.expect)(labelTexts.first()).toBeVisible();
441
+ }));
442
+ });
443
+ // --- Responsive Behavior Tests
444
+ fixtures_1.test.describe("responsive behavior", () => {
445
+ (0, fixtures_1.test)("renders in small containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
446
+ yield initTestBed(`
447
+ <DonutChart
448
+ nameKey="name"
449
+ dataKey="value"
450
+ data="{${sampleData}}"
451
+ width="200px"
452
+ height="200px"
453
+ />
454
+ `);
455
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
456
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
457
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
458
+ }));
459
+ (0, fixtures_1.test)("renders in very small containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
460
+ yield initTestBed(`
461
+ <DonutChart
462
+ nameKey="name"
463
+ dataKey="value"
464
+ data="{${sampleData}}"
465
+ width="100px"
466
+ height="100px"
467
+ />
468
+ `);
469
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
470
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
471
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
472
+ }));
473
+ (0, fixtures_1.test)("renders in large containers", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
474
+ yield initTestBed(`
475
+ <DonutChart
476
+ nameKey="name"
477
+ dataKey="value"
478
+ data="{${sampleData}}"
479
+ width="800px"
480
+ height="600px"
481
+ />
482
+ `);
483
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
484
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
485
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
486
+ }));
487
+ (0, fixtures_1.test)("adapts to container aspect ratio", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
488
+ yield initTestBed(`
489
+ <DonutChart
490
+ nameKey="name"
491
+ dataKey="value"
492
+ data="{${sampleData}}"
493
+ width="600px"
494
+ height="300px"
495
+ />
496
+ `);
497
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
498
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
499
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
500
+ }));
501
+ });
502
+ // --- Interaction Tests
503
+ fixtures_1.test.describe("interactions", () => {
504
+ (0, fixtures_1.test)("sectors respond to hover", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
505
+ yield initTestBed(`
506
+ <DonutChart
507
+ nameKey="name"
508
+ dataKey="value"
509
+ data="{${sampleData}}"
510
+ width="400px"
511
+ height="400px"
512
+ />
513
+ `);
514
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
515
+ const pieSector = page.locator(pieSectorSelector).first();
516
+ // Hover should trigger visual feedback
517
+ yield pieSector.hover();
518
+ yield page.waitForTimeout(300);
519
+ // The sector should still be visible and potentially highlighted
520
+ yield (0, fixtures_1.expect)(pieSector).toBeVisible();
521
+ }));
522
+ (0, fixtures_1.test)("multiple sectors can be hovered sequentially", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
523
+ yield initTestBed(`
524
+ <DonutChart
525
+ nameKey="name"
526
+ dataKey="value"
527
+ data="{${sampleData}}"
528
+ width="400px"
529
+ height="400px"
530
+ />
531
+ `);
532
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
533
+ const sectors = page.locator(pieSectorSelector);
534
+ // Hover over multiple sectors
535
+ for (let i = 0; i < Math.min(yield sectors.count(), 3); i++) {
536
+ yield sectors.nth(i).hover();
537
+ yield page.waitForTimeout(200);
538
+ yield (0, fixtures_1.expect)(sectors.nth(i)).toBeVisible();
539
+ }
540
+ }));
541
+ });
542
+ // --- Performance Tests
543
+ fixtures_1.test.describe("performance", () => {
544
+ (0, fixtures_1.test)("renders quickly with standard dataset", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
545
+ const startTime = Date.now();
546
+ yield initTestBed(`
547
+ <DonutChart
548
+ nameKey="name"
549
+ dataKey="value"
550
+ data="{${sampleData}}"
551
+ width="400px"
552
+ height="400px"
553
+ />
554
+ `);
555
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
556
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
557
+ const renderTime = Date.now() - startTime;
558
+ // Should render within reasonable time (less than 5 seconds)
559
+ (0, fixtures_1.expect)(renderTime).toBeLessThan(5000);
560
+ }));
561
+ (0, fixtures_1.test)("handles rapid data updates", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
562
+ yield initTestBed(`
563
+ <DonutChart
564
+ nameKey="name"
565
+ dataKey="value"
566
+ data="{${sampleData}}"
567
+ width="400px"
568
+ height="400px"
569
+ />
570
+ `);
571
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
572
+ yield (0, fixtures_1.expect)(page.locator(pieSectorSelector)).toHaveCount(4);
573
+ // The chart should remain stable and responsive
574
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
575
+ }));
576
+ });
577
+ // --- Accessibility Tests
578
+ fixtures_1.test.describe("accessibility", () => {
579
+ (0, fixtures_1.test)("chart is keyboard accessible", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
580
+ yield initTestBed(`
581
+ <DonutChart
582
+ nameKey="name"
583
+ dataKey="value"
584
+ data="{${sampleData}}"
585
+ width="400px"
586
+ height="400px"
587
+ />
588
+ `);
589
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
590
+ // Chart should be focusable and navigable
591
+ yield page.keyboard.press('Tab');
592
+ yield (0, fixtures_1.expect)(page.locator(chartRoot)).toBeVisible();
593
+ }));
594
+ (0, fixtures_1.test)("chart has proper ARIA structure", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
595
+ yield initTestBed(`
596
+ <DonutChart
597
+ nameKey="name"
598
+ dataKey="value"
599
+ data="{${sampleData}}"
600
+ width="400px"
601
+ height="400px"
602
+ />
603
+ `);
604
+ yield page.waitForSelector(chartRoot, { timeout: 10000 });
605
+ // SVG should have proper structure for screen readers
606
+ yield (0, fixtures_1.expect)(page.locator(chartSvg)).toBeVisible();
607
+ }));
608
+ });