xmlui 0.10.13 → 0.10.15

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 (217) hide show
  1. package/dist/lib/{index-Db5iQkFp.mjs → index-axjeT2uJ.mjs} +1626 -1080
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-B9LtmFJG.mjs → initMock-BoTWMs19.mjs} +1 -1
  4. package/dist/lib/language-server-web-worker.mjs +1 -1
  5. package/dist/lib/language-server.mjs +1 -1
  6. package/dist/lib/{metadata-utils-D90qqMGc.mjs → metadata-utils-CtY0QcvH.mjs} +2 -1
  7. package/dist/lib/{server-common-lmBDLpUh.mjs → server-common-Cine5nRR.mjs} +1 -1
  8. package/dist/lib/xmlui.d.ts +99 -6
  9. package/dist/lib/xmlui.mjs +78 -42
  10. package/dist/metadata/{collectedComponentMetadata-BN8eg9Gr.mjs → collectedComponentMetadata-CQywuPDB.mjs} +17448 -16984
  11. package/dist/metadata/{initMock-J7pN8owj.mjs → initMock-Bi5kF5Af.mjs} +1 -1
  12. package/dist/metadata/style.css +1 -1
  13. package/dist/metadata/xmlui-metadata.mjs +1 -1
  14. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  15. package/dist/scripts/bin/build-lib.js +21 -13
  16. package/dist/scripts/bin/viteConfig.js +3 -1
  17. package/dist/scripts/package.json +2 -3
  18. package/dist/scripts/src/abstractions/scripting/Token.js +2 -0
  19. package/dist/scripts/src/abstractions/scripting/TryScope.js +2 -0
  20. package/dist/scripts/src/abstractions/scripting/modules.js +2 -0
  21. package/dist/scripts/src/components/APICall/APICall.spec.js +910 -0
  22. package/dist/scripts/src/components/Accordion/Accordion.spec.js +969 -0
  23. package/dist/scripts/src/components/Animation/Animation.js +50 -0
  24. package/dist/scripts/src/components/App/App.spec.js +219 -0
  25. package/dist/scripts/src/components/AppHeader/AppHeader.spec.js +169 -0
  26. package/dist/scripts/src/components/AppState/AppState.js +32 -2
  27. package/dist/scripts/src/components/AppState/AppState.spec.js +268 -0
  28. package/dist/scripts/src/components/AppState/AppStateNative.js +27 -3
  29. package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +383 -0
  30. package/dist/scripts/src/components/Avatar/Avatar.spec.js +1543 -0
  31. package/dist/scripts/src/components/Backdrop/Backdrop.spec.js +131 -0
  32. package/dist/scripts/src/components/Badge/Badge.spec.js +2214 -0
  33. package/dist/scripts/src/components/Bookmark/Bookmark.spec.js +230 -0
  34. package/dist/scripts/src/components/Breakout/Breakout.spec.js +56 -0
  35. package/dist/scripts/src/components/Button/Button-style.spec.js +274 -0
  36. package/dist/scripts/src/components/Button/Button.js +5 -1
  37. package/dist/scripts/src/components/Button/Button.spec.js +454 -0
  38. package/dist/scripts/src/components/Card/Card.spec.js +150 -0
  39. package/dist/scripts/src/components/Carousel/Carousel.spec.js +343 -0
  40. package/dist/scripts/src/components/Carousel/CarouselNative.js +2 -2
  41. package/dist/scripts/src/components/ChangeListener/ChangeListener.spec.js +169 -0
  42. package/dist/scripts/src/components/Charts/AreaChart/AreaChart.spec.js +999 -0
  43. package/dist/scripts/src/components/Charts/BarChart/BarChart.spec.js +597 -0
  44. package/dist/scripts/src/components/Charts/DonutChart/DonutChart.spec.js +608 -0
  45. package/dist/scripts/src/components/Charts/LabelList/LabelList.spec.js +539 -0
  46. package/dist/scripts/src/components/Charts/Legend/Legend.spec.js +558 -0
  47. package/dist/scripts/src/components/Charts/LineChart/LineChart.spec.js +450 -0
  48. package/dist/scripts/src/components/Charts/PieChart/PieChart.spec.js +584 -0
  49. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +41 -2
  50. package/dist/scripts/src/components/Charts/RadarChart/RadarChart.spec.js +571 -0
  51. package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +449 -0
  52. package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +964 -0
  53. package/dist/scripts/src/components/CodeBlock/CodeBlock.spec.js +196 -0
  54. package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +283 -0
  55. package/dist/scripts/src/components/ColorPicker/ColorPickerNative.js +9 -26
  56. package/dist/scripts/src/components/Column/doc-resources/list-component-data.js +53 -0
  57. package/dist/scripts/src/components/ComponentProvider.js +6 -2
  58. package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +338 -0
  59. package/dist/scripts/src/components/DateInput/DateInput.spec.js +918 -0
  60. package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +362 -0
  61. package/dist/scripts/src/components/DatePicker/DatePickerNative.js +3 -3
  62. package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +331 -0
  63. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +7 -9
  64. package/dist/scripts/src/components/EmojiSelector/EmojiSelector.spec.js +29 -0
  65. package/dist/scripts/src/components/ExpandableItem/ExpandableItem.spec.js +435 -0
  66. package/dist/scripts/src/components/FileInput/FileInput.spec.js +249 -0
  67. package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.spec.js +296 -0
  68. package/dist/scripts/src/components/FlowLayout/FlowLayout.spec.js +518 -0
  69. package/dist/scripts/src/components/Footer/Footer.spec.js +991 -0
  70. package/dist/scripts/src/components/Form/Form.spec.js +1257 -0
  71. package/dist/scripts/src/components/FormItem/FormItem.spec.js +723 -0
  72. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
  73. package/dist/scripts/src/components/FormSection/FormSection.js +6 -31
  74. package/dist/scripts/src/components/Fragment/Fragment.spec.js +50 -0
  75. package/dist/scripts/src/components/Heading/H1.spec.js +66 -0
  76. package/dist/scripts/src/components/Heading/H2.spec.js +66 -0
  77. package/dist/scripts/src/components/Heading/H3.spec.js +66 -0
  78. package/dist/scripts/src/components/Heading/H4.spec.js +66 -0
  79. package/dist/scripts/src/components/Heading/H5.spec.js +66 -0
  80. package/dist/scripts/src/components/Heading/H6.spec.js +66 -0
  81. package/dist/scripts/src/components/Heading/Heading.spec.js +897 -0
  82. package/dist/scripts/src/components/HtmlTags/HtmlTags.spec.js +69 -0
  83. package/dist/scripts/src/components/IFrame/IFrame.spec.js +527 -0
  84. package/dist/scripts/src/components/Icon/ArrowDropDown.js +11 -0
  85. package/dist/scripts/src/components/Icon/ArrowDropUp.js +11 -0
  86. package/dist/scripts/src/components/Icon/ArrowLeft.js +11 -0
  87. package/dist/scripts/src/components/Icon/ArrowRight.js +11 -0
  88. package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
  89. package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
  90. package/dist/scripts/src/components/Icon/Icon.spec.js +527 -0
  91. package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
  92. package/dist/scripts/src/components/Image/Image.js +2 -1
  93. package/dist/scripts/src/components/Image/Image.spec.js +198 -0
  94. package/dist/scripts/src/components/Image/ImageNative.js +30 -2
  95. package/dist/scripts/src/components/Input/InputLabel.js +25 -0
  96. package/dist/scripts/src/components/Input/index.js +5 -0
  97. package/dist/scripts/src/components/Items/Items.spec.js +397 -0
  98. package/dist/scripts/src/components/Link/Link.spec.js +894 -0
  99. package/dist/scripts/src/components/List/List.spec.js +927 -0
  100. package/dist/scripts/src/components/List/doc-resources/list-component-data.js +53 -0
  101. package/dist/scripts/src/components/Markdown/Markdown.spec.js +188 -0
  102. package/dist/scripts/src/components/ModalDialog/ModalDialog.spec.js +162 -0
  103. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +212 -0
  104. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +15 -7
  105. package/dist/scripts/src/components/NavLink/NavLink.spec.js +864 -0
  106. package/dist/scripts/src/components/NavPanel/NavPanel.spec.js +864 -0
  107. package/dist/scripts/src/components/NoResult/NoResult.spec.js +863 -0
  108. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +1237 -0
  109. package/dist/scripts/src/components/Option/Option.spec.js +472 -0
  110. package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.spec.js +80 -0
  111. package/dist/scripts/src/components/Pagination/Pagination.spec.js +1003 -0
  112. package/dist/scripts/src/components/ProfileMenu/ProfileMenu.js +20 -0
  113. package/dist/scripts/src/components/ProgressBar/ProgressBar.spec.js +166 -0
  114. package/dist/scripts/src/components/Queue/Queue.spec.js +626 -0
  115. package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +479 -0
  116. package/dist/scripts/src/components/Redirect/Redirect.spec.js +527 -0
  117. package/dist/scripts/src/components/ResponsiveBar/ResponsiveBar.spec.js +76 -0
  118. package/dist/scripts/src/components/Select/Select.spec.js +527 -0
  119. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +3 -1
  120. package/dist/scripts/src/components/Slider/Slider.js +2 -0
  121. package/dist/scripts/src/components/Slider/Slider.spec.js +574 -0
  122. package/dist/scripts/src/components/Slider/SliderNative.js +63 -26
  123. package/dist/scripts/src/components/Slot/Slot.spec.js +368 -0
  124. package/dist/scripts/src/components/SpaceFiller/SpaceFiller.spec.js +184 -0
  125. package/dist/scripts/src/components/Spinner/Spinner.spec.js +161 -0
  126. package/dist/scripts/src/components/Splitter/HSplitter.spec.js +104 -0
  127. package/dist/scripts/src/components/Splitter/Splitter.spec.js +543 -0
  128. package/dist/scripts/src/components/Splitter/VSplitter.spec.js +104 -0
  129. package/dist/scripts/src/components/Stack/CHStack.spec.js +86 -0
  130. package/dist/scripts/src/components/Stack/CVStack.spec.js +86 -0
  131. package/dist/scripts/src/components/Stack/HStack.spec.js +67 -0
  132. package/dist/scripts/src/components/Stack/Stack.spec.js +654 -0
  133. package/dist/scripts/src/components/Stack/VStack.spec.js +67 -0
  134. package/dist/scripts/src/components/Switch/Switch.spec.js +829 -0
  135. package/dist/scripts/src/components/Table/Table.js +7 -1
  136. package/dist/scripts/src/components/Table/Table.spec.js +555 -0
  137. package/dist/scripts/src/components/Table/TableNative.js +4 -1
  138. package/dist/scripts/src/components/Table/doc-resources/list-component-data.js +53 -0
  139. package/dist/scripts/src/components/Table/useRowSelection.js +215 -1
  140. package/dist/scripts/src/components/TableOfContents/TableOfContents.spec.js +838 -0
  141. package/dist/scripts/src/components/Tabs/Tabs.spec.js +875 -0
  142. package/dist/scripts/src/components/Text/Text.spec.js +1075 -0
  143. package/dist/scripts/src/components/TextArea/TextArea.spec.js +714 -0
  144. package/dist/scripts/src/components/TextBox/TextBox.js +1 -5
  145. package/dist/scripts/src/components/TextBox/TextBox.spec.js +687 -0
  146. package/dist/scripts/src/components/TextBox/TextBoxNative.js +10 -15
  147. package/dist/scripts/src/components/Theme/Theme.spec.js +124 -0
  148. package/dist/scripts/src/components/Theme/ThemeNative.js +2 -6
  149. package/dist/scripts/src/components/TimeInput/TimeInput.js +1 -5
  150. package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +1122 -0
  151. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +2 -9
  152. package/dist/scripts/src/components/Timer/Timer.spec.js +358 -0
  153. package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.spec.js +414 -0
  154. package/dist/scripts/src/components/ToneSwitch/ToneSwitch.spec.js +89 -0
  155. package/dist/scripts/src/components/Tooltip/Tooltip.spec.js +418 -0
  156. package/dist/scripts/src/components/chart-color-schemes.js +43 -0
  157. package/dist/scripts/src/components-core/ApiBoundComponent.js +38 -24
  158. package/dist/scripts/src/components-core/CompoundComponent.js +1 -1
  159. package/dist/scripts/src/components-core/RestApiProxy.js +84 -8
  160. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +54 -0
  161. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +80 -0
  162. package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
  163. package/dist/scripts/src/components-core/devtools/InspectorDialogVisibilityContext.js +8 -0
  164. package/dist/scripts/src/components-core/parts.js +4 -1
  165. package/dist/scripts/src/components-core/renderers.js +31 -0
  166. package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -1
  167. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +31 -46
  168. package/dist/scripts/src/components-core/rendering/nodeUtils.js +6 -0
  169. package/dist/scripts/src/components-core/script-runner/simplify-expression.js +386 -0
  170. package/dist/scripts/src/components-core/theming/component-layout-resolver.js +153 -0
  171. package/dist/scripts/src/components-core/theming/layout-resolver.js +2 -0
  172. package/dist/scripts/src/components-core/theming/parse-layout-props.js +98 -0
  173. package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
  174. package/dist/scripts/src/components-core/utils/audio-utils.js +83 -0
  175. package/dist/scripts/src/index-standalone.js +61 -0
  176. package/dist/scripts/src/index.js +39 -1
  177. package/dist/scripts/src/language-server/server-common.js +151 -0
  178. package/dist/scripts/src/language-server/server-web-worker.js +47 -0
  179. package/dist/scripts/src/language-server/server.js +42 -0
  180. package/dist/scripts/src/language-server/services/common/docs-generation.js +73 -0
  181. package/dist/scripts/src/language-server/services/common/lsp-utils.js +9 -0
  182. package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +135 -0
  183. package/dist/scripts/src/language-server/services/completion.js +270 -0
  184. package/dist/scripts/src/language-server/services/diagnostic.js +19 -0
  185. package/dist/scripts/src/language-server/services/format.js +430 -0
  186. package/dist/scripts/src/language-server/services/hover.js +164 -0
  187. package/dist/scripts/src/language-server/xmlui-metadata-generated.mjs +16266 -0
  188. package/dist/scripts/src/logging/xmlui.js +21 -0
  189. package/dist/scripts/src/parsers/common/utils.js +19 -0
  190. package/dist/scripts/src/syntax/monaco/grammar.monacoLanguage.js +286 -0
  191. package/dist/scripts/src/syntax/monaco/index.js +14 -0
  192. package/dist/scripts/src/syntax/monaco/xmlui-dark.js +25 -0
  193. package/dist/scripts/src/syntax/monaco/xmlui-light.js +25 -0
  194. package/dist/scripts/src/syntax/monaco/xmluiscript.monacoLanguage.js +310 -0
  195. package/dist/scripts/src/syntax/textMate/index.js +14 -0
  196. package/dist/scripts/src/syntax/textMate/xmlui-dark.json +631 -0
  197. package/dist/scripts/src/syntax/textMate/xmlui-light.json +565 -0
  198. package/dist/scripts/src/syntax/textMate/xmlui.json +564 -0
  199. package/dist/scripts/src/syntax/textMate/xmlui.tmLanguage.json +341 -0
  200. package/dist/scripts/src/testing/ComponentDrivers.js +1327 -0
  201. package/dist/scripts/src/testing/assertions.js +444 -0
  202. package/dist/scripts/src/testing/component-test-helpers.js +389 -0
  203. package/dist/scripts/src/testing/drivers/DateInputDriver.js +19 -0
  204. package/dist/scripts/src/testing/drivers/ModalDialogDriver.js +10 -0
  205. package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +44 -0
  206. package/dist/scripts/src/testing/drivers/SliderDriver.js +20 -0
  207. package/dist/scripts/src/testing/drivers/TextBoxDriver.js +20 -0
  208. package/dist/scripts/src/testing/drivers/TimeInputDriver.js +22 -0
  209. package/dist/scripts/src/testing/drivers/TimerDriver.js +64 -0
  210. package/dist/scripts/src/testing/fixtures.js +513 -0
  211. package/dist/scripts/src/testing/infrastructure/TestBed.js +17 -0
  212. package/dist/scripts/src/testing/infrastructure/main.js +9 -0
  213. package/dist/scripts/src/testing/infrastructure/public/mockServiceWorker.js +266 -0
  214. package/dist/scripts/src/testing/themed-app-test-helpers.js +139 -0
  215. package/dist/standalone/xmlui-standalone.es.d.ts +172 -10
  216. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  217. package/package.json +2 -3
@@ -0,0 +1,714 @@
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 component_test_helpers_1 = require("../../testing/component-test-helpers");
13
+ const fixtures_1 = require("../../testing/fixtures");
14
+ // =============================================================================
15
+ // BASIC FUNCTIONALITY TESTS
16
+ // =============================================================================
17
+ fixtures_1.test.describe("Basic Functionality", () => {
18
+ (0, fixtures_1.test)("component renders with basic props", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
19
+ yield initTestBed(`<TextArea />`);
20
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
21
+ }));
22
+ (0, fixtures_1.test)("component renders with label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
23
+ yield initTestBed(`<TextArea label="Comments" />`);
24
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
25
+ yield (0, fixtures_1.expect)(page.getByText("Comments")).toBeVisible();
26
+ }));
27
+ (0, fixtures_1.test)("initialValue sets textarea value correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
28
+ yield initTestBed(`<TextArea initialValue="Initial text content" />`);
29
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("Initial text content");
30
+ }));
31
+ (0, fixtures_1.test)("initialValue accepts different data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
32
+ // Test string
33
+ yield initTestBed(`<TextArea initialValue="hello world" />`);
34
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("hello world");
35
+ // Test number
36
+ yield initTestBed(`<TextArea initialValue="{123}" />`);
37
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("123");
38
+ // Test boolean
39
+ yield initTestBed(`<TextArea initialValue="{true}" />`);
40
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("true");
41
+ }));
42
+ (0, fixtures_1.test)("component handles null and undefined props gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
43
+ yield initTestBed(`<TextArea initialValue="{null}" />`);
44
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
45
+ yield initTestBed(`<TextArea initialValue="{undefined}" />`);
46
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
47
+ yield initTestBed(`<TextArea />`);
48
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
49
+ }));
50
+ (0, fixtures_1.test)("component accepts user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
51
+ yield initTestBed(`<TextArea />`);
52
+ yield page.getByRole("textbox").fill("user input");
53
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("user input");
54
+ }));
55
+ (0, fixtures_1.test)("component accepts multiline input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
56
+ yield initTestBed(`<TextArea />`);
57
+ const multilineText = "First line\nSecond line\nThird line";
58
+ yield page.getByRole("textbox").fill(multilineText);
59
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue(multilineText);
60
+ }));
61
+ (0, fixtures_1.test)("component clears input correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
62
+ yield initTestBed(`<TextArea initialValue="Initial content" />`);
63
+ const textarea = page.getByRole("textbox");
64
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Initial content");
65
+ yield textarea.clear();
66
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("");
67
+ }));
68
+ (0, fixtures_1.test)("required prop adds required attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
69
+ yield initTestBed(`<TextArea required="true" />`);
70
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("required");
71
+ }));
72
+ (0, fixtures_1.test)("enabled=false disables control", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
73
+ yield initTestBed(`<TextArea enabled="false" />`);
74
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).not.toBeEditable();
75
+ }));
76
+ (0, fixtures_1.test)("readOnly prevents editing but allows focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
77
+ yield initTestBed(`<TextArea readOnly="true" initialValue="Read only content" />`);
78
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("readonly");
79
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("Read only content");
80
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).not.toBeEditable();
81
+ yield page.getByRole("textbox").focus();
82
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeFocused();
83
+ }));
84
+ (0, fixtures_1.test)("autoFocus focuses textarea on mount", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
85
+ yield initTestBed(`<TextArea autoFocus="true" />`);
86
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeFocused();
87
+ }));
88
+ (0, fixtures_1.test)("autoFocus focuses input on mount with label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
89
+ yield initTestBed(`<TextArea autoFocus="true" label="Auto-focused input" />`);
90
+ yield (0, fixtures_1.expect)(page.getByLabel("Auto-focused input")).toBeFocused();
91
+ }));
92
+ (0, fixtures_1.test)("placeholder shows when textarea is empty", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
93
+ yield initTestBed(`<TextArea placeholder="Enter your comments here..." />`);
94
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("placeholder", "Enter your comments here...");
95
+ }));
96
+ (0, fixtures_1.test)("placeholder is hidden when textarea has content", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
97
+ yield initTestBed(`<TextArea placeholder="Enter comments" />`);
98
+ const textarea = page.getByRole("textbox");
99
+ yield textarea.fill("Some content");
100
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Some content");
101
+ (0, fixtures_1.expect)(textarea).toHaveAttribute("placeholder", "Enter comments");
102
+ }));
103
+ (0, fixtures_1.test)("maxLength limits input length", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
104
+ yield initTestBed(`<TextArea maxLength="10" />`);
105
+ yield page.getByRole("textbox").fill("12345678901234567890");
106
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("1234567890");
107
+ }));
108
+ (0, fixtures_1.test)("rows prop sets textarea height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
109
+ yield initTestBed(`<TextArea rows="5" />`);
110
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("rows", "5");
111
+ }));
112
+ (0, fixtures_1.test)("component handles special characters correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
113
+ yield initTestBed(`<TextArea />`);
114
+ const specialText = "Hello 日本語 @#$%! 🚀 Unicode test 🎉";
115
+ yield page.getByRole("textbox").fill(specialText);
116
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue(specialText);
117
+ }));
118
+ (0, fixtures_1.test)("component handles very long input values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
119
+ const longText = "This is a very long text that might cause issues with component rendering or processing. ".repeat(50);
120
+ yield initTestBed(`<TextArea />`);
121
+ yield page.getByRole("textbox").fill(longText);
122
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue(longText);
123
+ }));
124
+ (0, fixtures_1.test)("component prop changes update display correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
125
+ yield initTestBed(`
126
+ <Fragment var.rows="{3}">
127
+ <TextArea rows="{rows}" />
128
+ <Button onClick="rows = 5">Set Rows to 5</Button>
129
+ </Fragment>`);
130
+ const textarea = page.getByRole("textbox");
131
+ yield (0, fixtures_1.expect)(textarea).toHaveAttribute("rows", "3");
132
+ yield page.getByRole("button", { name: "Set Rows to 5" }).click();
133
+ yield (0, fixtures_1.expect)(textarea).toHaveAttribute("rows", "5");
134
+ }));
135
+ (0, fixtures_1.test)("autoSize enables automatic height adjustment", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
136
+ yield initTestBed(`<TextArea testId="input" autoSize="true" />`);
137
+ const textarea = page.getByTestId("input");
138
+ const areaField = page.getByRole("textbox");
139
+ // Get initial height with single line
140
+ yield areaField.fill("Single line");
141
+ const initialHeight = yield textarea.evaluate((el) => el.scrollHeight);
142
+ // Add multiple lines and verify height increases
143
+ yield areaField.fill("Line 1\nLine 2\nLine 3\nLine 4");
144
+ const expandedHeight = yield textarea.evaluate((el) => el.scrollHeight);
145
+ // Height should increase when more lines are added
146
+ (0, fixtures_1.expect)(expandedHeight).toBeGreaterThan(initialHeight);
147
+ // Verify content is correct
148
+ yield (0, fixtures_1.expect)(areaField).toHaveValue("Line 1\nLine 2\nLine 3\nLine 4");
149
+ // Test reduction - go back to fewer lines
150
+ yield areaField.fill("Line 1\nLine 2");
151
+ const reducedHeight = yield areaField.evaluate((el) => el.scrollHeight);
152
+ // Height should decrease when lines are removed
153
+ (0, fixtures_1.expect)(reducedHeight).toBeLessThan(expandedHeight);
154
+ (0, fixtures_1.expect)(reducedHeight).toBeGreaterThanOrEqual(initialHeight);
155
+ }));
156
+ (0, fixtures_1.test)("maxRows limits auto-size height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
157
+ yield initTestBed(`<TextArea testId="input" autoSize="true" maxRows="3" />`);
158
+ const textarea = page.getByTestId("input");
159
+ const areaField = page.getByRole("textbox");
160
+ // Fill with more content than maxRows should allow
161
+ const manyLines = Array(10).fill("Line content").join("\n");
162
+ yield areaField.fill(manyLines);
163
+ // Content should still be there - the key is that maxRows is applied
164
+ yield (0, fixtures_1.expect)(areaField).toHaveValue(manyLines);
165
+ // Verify the component is still visible and functional with large content
166
+ yield (0, fixtures_1.expect)(areaField).toBeVisible();
167
+ yield (0, fixtures_1.expect)(areaField).toBeEditable();
168
+ // The textarea should have some form of height constraint applied
169
+ // (exact implementation may vary, but component should remain functional)
170
+ const boundingRect = yield (0, component_test_helpers_1.getBounds)(textarea);
171
+ (0, fixtures_1.expect)(boundingRect).not.toBeNull();
172
+ (0, fixtures_1.expect)(boundingRect.height).toBeGreaterThan(0);
173
+ }));
174
+ (0, fixtures_1.test)("minRows sets minimum auto-size height", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
175
+ yield initTestBed(`<TextArea testId="input" autoSize="true" minRows="4" />`);
176
+ const textarea = page.getByTestId("input");
177
+ const areaField = page.getByRole("textbox");
178
+ yield (0, fixtures_1.expect)(textarea).toBeVisible();
179
+ yield (0, fixtures_1.expect)(areaField).toBeVisible();
180
+ // Even with no content, component should be functional
181
+ yield (0, fixtures_1.expect)(areaField).toHaveValue("");
182
+ // Fill with single line (less than minRows)
183
+ yield areaField.fill("Single line");
184
+ yield (0, fixtures_1.expect)(areaField).toHaveValue("Single line");
185
+ // Fill with content that matches minRows
186
+ yield areaField.fill("Line 1\nLine 2\nLine 3\nLine 4");
187
+ yield (0, fixtures_1.expect)(areaField).toHaveValue("Line 1\nLine 2\nLine 3\nLine 4");
188
+ // Verify the component remains functional with different content lengths
189
+ yield (0, fixtures_1.expect)(areaField).toBeVisible();
190
+ yield (0, fixtures_1.expect)(areaField).toBeEditable();
191
+ }));
192
+ (0, fixtures_1.test)("enterSubmits enables form submission on Enter", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
193
+ const { testStateDriver } = yield initTestBed(`
194
+ <Form onSubmit="testState = 'submitted'">
195
+ <TextArea enterSubmits="true" />
196
+ <Button type="submit" testId="submitBtn">Submit</Button>
197
+ </Form>
198
+ `);
199
+ const textarea = page.getByRole("textbox");
200
+ yield textarea.focus();
201
+ yield textarea.fill("Some content");
202
+ yield textarea.press("Enter");
203
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("submitted");
204
+ }));
205
+ (0, fixtures_1.test)("enterSubmits=false prevents form submission on Enter", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
206
+ const { testStateDriver } = yield initTestBed(`
207
+ <Form onSubmit="testState = 'submitted'">
208
+ <TextArea enterSubmits="false" />
209
+ <Button type="submit" testId="submitBtn">Submit</Button>
210
+ </Form>
211
+ `);
212
+ const textarea = page.getByRole("textbox");
213
+ yield textarea.focus();
214
+ yield textarea.fill("Some content");
215
+ yield textarea.press("Enter");
216
+ // Should not submit, so testState should remain null
217
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(null);
218
+ // But should allow new line in textarea
219
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Some content\n");
220
+ }));
221
+ (0, fixtures_1.test)("Shift+Enter creates new line even with enterSubmits=true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
222
+ const { testStateDriver } = yield initTestBed(`
223
+ <Form onSubmit="testState = 'submitted'">
224
+ <TextArea enterSubmits="true" />
225
+ </Form>
226
+ `);
227
+ const textarea = page.getByRole("textbox");
228
+ yield textarea.focus();
229
+ yield textarea.fill("Line 1");
230
+ yield textarea.press("Shift+Enter");
231
+ yield textarea.type("Line 2");
232
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Line 1\nLine 2");
233
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(null); // Should not have submitted
234
+ }));
235
+ (0, fixtures_1.test)("escResets enables form reset on Escape", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
236
+ yield initTestBed(`
237
+ <Form>
238
+ <TextArea id="myTextarea" initialValue="Initial value" escResets="true" />
239
+ </Form>
240
+ `);
241
+ const textarea = page.getByRole("textbox");
242
+ yield textarea.fill("Changed content");
243
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Changed content");
244
+ yield textarea.press("Escape");
245
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Initial value");
246
+ }));
247
+ (0, fixtures_1.test)("escResets=false does not reset on Escape", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
248
+ yield initTestBed(`<TextArea escResets="false" initialValue="Initial value" />`);
249
+ const textarea = page.getByRole("textbox");
250
+ yield textarea.fill("Changed content");
251
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Changed content");
252
+ yield textarea.press("Escape");
253
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Changed content"); // Should remain unchanged
254
+ }));
255
+ (0, fixtures_1.test)("component handles readOnly and enabled=false together", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
256
+ yield initTestBed(`<TextArea readOnly="true" enabled="false" />`);
257
+ const textarea = page.getByRole("textbox");
258
+ yield (0, fixtures_1.expect)(textarea).toBeDisabled();
259
+ yield (0, fixtures_1.expect)(textarea).toHaveAttribute("readonly");
260
+ }));
261
+ (0, fixtures_1.test)("component handles autoFocus with enabled=false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
262
+ yield initTestBed(`<TextArea autoFocus="true" enabled="false" />`);
263
+ const textarea = page.getByRole("textbox");
264
+ yield (0, fixtures_1.expect)(textarea).toBeDisabled();
265
+ yield (0, fixtures_1.expect)(textarea).not.toBeFocused();
266
+ }));
267
+ });
268
+ // =============================================================================
269
+ // ACCESSIBILITY TESTS
270
+ // =============================================================================
271
+ fixtures_1.test.describe("Accessibility", () => {
272
+ (0, fixtures_1.test)("component has correct accessibility attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
273
+ yield initTestBed(`<TextArea label="Comments" />`);
274
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("aria-multiline", "true");
275
+ }));
276
+ (0, fixtures_1.test)("component is keyboard accessible when interactive", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
277
+ const { testStateDriver } = yield initTestBed(`
278
+ <TextArea
279
+ label="Comments"
280
+ onGotFocus="testState = 'keyboard-focused'"
281
+ />
282
+ `);
283
+ const textarea = page.getByRole("textbox");
284
+ yield textarea.focus();
285
+ yield (0, fixtures_1.expect)(textarea).toBeFocused();
286
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("keyboard-focused");
287
+ }));
288
+ (0, fixtures_1.test)("non-interactive component is not focusable when disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
289
+ yield initTestBed(`<TextArea enabled="false" />`);
290
+ const textarea = page.getByRole("textbox");
291
+ yield (0, fixtures_1.expect)(textarea).toBeDisabled();
292
+ yield (0, fixtures_1.expect)(textarea).not.toBeFocused();
293
+ }));
294
+ (0, fixtures_1.test)("label is properly associated with textarea", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
295
+ yield initTestBed(`<TextArea label="User Comments" />`);
296
+ const component = page.getByLabel("User Comments");
297
+ yield (0, fixtures_1.expect)(component).toHaveRole("textbox");
298
+ }));
299
+ (0, fixtures_1.test)("required has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
300
+ yield initTestBed(`<TextArea required="true" label="Required Comments" />`);
301
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("required");
302
+ yield (0, fixtures_1.expect)(page.getByText("Required Comments")).toContainText("*");
303
+ }));
304
+ (0, fixtures_1.test)("readOnly has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
305
+ yield initTestBed(`<TextArea readOnly="true" label="Read-only textarea" />`);
306
+ const textarea = page.getByRole("textbox");
307
+ yield (0, fixtures_1.expect)(textarea).toHaveAttribute("aria-readonly", "true");
308
+ yield (0, fixtures_1.expect)(textarea).toHaveAttribute("readonly");
309
+ }));
310
+ (0, fixtures_1.test)("placeholder provides accessible description", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
311
+ yield initTestBed(`<TextArea placeholder="Describe your feedback in detail" />`);
312
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("placeholder", "Describe your feedback in detail");
313
+ }));
314
+ (0, fixtures_1.test)("component supports multiple textareas with keyboard navigation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
315
+ yield initTestBed(`
316
+ <Fragment>
317
+ <TextArea label="First textarea" />
318
+ <TextArea label="Second textarea" />
319
+ </Fragment>
320
+ `);
321
+ const firstTextarea = page.getByLabel("First textarea");
322
+ const secondTextarea = page.getByLabel("Second textarea");
323
+ yield firstTextarea.focus();
324
+ yield (0, fixtures_1.expect)(firstTextarea).toBeFocused();
325
+ yield page.keyboard.press("Tab");
326
+ yield (0, fixtures_1.expect)(secondTextarea).toBeFocused();
327
+ }));
328
+ });
329
+ // =============================================================================
330
+ // VISUAL STATE TESTS
331
+ // =============================================================================
332
+ fixtures_1.test.describe("Visual States", () => {
333
+ (0, fixtures_1.test)("component applies theme variables correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
334
+ yield initTestBed(`<TextArea testId="input" />`, {
335
+ testThemeVars: {
336
+ "backgroundColor-TextArea-default": "rgb(255, 0, 0)",
337
+ "textColor-TextArea-default": "rgb(0, 255, 0)",
338
+ },
339
+ });
340
+ yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("background-color", "rgb(255, 0, 0)");
341
+ yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("color", "rgb(0, 255, 0)");
342
+ }));
343
+ (0, fixtures_1.test)("component handles horizontal resize option", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
344
+ yield initTestBed(`<TextArea resize="horizontal" />`);
345
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveCSS("resize", "horizontal");
346
+ }));
347
+ (0, fixtures_1.test)("component handles vertical resize option", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
348
+ yield initTestBed(`<TextArea resize="vertical" />`);
349
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveCSS("resize", "vertical");
350
+ }));
351
+ (0, fixtures_1.test)("component handles both resize option", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
352
+ yield initTestBed(`<TextArea resize="both" />`);
353
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveCSS("resize", "both");
354
+ }));
355
+ (0, fixtures_1.test)("component handles disabled visual state", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
356
+ yield initTestBed(`<TextArea enabled="false" />`, {
357
+ testThemeVars: {
358
+ "backgroundColor-TextArea--disabled": "rgb(255, 0, 0)",
359
+ "textColor-TextArea--disabled": "rgb(0, 255, 0)",
360
+ "borderColor-TextArea--disabled": "rgb(0, 0, 255)"
361
+ },
362
+ });
363
+ const textarea = page.getByRole("textbox");
364
+ yield (0, fixtures_1.expect)(textarea).toBeDisabled();
365
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("background-color", "rgb(255, 0, 0)");
366
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("color", "rgb(0, 255, 0)");
367
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("border-color", "rgb(0, 0, 255)");
368
+ }));
369
+ (0, fixtures_1.test)("component handles focus state", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
370
+ yield initTestBed(`<TextArea />`, {
371
+ testThemeVars: {
372
+ "borderColor-TextArea--focus": "rgb(255, 0, 0)",
373
+ "backgroundColor-TextArea--focus": "rgb(0, 255, 0)",
374
+ "textColor-TextArea--focus": "rgb(0, 0, 255)",
375
+ },
376
+ });
377
+ const textarea = page.getByRole("textbox");
378
+ // Test focus state
379
+ yield textarea.focus();
380
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("border-color", "rgb(255, 0, 0)");
381
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("background-color", "rgb(0, 255, 0)");
382
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("color", "rgb(0, 0, 255)");
383
+ }));
384
+ (0, fixtures_1.test)("component handles hover state", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
385
+ yield initTestBed(`<TextArea />`, {
386
+ testThemeVars: {
387
+ "borderColor-TextArea--hover": "rgb(255, 0, 0)",
388
+ "backgroundColor-TextArea--hover": "rgb(0, 255, 0)",
389
+ "textColor-TextArea--hover": "rgb(0, 0, 255)",
390
+ },
391
+ });
392
+ const textarea = page.getByRole("textbox");
393
+ // Test hover state (simulated through interaction)
394
+ yield textarea.hover();
395
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("border-color", "rgb(255, 0, 0)");
396
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("background-color", "rgb(0, 255, 0)");
397
+ yield (0, fixtures_1.expect)(textarea).toHaveCSS("color", "rgb(0, 0, 255)");
398
+ }));
399
+ });
400
+ // =============================================================================
401
+ // EDGE CASE TESTS
402
+ // =============================================================================
403
+ fixtures_1.test.describe("Edge Cases", () => {
404
+ (0, fixtures_1.test)("component handles special characters correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
405
+ yield initTestBed(`<TextArea label="José María's Comments" placeholder="Введите текст здесь" />`);
406
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
407
+ yield (0, fixtures_1.expect)(page.getByText("José María's Comments")).toBeVisible();
408
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("placeholder", "Введите текст здесь");
409
+ }));
410
+ (0, fixtures_1.test)("component handles empty array as initialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
411
+ yield initTestBed(`<TextArea initialValue="{[]}" />`);
412
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
413
+ }));
414
+ (0, fixtures_1.test)("component handles empty object as initialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
415
+ yield initTestBed(`<TextArea initialValue="{{}}" />`);
416
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("[object Object]");
417
+ }));
418
+ (0, fixtures_1.test)("component handles function as initialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
419
+ yield initTestBed(`<TextArea initialValue="{() => {}}" />`);
420
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("[object Object]");
421
+ }));
422
+ (0, fixtures_1.test)("component handles negative maxLength gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
423
+ yield initTestBed(`<TextArea maxLength="{-1}" />`);
424
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
425
+ }));
426
+ (0, fixtures_1.test)("component handles zero maxLength gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
427
+ yield initTestBed(`<TextArea maxLength="0" />`);
428
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
429
+ }));
430
+ (0, fixtures_1.test)("component handles very large maxLength gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
431
+ yield initTestBed(`<TextArea maxLength="999999" />`);
432
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
433
+ }));
434
+ (0, fixtures_1.test)("component handles invalid resize values gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
435
+ yield initTestBed(`<TextArea resize="invalid" />`);
436
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveCSS("resize", "none");
437
+ }));
438
+ (0, fixtures_1.test)("component handles empty value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
439
+ yield initTestBed(`<TextArea initialValue="" />`);
440
+ const textarea = page.getByRole("textbox");
441
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("");
442
+ }));
443
+ (0, fixtures_1.test)("component handles whitespace-only value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
444
+ yield initTestBed(`<TextArea initialValue=" " />`);
445
+ const whitespaceTextarea = page.getByRole("textbox");
446
+ yield (0, fixtures_1.expect)(whitespaceTextarea).toHaveValue(" ");
447
+ }));
448
+ (0, fixtures_1.test)("component handles tab and newline characters in value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
449
+ yield initTestBed(`<TextArea initialValue="\t\n" />`);
450
+ const tabNewlineTextarea = page.getByRole("textbox");
451
+ const value = yield tabNewlineTextarea.inputValue();
452
+ (0, fixtures_1.expect)(value).toContain("\t");
453
+ (0, fixtures_1.expect)(value).toContain("\n");
454
+ }));
455
+ (0, fixtures_1.test)("component handles very long input values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
456
+ const longValue = "Very long value that might cause issues with component rendering or processing. ".repeat(100);
457
+ yield initTestBed(`<TextArea initialValue="${longValue}" />`);
458
+ const textarea = page.getByRole("textbox");
459
+ yield (0, fixtures_1.expect)(textarea).toBeVisible();
460
+ yield (0, fixtures_1.expect)(textarea).toHaveValue(longValue);
461
+ }));
462
+ (0, fixtures_1.test)("component handles invalid maxRows/minRows combinations with autoSize", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
463
+ yield initTestBed(`<TextArea autoSize="true" maxRows="2" minRows="5" />`);
464
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
465
+ }));
466
+ (0, fixtures_1.test)("component handles zero maxRows/minRows values with autoSize", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
467
+ yield initTestBed(`<TextArea autoSize="true" maxRows="0" minRows="0" />`);
468
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
469
+ }));
470
+ (0, fixtures_1.test)("component handles negative maxRows/minRows values with autoSize", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
471
+ yield initTestBed(`<TextArea autoSize="true" maxRows="{-1}" minRows="{-1}" />`);
472
+ yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
473
+ }));
474
+ });
475
+ // =============================================================================
476
+ // PERFORMANCE TESTS
477
+ // =============================================================================
478
+ fixtures_1.test.describe("Performance", () => {
479
+ (0, fixtures_1.test)("component memoization prevents unnecessary re-renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
480
+ const { testStateDriver } = yield initTestBed(`
481
+ <TextArea
482
+ label="Performance Test"
483
+ onDidChange="testState = ++testState || 1"
484
+ />
485
+ `);
486
+ const textarea = page.getByRole("textbox");
487
+ // Test that memoization works through stable behavior
488
+ yield textarea.fill("a");
489
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(1);
490
+ yield textarea.fill("ab");
491
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(2);
492
+ // Component should maintain consistent behavior
493
+ yield (0, fixtures_1.expect)(textarea).toBeVisible();
494
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("ab");
495
+ }));
496
+ (0, fixtures_1.test)("component handles large content efficiently", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
497
+ const largeContent = "Large content line.\n".repeat(1000);
498
+ yield initTestBed(`<TextArea />`);
499
+ const textarea = page.getByRole("textbox");
500
+ // Fill with large content
501
+ yield textarea.fill(largeContent);
502
+ yield (0, fixtures_1.expect)(textarea).toHaveValue(largeContent);
503
+ // Verify component still responsive
504
+ yield textarea.clear();
505
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("");
506
+ }));
507
+ (0, fixtures_1.test)("component performs well with rapid user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
508
+ const { testStateDriver } = yield initTestBed(`
509
+ <TextArea onDidChange="testState = (testState || 0) + 1" />
510
+ `);
511
+ const textarea = page.getByRole("textbox");
512
+ // Simulate rapid typing
513
+ yield textarea.pressSequentially("rapid input test", { delay: 10 });
514
+ // Should have received multiple change events efficiently
515
+ const changeCount = yield testStateDriver.testState();
516
+ (0, fixtures_1.expect)(changeCount).toBeGreaterThan(10);
517
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("rapid input test");
518
+ }));
519
+ });
520
+ // =============================================================================
521
+ // INTEGRATION TESTS
522
+ // =============================================================================
523
+ fixtures_1.test.describe("Integration", () => {
524
+ (0, fixtures_1.test)("component works correctly in different layout contexts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
525
+ yield initTestBed(`<TextArea label="Layout Test" />`);
526
+ const textarea = page.getByRole("textbox");
527
+ // Test basic layout integration
528
+ yield (0, fixtures_1.expect)(textarea).toBeVisible();
529
+ // Test bounding box and dimensions
530
+ const boundingBox = yield (0, component_test_helpers_1.getBounds)(textarea);
531
+ (0, fixtures_1.expect)(boundingBox).not.toBeNull();
532
+ (0, fixtures_1.expect)(boundingBox.width).toBeGreaterThan(0);
533
+ (0, fixtures_1.expect)(boundingBox.height).toBeGreaterThan(0);
534
+ }));
535
+ (0, fixtures_1.test)("component integrates with Form components", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
536
+ yield initTestBed(`
537
+ <Fragment>
538
+ <TextArea id="comments" label="Comments" required="true" />
539
+ <Button testId="submit">Submit</Button>
540
+ </Fragment>
541
+ `);
542
+ const textarea = page.getByLabel("Comments");
543
+ const submitButton = page.getByTestId("submit");
544
+ yield (0, fixtures_1.expect)(textarea).toBeVisible();
545
+ yield (0, fixtures_1.expect)(submitButton).toBeVisible();
546
+ // Test form interaction
547
+ yield textarea.fill("User feedback");
548
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("User feedback");
549
+ }));
550
+ (0, fixtures_1.test)("component state synchronization with other components", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
551
+ yield initTestBed(`
552
+ <Fragment>
553
+ <TextArea id="textarea" initialValue="Initial text" />
554
+ <Text testId="display">{textarea.value}</Text>
555
+ <Button testId="clear" onClick="textarea.setValue('')">Clear</Button>
556
+ </Fragment>
557
+ `);
558
+ // Initial state sync
559
+ yield (0, fixtures_1.expect)(page.getByTestId("display")).toHaveText("Initial text");
560
+ // Manual input sync
561
+ const textarea = page.getByRole("textbox");
562
+ yield textarea.fill("Updated text");
563
+ yield (0, fixtures_1.expect)(page.getByTestId("display")).toHaveText("Updated text");
564
+ // API call sync
565
+ yield page.getByTestId("clear").click();
566
+ yield (0, fixtures_1.expect)(page.getByTestId("display")).toHaveText("");
567
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("");
568
+ }));
569
+ (0, fixtures_1.test)("component works with event handling chain", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
570
+ const { testStateDriver } = yield initTestBed(`
571
+ <Fragment>
572
+ <TextArea
573
+ onGotFocus="testState = 'focused'"
574
+ onLostFocus="testState = 'blurred'"
575
+ onDidChange="(value) => testState = 'changed: ' + value"
576
+ />
577
+ <Button testId="otherElement">Other Element</Button>
578
+ </Fragment>
579
+ `);
580
+ const textarea = page.getByRole("textbox");
581
+ const button = page.getByTestId("otherElement");
582
+ // Test focus event
583
+ yield textarea.focus();
584
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused");
585
+ // Test change event (use fill for reliable event triggering)
586
+ yield textarea.fill("test input");
587
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("changed: test input");
588
+ // Test blur event
589
+ yield button.focus();
590
+ yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("blurred");
591
+ }));
592
+ (0, fixtures_1.test)("component API methods work in integrated scenarios", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
593
+ yield initTestBed(`
594
+ <Fragment>
595
+ <TextArea id="textarea1" />
596
+ <TextArea id="textarea2" />
597
+ <Button testId="copyBtn" onClick="textarea2.setValue(textarea1.value)">Copy</Button>
598
+ <Button testId="focusBtn" onClick="textarea1.focus()">Focus First</Button>
599
+ </Fragment>
600
+ `);
601
+ const textarea1 = page.getByRole("textbox").first();
602
+ const textarea2 = page.getByRole("textbox").nth(1);
603
+ const copyBtn = page.getByTestId("copyBtn");
604
+ const focusBtn = page.getByTestId("focusBtn");
605
+ // Setup initial content
606
+ yield textarea1.fill("Content to copy");
607
+ // Test setValue API integration
608
+ yield copyBtn.click();
609
+ yield (0, fixtures_1.expect)(textarea2).toHaveValue("Content to copy");
610
+ // Test focus API integration
611
+ yield focusBtn.click();
612
+ yield (0, fixtures_1.expect)(textarea1).toBeFocused();
613
+ }));
614
+ (0, fixtures_1.test)("component works in nested component structures", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
615
+ yield initTestBed(`
616
+ <Fragment>
617
+ <VStack>
618
+ <TextArea label="Nested Textarea 1" />
619
+ <HStack>
620
+ <TextArea label="Nested Textarea 2" />
621
+ <Button testId="nestedBtn">Button</Button>
622
+ </HStack>
623
+ </VStack>
624
+ </Fragment>
625
+ `);
626
+ const textarea1 = page.getByLabel("Nested Textarea 1");
627
+ const textarea2 = page.getByLabel("Nested Textarea 2");
628
+ const button = page.getByTestId("nestedBtn");
629
+ yield (0, fixtures_1.expect)(textarea1).toBeVisible();
630
+ yield (0, fixtures_1.expect)(textarea2).toBeVisible();
631
+ yield (0, fixtures_1.expect)(button).toBeVisible();
632
+ // Test interaction in nested structure
633
+ yield textarea1.fill("Content in nested structure");
634
+ yield (0, fixtures_1.expect)(textarea1).toHaveValue("Content in nested structure");
635
+ }));
636
+ (0, fixtures_1.test)("programmatic control works", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
637
+ yield initTestBed(`
638
+ <Fragment>
639
+ <TextArea id="input" />
640
+ <Button testId="focusBtn" onClick="input.focus()">Focus</Button>
641
+ <Button testId="setBtn" onClick="input.setValue('API Value')">Set Value</Button>
642
+ <Button testId="insertBtn" onClick="input.insert(' inserted')">Insert Text</Button>
643
+ </Fragment>
644
+ `);
645
+ const textarea = page.getByRole("textbox");
646
+ // Test focus API
647
+ yield page.getByTestId("focusBtn").click();
648
+ yield (0, fixtures_1.expect)(textarea).toBeFocused();
649
+ // Test setValue API
650
+ yield page.getByTestId("setBtn").click();
651
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("API Value");
652
+ // Test insert API
653
+ yield textarea.click(); // Focus and position cursor at end
654
+ yield page.getByTestId("insertBtn").click();
655
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("API Value inserted");
656
+ }));
657
+ (0, fixtures_1.test)("insert API method works at cursor position", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
658
+ yield initTestBed(`
659
+ <Fragment>
660
+ <TextArea id="textarea" initialValue="Hello World" />
661
+ <Button testId="insertBtn" onClick="textarea.insert(' Beautiful')">Insert</Button>
662
+ </Fragment>
663
+ `);
664
+ const textarea = page.getByRole("textbox");
665
+ // Position cursor between "Hello" and " World" (after "Hello")
666
+ yield textarea.focus();
667
+ yield page.evaluate(() => {
668
+ const textarea = document.querySelector("textarea");
669
+ if (textarea) {
670
+ textarea.setSelectionRange(5, 5); // Position after "Hello"
671
+ }
672
+ });
673
+ yield page.getByTestId("insertBtn").click();
674
+ yield (0, fixtures_1.expect)(textarea).toHaveValue("Hello Beautiful World");
675
+ }));
676
+ (0, fixtures_1.test)("component value API reflects current content", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
677
+ yield initTestBed(`
678
+ <Fragment>
679
+ <TextArea id="myTextArea" initialValue="Initial content" />
680
+ <Text testId="valueDisplay">{myTextArea.value}</Text>
681
+ </Fragment>
682
+ `);
683
+ const textarea = page.getByRole("textbox");
684
+ const valueDisplay = page.getByTestId("valueDisplay");
685
+ yield (0, fixtures_1.expect)(valueDisplay).toHaveText("Initial content");
686
+ yield textarea.fill("Updated content");
687
+ yield (0, fixtures_1.expect)(valueDisplay).toHaveText("Updated content");
688
+ }));
689
+ });
690
+ // =============================================================================
691
+ // REGRESSION TESTS
692
+ // =============================================================================
693
+ fixtures_1.test.describe("Regression", () => {
694
+ (0, fixtures_1.test)("component does not loose focus #1", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextAreaDriver, createTextBoxDriver, }) {
695
+ yield initTestBed(`
696
+ <Fragment var.value="">
697
+ <TextBox testId="myTextBox" initialValue="{value}" onDidChange="{(val) => {value = val}}"/>
698
+ <TextArea testId="myTextArea" initialValue="{value}" onDidChange="{(val) => {value = val}}"/>
699
+ </Fragment>
700
+ `);
701
+ const tbDriver = yield createTextBoxDriver("myTextBox");
702
+ const driver = yield createTextAreaDriver("myTextArea");
703
+ // Test basic layout integration
704
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
705
+ yield driver.focus();
706
+ yield (0, fixtures_1.expect)(driver.component).toBeFocused();
707
+ yield driver.component.fill("a");
708
+ yield (0, fixtures_1.expect)(driver.component).toHaveValue("a");
709
+ yield driver.component.fill("abc");
710
+ yield (0, fixtures_1.expect)(driver.component).toHaveValue("abc");
711
+ yield driver.component.fill("abcde");
712
+ yield (0, fixtures_1.expect)(driver.component).toHaveValue("abcde");
713
+ }));
714
+ });