xmlui 0.10.14 → 0.10.16

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 (74) hide show
  1. package/dist/lib/{index-779mp2Bm.mjs → index-D4RYJasT.mjs} +2952 -937
  2. package/dist/lib/index.css +1 -1
  3. package/dist/lib/{initMock-CAXdczCj.mjs → initMock-qzTZlH-6.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-parser.d.ts +1 -1
  9. package/dist/lib/xmlui.d.ts +87 -11
  10. package/dist/lib/xmlui.mjs +72 -37
  11. package/dist/metadata/{collectedComponentMetadata-7DFXlw-J.mjs → collectedComponentMetadata-BQaefK3f.mjs} +3189 -1242
  12. package/dist/metadata/{initMock-AFWEftc6.mjs → initMock-Cz6QssI3.mjs} +1 -1
  13. package/dist/metadata/style.css +1 -1
  14. package/dist/metadata/xmlui-metadata.mjs +1 -1
  15. package/dist/metadata/xmlui-metadata.umd.js +3 -3
  16. package/dist/scripts/package.json +2 -3
  17. package/dist/scripts/src/components/Animation/AnimationNative.js +5 -1
  18. package/dist/scripts/src/components/AppState/AppState.js +32 -2
  19. package/dist/scripts/src/components/AppState/AppStateNative.js +27 -3
  20. package/dist/scripts/src/components/AutoComplete/AutoComplete.js +1 -5
  21. package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
  22. package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +263 -82
  23. package/dist/scripts/src/components/Button/Button.js +5 -1
  24. package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +41 -2
  25. package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +7 -9
  26. package/dist/scripts/src/components/Form/FormNative.js +33 -25
  27. package/dist/scripts/src/components/FormItem/ItemWithLabel.js +3 -3
  28. package/dist/scripts/src/components/Icon/IconNative.js +18 -15
  29. package/dist/scripts/src/components/NavGroup/NavGroup.spec.js +182 -123
  30. package/dist/scripts/src/components/NavGroup/NavGroupNative.js +14 -6
  31. package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
  32. package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -4
  33. package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +112 -423
  34. package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +18 -4
  35. package/dist/scripts/src/components/Option/Option.js +3 -1
  36. package/dist/scripts/src/components/Select/HiddenOption.js +1 -1
  37. package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +3 -1
  38. package/dist/scripts/src/components/Slider/Slider.spec.js +46 -13
  39. package/dist/scripts/src/components/Slider/SliderNative.js +19 -9
  40. package/dist/scripts/src/components/Table/Table.js +7 -1
  41. package/dist/scripts/src/components/Table/TableNative.js +4 -1
  42. package/dist/scripts/src/components/Table/useRowSelection.js +215 -1
  43. package/dist/scripts/src/components/TextBox/TextBox.js +1 -5
  44. package/dist/scripts/src/components/TextBox/TextBox.spec.js +368 -324
  45. package/dist/scripts/src/components/TextBox/TextBoxNative.js +10 -15
  46. package/dist/scripts/src/components/Theme/ThemeNative.js +2 -6
  47. package/dist/scripts/src/components/TimeInput/TimeInput.js +1 -5
  48. package/dist/scripts/src/components/TimeInput/TimeInputNative.js +2 -9
  49. package/dist/scripts/src/components/Tree/Tree-dynamic.spec.js +2894 -0
  50. package/dist/scripts/src/components/Tree/Tree.spec.js +2932 -0
  51. package/dist/scripts/src/components/Tree/TreeComponent.js +266 -10
  52. package/dist/scripts/src/components/Tree/TreeNative.js +1048 -23
  53. package/dist/scripts/src/components/Tree/testData.js +272 -0
  54. package/dist/scripts/src/components-core/ApiBoundComponent.js +38 -24
  55. package/dist/scripts/src/components-core/RestApiProxy.js +0 -1
  56. package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +54 -0
  57. package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +81 -0
  58. package/dist/scripts/src/components-core/descriptorHelper.js +1 -0
  59. package/dist/scripts/src/components-core/parts.js +4 -1
  60. package/dist/scripts/src/components-core/rendering/AppRoot.js +2 -1
  61. package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +32 -48
  62. package/dist/scripts/src/components-core/rendering/nodeUtils.js +6 -0
  63. package/dist/scripts/src/components-core/theming/layout-resolver.js +2 -0
  64. package/dist/scripts/src/components-core/utils/treeUtils.js +187 -12
  65. package/dist/scripts/src/index.js +38 -1
  66. package/dist/scripts/src/testing/ComponentDrivers.js +77 -31
  67. package/dist/scripts/src/testing/drivers/NumberBoxDriver.js +44 -0
  68. package/dist/scripts/src/testing/drivers/TextBoxDriver.js +20 -0
  69. package/dist/scripts/src/testing/drivers/TreeDriver.js +13 -0
  70. package/dist/scripts/src/testing/fixtures.js +40 -9
  71. package/dist/standalone/xmlui-standalone.es.d.ts +158 -15
  72. package/dist/standalone/xmlui-standalone.umd.js +36 -36
  73. package/package.json +2 -3
  74. package/dist/scripts/src/components/Animation/Animation.js +0 -50
@@ -15,233 +15,271 @@ const fixtures_1 = require("../../testing/fixtures");
15
15
  // BASIC FUNCTIONALITY TESTS
16
16
  // =============================================================================
17
17
  fixtures_1.test.describe("Basic Functionality", () => {
18
- (0, fixtures_1.test)("component renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
19
- yield initTestBed(`<TextBox />`);
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(`<TextBox label="Username" />`);
24
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
25
- yield (0, fixtures_1.expect)(page.getByText("Username")).toBeVisible();
26
- }));
27
- (0, fixtures_1.test)("initialValue sets field value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
28
- yield initTestBed(`<TextBox initialValue="test value" />`);
29
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("test value");
30
- }));
31
- (0, fixtures_1.test)("initialValue accepts empty as empty string", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
32
- yield initTestBed(`<TextBox initialValue="" />`);
33
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
34
- }));
35
- (0, fixtures_1.test)("initialValue accepts different data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
18
+ (0, fixtures_1.test)("component renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
19
+ yield initTestBed(`<TextBox testId="test" />`);
20
+ const driver = yield createTextBoxDriver("test");
21
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
22
+ }));
23
+ (0, fixtures_1.test)("component renders with label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
24
+ yield initTestBed(`<TextBox testId="test" label="Username" />`);
25
+ const driver = yield createTextBoxDriver("test");
26
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
27
+ yield (0, fixtures_1.expect)(driver.label).toBeVisible();
28
+ }));
29
+ (0, fixtures_1.test)("initialValue sets field value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
30
+ yield initTestBed(`<TextBox testId="test" initialValue="test value" />`);
31
+ const driver = yield createTextBoxDriver("test");
32
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("test value");
33
+ }));
34
+ (0, fixtures_1.test)("initialValue accepts empty as empty string", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
35
+ yield initTestBed(`<TextBox testId="test" initialValue="" />`);
36
+ const driver = yield createTextBoxDriver("test");
37
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("");
38
+ }));
39
+ (0, fixtures_1.test)("initialValue accepts different data types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
36
40
  // Test string
37
- yield initTestBed(`<TextBox initialValue="hello" />`);
38
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("hello");
41
+ yield initTestBed(`<TextBox testId="test" initialValue="hello" />`);
42
+ const driver1 = yield createTextBoxDriver("test");
43
+ yield (0, fixtures_1.expect)(driver1.input).toHaveValue("hello");
39
44
  // Test number
40
- yield initTestBed(`<TextBox initialValue="{123}" />`);
41
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("123");
45
+ yield initTestBed(`<TextBox testId="test" initialValue="{123}" />`);
46
+ const driver2 = yield createTextBoxDriver("test");
47
+ yield (0, fixtures_1.expect)(driver2.input).toHaveValue("123");
42
48
  // Test boolean
43
- yield initTestBed(`<TextBox initialValue="{true}" />`);
44
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("true");
45
- }));
46
- (0, fixtures_1.test)("initialValue handles null", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
47
- yield initTestBed(`<TextBox initialValue="{null}" />`);
48
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
49
- }));
50
- (0, fixtures_1.test)("initialValue handles undefined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
51
- yield initTestBed(`<TextBox initialValue="{undefined}" />`);
52
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("");
53
- }));
54
- (0, fixtures_1.test)("component accepts user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
55
- yield initTestBed(`<TextBox />`);
56
- yield page.getByRole("textbox").fill("user input");
57
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("user input");
58
- }));
59
- (0, fixtures_1.test)("component clears input correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
60
- yield initTestBed(`<TextBox initialValue="initial text" />`);
61
- const textbox = page.getByRole("textbox");
62
- yield (0, fixtures_1.expect)(textbox).toHaveValue("initial text");
63
- yield textbox.clear();
64
- yield (0, fixtures_1.expect)(textbox).toHaveValue("");
65
- }));
66
- (0, fixtures_1.test)("component required prop adds required attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
67
- yield initTestBed(`<TextBox required="true" />`);
68
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("required");
69
- }));
70
- (0, fixtures_1.test)("enabled=false disables control", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
71
- yield initTestBed(`<TextBox enabled="false" />`);
72
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeDisabled();
73
- }));
74
- (0, fixtures_1.test)("enabled=false prevents user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
75
- yield initTestBed(`<TextBox enabled="false" />`);
76
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).not.toBeEditable();
77
- }));
78
- (0, fixtures_1.test)("readOnly prevents editing but allows focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
79
- yield initTestBed(`<TextBox readOnly="true" initialValue="read only text" />`);
80
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("readonly");
81
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("read only text");
82
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).not.toBeEditable();
83
- yield page.getByRole("textbox").focus();
84
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeFocused();
85
- }));
86
- (0, fixtures_1.test)("autoFocus focuses input on mount", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
87
- yield initTestBed(`<TextBox autoFocus="true" />`);
88
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeFocused();
89
- }));
90
- (0, fixtures_1.test)("autoFocus focuses input on mount with label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
91
- yield initTestBed(`<TextBox autoFocus="true" label="Auto-focused input" />`);
92
- yield (0, fixtures_1.expect)(page.getByLabel("Auto-focused input")).toBeFocused();
93
- }));
94
- (0, fixtures_1.test)("placeholder shows when input is empty", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
95
- yield initTestBed(`<TextBox placeholder="Enter text here..." />`);
96
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("placeholder", "Enter text here...");
97
- }));
98
- (0, fixtures_1.test)("maxLength limits input length", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
99
- yield initTestBed(`<TextBox maxLength="5" />`);
100
- yield page.getByRole("textbox").fill("12345678");
101
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("12345");
102
- }));
103
- (0, fixtures_1.test)("can render startIcon", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
104
- yield initTestBed(`<TextBox startIcon="search" />`);
105
- yield (0, fixtures_1.expect)(page.getByRole("img")).toBeVisible();
106
- }));
107
- (0, fixtures_1.test)("can render endIcon", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
108
- yield initTestBed(`<TextBox endIcon="search" />`);
109
- yield (0, fixtures_1.expect)(page.getByRole("img")).toBeVisible();
49
+ yield initTestBed(`<TextBox testId="test" initialValue="{true}" />`);
50
+ const driver3 = yield createTextBoxDriver("test");
51
+ yield (0, fixtures_1.expect)(driver3.input).toHaveValue("true");
52
+ }));
53
+ (0, fixtures_1.test)("initialValue handles null", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
54
+ yield initTestBed(`<TextBox testId="test" initialValue="{null}" />`);
55
+ const driver = yield createTextBoxDriver("test");
56
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("");
57
+ }));
58
+ (0, fixtures_1.test)("initialValue handles undefined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
59
+ yield initTestBed(`<TextBox testId="test" initialValue="{undefined}" />`);
60
+ const driver = yield createTextBoxDriver("test");
61
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("");
62
+ }));
63
+ (0, fixtures_1.test)("component accepts user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
64
+ yield initTestBed(`<TextBox testId="test" />`);
65
+ const driver = yield createTextBoxDriver("test");
66
+ yield driver.input.fill("user input");
67
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("user input");
68
+ }));
69
+ (0, fixtures_1.test)("component clears input correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
70
+ yield initTestBed(`<TextBox testId="test" initialValue="initial text" />`);
71
+ const driver = yield createTextBoxDriver("test");
72
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("initial text");
73
+ yield driver.input.clear();
74
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("");
75
+ }));
76
+ (0, fixtures_1.test)("component required prop adds required attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
77
+ yield initTestBed(`<TextBox testId="test" required="true" />`);
78
+ const driver = yield createTextBoxDriver("test");
79
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("required");
80
+ }));
81
+ (0, fixtures_1.test)("enabled=false disables control", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
82
+ yield initTestBed(`<TextBox testId="test" enabled="false" />`);
83
+ const driver = yield createTextBoxDriver("test");
84
+ yield (0, fixtures_1.expect)(driver.input).toBeDisabled();
85
+ }));
86
+ (0, fixtures_1.test)("enabled=false prevents user input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
87
+ yield initTestBed(`<TextBox testId="test" enabled="false" />`);
88
+ const driver = yield createTextBoxDriver("test");
89
+ yield (0, fixtures_1.expect)(driver.input).not.toBeEditable();
90
+ }));
91
+ (0, fixtures_1.test)("readOnly prevents editing but allows focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
92
+ yield initTestBed(`<TextBox testId="test" readOnly="true" initialValue="read only text" />`);
93
+ const driver = yield createTextBoxDriver("test");
94
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("readonly");
95
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("read only text");
96
+ yield (0, fixtures_1.expect)(driver.input).not.toBeEditable();
97
+ yield driver.input.focus();
98
+ yield (0, fixtures_1.expect)(driver.input).toBeFocused();
99
+ }));
100
+ (0, fixtures_1.test)("autoFocus focuses input on mount", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
101
+ yield initTestBed(`<TextBox testId="test" autoFocus="true" />`);
102
+ const driver = yield createTextBoxDriver("test");
103
+ yield (0, fixtures_1.expect)(driver.input).toBeFocused();
104
+ }));
105
+ (0, fixtures_1.test)("autoFocus focuses input on mount with label", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
106
+ yield initTestBed(`<TextBox testId="test" autoFocus="true" label="Auto-focused input" />`);
107
+ const driver = yield createTextBoxDriver("test");
108
+ yield (0, fixtures_1.expect)(driver.input).toBeFocused();
109
+ }));
110
+ (0, fixtures_1.test)("placeholder shows when input is empty", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
111
+ yield initTestBed(`<TextBox testId="test" placeholder="Enter text here..." />`);
112
+ const driver = yield createTextBoxDriver("test");
113
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("placeholder", "Enter text here...");
114
+ }));
115
+ (0, fixtures_1.test)("maxLength limits input length", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
116
+ yield initTestBed(`<TextBox testId="test" maxLength="5" />`);
117
+ const driver = yield createTextBoxDriver("test");
118
+ yield driver.input.fill("12345678");
119
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("12345");
120
+ }));
121
+ (0, fixtures_1.test)("can render startIcon", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
122
+ yield initTestBed(`<TextBox testId="test" startIcon="search" />`);
123
+ const driver = yield createTextBoxDriver("test");
124
+ yield (0, fixtures_1.expect)(driver.startAdornment).toBeVisible();
125
+ }));
126
+ (0, fixtures_1.test)("can render endIcon", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
127
+ yield initTestBed(`<TextBox testId="test" endIcon="search" />`);
128
+ const driver = yield createTextBoxDriver("test");
129
+ yield (0, fixtures_1.expect)(driver.endAdornment).toBeVisible();
110
130
  }));
111
131
  });
112
132
  // =============================================================================
113
133
  // ACCESSIBILITY TESTS
114
134
  // =============================================================================
115
135
  fixtures_1.test.describe("Accessibility", () => {
116
- (0, fixtures_1.test)("label is properly associated with input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
117
- yield initTestBed(`<TextBox label="Username" />`);
118
- yield (0, fixtures_1.expect)(page.getByLabel("Username")).toBeVisible();
119
- }));
120
- (0, fixtures_1.test)("component supports keyboard navigation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
121
- yield initTestBed(`<TextBox label="Input" />`);
122
- yield page.keyboard.press("Tab", { delay: 100 });
123
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeFocused();
124
- }));
125
- (0, fixtures_1.test)("component supports keyboard navigation from other elements", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
136
+ (0, fixtures_1.test)("label is properly associated with input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
137
+ yield initTestBed(`<TextBox testId="test" label="Username" />`);
138
+ const driver = yield createTextBoxDriver("test");
139
+ yield (0, fixtures_1.expect)(driver.label).toBeVisible();
140
+ }));
141
+ (0, fixtures_1.test)("component supports keyboard navigation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
142
+ yield initTestBed(`<TextBox testId="test" label="Input" />`);
143
+ const driver = yield createTextBoxDriver("test");
144
+ yield driver.input.focus();
145
+ yield (0, fixtures_1.expect)(driver.input).toBeFocused();
146
+ }));
147
+ (0, fixtures_1.test)("component supports keyboard navigation from other elements", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver, }) {
126
148
  yield initTestBed(`
127
149
  <Fragment>
128
150
  <TextBox testId="first-input" label="First input" />
129
151
  <TextBox testId="second-input" label="Second input" />
130
152
  </Fragment>
131
153
  `);
132
- const firstInput = page.getByTestId("first-input").getByRole("textbox");
133
- const secondInput = page.getByTestId("second-input").getByRole("textbox");
134
- yield firstInput.focus();
135
- yield (0, fixtures_1.expect)(firstInput).toBeFocused();
154
+ const firstInput = yield createTextBoxDriver("first-input");
155
+ const secondInput = yield createTextBoxDriver("second-input");
156
+ yield firstInput.input.focus();
157
+ yield (0, fixtures_1.expect)(firstInput.input).toBeFocused();
136
158
  yield page.keyboard.press("Tab", { delay: 100 });
137
- yield (0, fixtures_1.expect)(secondInput).toBeFocused();
138
- }));
139
- (0, fixtures_1.test)("required has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
140
- yield initTestBed(`<TextBox required="true" label="Required input" />`);
141
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("required");
142
- yield (0, fixtures_1.expect)(page.getByText("Required input")).toContainText("*");
143
- }));
144
- (0, fixtures_1.test)("disabled component has proper attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
145
- yield initTestBed(`<TextBox enabled="false" />`);
146
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("disabled");
147
- }));
148
- (0, fixtures_1.test)("readOnly has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
149
- yield initTestBed(`<TextBox readOnly="true" label="Read-only input" />`);
150
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("readonly");
159
+ yield (0, fixtures_1.expect)(secondInput.input).toBeFocused();
160
+ }));
161
+ (0, fixtures_1.test)("required has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
162
+ yield initTestBed(`<TextBox testId="test" required="true" label="Required input" />`);
163
+ const driver = yield createTextBoxDriver("test");
164
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("required");
165
+ yield (0, fixtures_1.expect)(driver.label).toContainText("*");
166
+ }));
167
+ (0, fixtures_1.test)("disabled component has proper attribute", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
168
+ yield initTestBed(`<TextBox testId="test" enabled="false" />`);
169
+ const driver = yield createTextBoxDriver("test");
170
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("disabled");
171
+ }));
172
+ (0, fixtures_1.test)("readOnly has proper ARIA attributes", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
173
+ yield initTestBed(`<TextBox testId="test" readOnly="true" label="Read-only input" />`);
174
+ const driver = yield createTextBoxDriver("test");
175
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("readonly");
176
+ yield (0, fixtures_1.expect)(driver.label).toContainText("Read-only input");
177
+ yield (0, fixtures_1.expect)(driver.input).not.toBeEditable();
151
178
  }));
152
179
  });
153
180
  // =============================================================================
154
181
  // LABEL POSITIONING TESTS
155
182
  // =============================================================================
156
183
  fixtures_1.test.describe("Label", () => {
157
- (0, fixtures_1.test)("labelPosition=start positions label before input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
158
- yield initTestBed(`<TextBox direction="ltr" label="test" labelPosition="start" />`);
159
- const { left: textboxLeft } = yield (0, component_test_helpers_1.getBounds)(page.getByLabel("test"));
160
- const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("test"));
184
+ (0, fixtures_1.test)("labelPosition=start positions label before input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
185
+ yield initTestBed(`<TextBox testId="test" direction="ltr" label="test" labelPosition="start" />`);
186
+ const driver = yield createTextBoxDriver("test");
187
+ const { left: textboxLeft } = yield (0, component_test_helpers_1.getBounds)(driver.input);
188
+ const { right: labelRight } = yield (0, component_test_helpers_1.getBounds)(driver.label);
161
189
  (0, fixtures_1.expect)(labelRight).toBeLessThan(textboxLeft);
162
190
  }));
163
- (0, fixtures_1.test)("labelPosition=end positions label after input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
164
- yield initTestBed(`<TextBox direction="ltr" label="test" labelPosition="end" />`);
165
- const { right: textboxRight } = yield (0, component_test_helpers_1.getBounds)(page.getByLabel("test"));
166
- const { left: labelLeft } = yield (0, component_test_helpers_1.getBounds)(page.getByText("test"));
191
+ (0, fixtures_1.test)("labelPosition=end positions label after input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
192
+ yield initTestBed(`<TextBox testId="test" direction="ltr" label="test" labelPosition="end" />`);
193
+ const driver = yield createTextBoxDriver("test");
194
+ const { right: textboxRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
195
+ const { left: labelLeft } = yield (0, component_test_helpers_1.getBounds)(driver.label);
167
196
  (0, fixtures_1.expect)(labelLeft).toBeGreaterThan(textboxRight);
168
197
  }));
169
- (0, fixtures_1.test)("labelPosition=top positions label above input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
170
- yield initTestBed(`<TextBox label="test" labelPosition="top" />`);
171
- const { top: textboxTop } = yield (0, component_test_helpers_1.getBounds)(page.getByLabel("test"));
172
- const { bottom: labelBottom } = yield (0, component_test_helpers_1.getBounds)(page.getByText("test"));
198
+ (0, fixtures_1.test)("labelPosition=top positions label above input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
199
+ yield initTestBed(`<TextBox testId="test" label="test" labelPosition="top" />`);
200
+ const driver = yield createTextBoxDriver("test");
201
+ const { top: textboxTop } = yield (0, component_test_helpers_1.getBounds)(driver.input);
202
+ const { bottom: labelBottom } = yield (0, component_test_helpers_1.getBounds)(driver.label);
173
203
  (0, fixtures_1.expect)(labelBottom).toBeLessThan(textboxTop);
174
204
  }));
175
- (0, fixtures_1.test)("labelPosition=bottom positions label below input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
176
- yield initTestBed(`<TextBox label="test" labelPosition="bottom" />`);
177
- const { bottom: textboxBottom } = yield (0, component_test_helpers_1.getBounds)(page.getByLabel("test"));
178
- const { top: labelTop } = yield (0, component_test_helpers_1.getBounds)(page.getByText("test"));
205
+ (0, fixtures_1.test)("labelPosition=bottom positions label below input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
206
+ yield initTestBed(`<TextBox testId="test" label="test" labelPosition="bottom" />`);
207
+ const driver = yield createTextBoxDriver("test");
208
+ const { bottom: textboxBottom } = yield (0, component_test_helpers_1.getBounds)(driver.input);
209
+ const { top: labelTop } = yield (0, component_test_helpers_1.getBounds)(driver.label);
179
210
  (0, fixtures_1.expect)(labelTop).toBeGreaterThan(textboxBottom);
180
211
  }));
181
- (0, fixtures_1.test)("labelWidth applies custom label width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
212
+ (0, fixtures_1.test)("labelWidth applies custom label width", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
182
213
  const expected = 200;
183
- yield initTestBed(`<TextBox label="test test" labelWidth="${expected}px" />`);
184
- const { width } = yield (0, component_test_helpers_1.getBounds)(page.getByText("test test"));
214
+ yield initTestBed(`<TextBox testId="test" label="test test" labelWidth="${expected}px" />`);
215
+ const driver = yield createTextBoxDriver("test");
216
+ const { width } = yield (0, component_test_helpers_1.getBounds)(driver.label);
185
217
  (0, fixtures_1.expect)(width).toEqual(expected);
186
218
  }));
187
- (0, fixtures_1.test)("labelBreak enables label line breaks", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
219
+ (0, fixtures_1.test)("labelBreak enables label line breaks", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
188
220
  const labelText = "Very long label text that should break";
189
221
  const commonProps = `label="${labelText}" labelWidth="100px"`;
190
222
  yield initTestBed(`<Fragment>
191
223
  <TextBox ${commonProps} testId="break" labelBreak="{true}" />
192
224
  <TextBox ${commonProps} testId="oneLine" labelBreak="{false}" />
193
225
  </Fragment>`);
194
- const labelBreak = page.getByTestId("break").getByText(labelText);
195
- const labelOneLine = page.getByTestId("oneLine").getByText(labelText);
196
- const { height: heightBreak } = yield (0, component_test_helpers_1.getBounds)(labelBreak);
197
- const { height: heightOneLine } = yield (0, component_test_helpers_1.getBounds)(labelOneLine);
226
+ const driverBreak = yield createTextBoxDriver("break");
227
+ const driverOneLine = yield createTextBoxDriver("oneLine");
228
+ const { height: heightBreak } = yield (0, component_test_helpers_1.getBounds)(driverBreak.label);
229
+ const { height: heightOneLine } = yield (0, component_test_helpers_1.getBounds)(driverOneLine.label);
198
230
  (0, fixtures_1.expect)(heightBreak).toBeGreaterThan(heightOneLine);
199
231
  }));
200
- (0, fixtures_1.test)("component handles invalid labelPosition gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
201
- yield initTestBed(`<TextBox labelPosition="invalid" label="test" />`);
202
- yield (0, fixtures_1.expect)(page.getByLabel("test")).toBeVisible();
203
- yield (0, fixtures_1.expect)(page.getByText("test")).toBeVisible();
232
+ (0, fixtures_1.test)("component handles invalid labelPosition gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
233
+ yield initTestBed(`<TextBox testId="test" labelPosition="invalid" label="test" />`);
234
+ const driver = yield createTextBoxDriver("test");
235
+ yield (0, fixtures_1.expect)(driver.label).toBeVisible();
236
+ yield (0, fixtures_1.expect)(driver.input).toBeVisible();
204
237
  }));
205
238
  });
206
239
  // =============================================================================
207
240
  // EVENT HANDLING TESTS
208
241
  // =============================================================================
209
242
  fixtures_1.test.describe("Event Handling", () => {
210
- (0, fixtures_1.test)("didChange event fires on input change", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
243
+ (0, fixtures_1.test)("didChange event fires on input change", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
211
244
  const { testStateDriver } = yield initTestBed(`
212
- <TextBox onDidChange="testState = 'changed'" />
245
+ <TextBox testId="test" onDidChange="testState = 'changed'" />
213
246
  `);
214
- yield page.getByRole("textbox").fill("test");
247
+ const driver = yield createTextBoxDriver("test");
248
+ yield driver.input.fill("test");
215
249
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("changed");
216
250
  }));
217
- (0, fixtures_1.test)("didChange event passes new value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
251
+ (0, fixtures_1.test)("didChange event passes new value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
218
252
  const { testStateDriver } = yield initTestBed(`
219
- <TextBox onDidChange="arg => testState = arg" />
253
+ <TextBox testId="test" onDidChange="arg => testState = arg" />
220
254
  `);
221
- yield page.getByRole("textbox").fill("test value");
255
+ const driver = yield createTextBoxDriver("test");
256
+ yield driver.input.fill("test value");
222
257
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("test value");
223
258
  }));
224
- (0, fixtures_1.test)("gotFocus event fires on focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
259
+ (0, fixtures_1.test)("gotFocus event fires on focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
225
260
  const { testStateDriver } = yield initTestBed(`
226
- <TextBox onGotFocus="testState = 'focused'" />
261
+ <TextBox testId="test" onGotFocus="testState = 'focused'" />
227
262
  `);
228
- yield page.getByRole("textbox").focus();
263
+ const driver = yield createTextBoxDriver("test");
264
+ yield driver.input.focus();
229
265
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("focused");
230
266
  }));
231
- (0, fixtures_1.test)("component lostFocus event fires on blur", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
267
+ (0, fixtures_1.test)("component lostFocus event fires on blur", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
232
268
  const { testStateDriver } = yield initTestBed(`
233
- <TextBox onLostFocus="testState = 'blurred'" />
269
+ <TextBox testId="test" onLostFocus="testState = 'blurred'" />
234
270
  `);
235
- yield page.getByRole("textbox").focus();
236
- yield page.getByRole("textbox").blur();
271
+ const driver = yield createTextBoxDriver("test");
272
+ yield driver.input.focus();
273
+ yield driver.input.blur();
237
274
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("blurred");
238
275
  }));
239
- (0, fixtures_1.test)("events do not fire when component is disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
276
+ (0, fixtures_1.test)("events do not fire when component is disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
240
277
  const { testStateDriver } = yield initTestBed(`
241
- <TextBox enabled="false" didChange="testState = 'changed'" gotFocus="testState = 'focused'" />
278
+ <TextBox testId="test" enabled="false" didChange="testState = 'changed'" gotFocus="testState = 'focused'" />
242
279
  `);
243
- yield page.getByRole("textbox").focus();
244
- yield page.getByRole("textbox").fill("test", { force: true });
280
+ const driver = yield createTextBoxDriver("test");
281
+ yield driver.input.focus();
282
+ yield driver.input.fill("test", { force: true });
245
283
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual(null);
246
284
  }));
247
285
  });
@@ -258,26 +296,28 @@ fixtures_1.test.describe("Api", () => {
258
296
  `);
259
297
  yield (0, fixtures_1.expect)(page.getByTestId("value")).toHaveText("initial");
260
298
  }));
261
- (0, fixtures_1.test)("component value API returns state after change", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
299
+ (0, fixtures_1.test)("component value API returns state after change", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver }) {
262
300
  yield initTestBed(`
263
301
  <Fragment>
264
- <TextBox id="myTextBox" />
302
+ <TextBox id="myTextBox" testId="myTextBox" />
265
303
  <Text testId="value">{myTextBox.value}</Text>
266
304
  </Fragment>
267
305
  `);
306
+ const driver = yield createTextBoxDriver("myTextBox");
268
307
  yield (0, fixtures_1.expect)(page.getByTestId("value")).toHaveText("");
269
- yield page.getByRole("textbox").fill("new value");
308
+ yield driver.input.fill("new value");
270
309
  yield (0, fixtures_1.expect)(page.getByTestId("value")).toHaveText("new value");
271
310
  }));
272
- (0, fixtures_1.test)("component setValue API updates state", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
311
+ (0, fixtures_1.test)("component setValue API updates state", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver }) {
273
312
  yield initTestBed(`
274
313
  <Fragment>
275
- <TextBox id="myTextBox" />
314
+ <TextBox id="myTextBox" testId="myTextBox" />
276
315
  <Button testId="setBtn" onClick="myTextBox.setValue('api value')" />
277
316
  </Fragment>
278
317
  `);
318
+ const driver = yield createTextBoxDriver("myTextBox");
279
319
  yield page.getByTestId("setBtn").click();
280
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("api value");
320
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("api value");
281
321
  }));
282
322
  (0, fixtures_1.test)("component setValue API triggers events", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
283
323
  const { testStateDriver } = yield initTestBed(`
@@ -289,103 +329,83 @@ fixtures_1.test.describe("Api", () => {
289
329
  yield page.getByTestId("setBtn").click();
290
330
  yield fixtures_1.expect.poll(testStateDriver.testState).toEqual("api-changed");
291
331
  }));
292
- (0, fixtures_1.test)("focus API focuses the input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
332
+ (0, fixtures_1.test)("focus API focuses the input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver }) {
293
333
  yield initTestBed(`
294
334
  <Fragment>
295
335
  <TextBox id="myTextBox" />
296
336
  <Button testId="focusBtn" onClick="myTextBox.focus()">Focus</Button>
297
337
  </Fragment>
298
338
  `);
299
- const textbox = page.getByRole("textbox");
300
- yield (0, fixtures_1.expect)(textbox).not.toBeFocused();
339
+ const driver = yield createTextBoxDriver("myTextBox");
340
+ yield (0, fixtures_1.expect)(driver.input).not.toBeFocused();
301
341
  yield page.getByTestId("focusBtn").click();
302
- yield (0, fixtures_1.expect)(textbox).toBeFocused();
342
+ yield (0, fixtures_1.expect)(driver.input).toBeFocused();
303
343
  }));
304
- (0, fixtures_1.test)("focus API does nothing when component is disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
344
+ (0, fixtures_1.test)("focus API does nothing when component is disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver }) {
305
345
  yield initTestBed(`
306
346
  <Fragment>
307
347
  <TextBox id="myTextBox" enabled="false" />
308
348
  <Button testId="focusBtn" onClick="myTextBox.focus()">Focus</Button>
309
349
  </Fragment>
310
350
  `);
351
+ const driver = yield createTextBoxDriver("myTextBox");
311
352
  yield page.getByTestId("focusBtn").click();
312
- const textbox = page.getByRole("textbox");
313
- yield (0, fixtures_1.expect)(textbox).not.toBeFocused();
353
+ yield (0, fixtures_1.expect)(driver.input).not.toBeFocused();
314
354
  }));
315
355
  });
316
356
  // =============================================================================
317
357
  // INPUT ADORNMENTS TESTS
318
358
  // =============================================================================
319
359
  fixtures_1.test.describe("Input Adornments", () => {
320
- (0, fixtures_1.test)("startText displays at beginning of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
321
- yield initTestBed(`<TextBox testId="input" direction="ltr" startText="$" />`);
322
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
323
- const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("$"));
324
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("$");
360
+ (0, fixtures_1.test)("startText displays at beginning of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
361
+ yield initTestBed(`<TextBox testId="input" startText="$" />`);
362
+ const driver = yield createTextBoxDriver("input");
363
+ const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
364
+ const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(driver.startAdornment);
365
+ yield (0, fixtures_1.expect)(driver.startAdornment).toContainText("$");
325
366
  (0, fixtures_1.expect)(textRight - compLeft).toBeLessThanOrEqual(compRight - textLeft);
326
367
  }));
327
- (0, fixtures_1.test)("startText displays at beginning of input (rtl)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
328
- yield initTestBed(`<TextBox testId="input" direction="rtl" startText="$" />`);
329
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
330
- const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("$"));
331
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("$");
332
- (0, fixtures_1.expect)(textRight - compLeft).toBeGreaterThanOrEqual(compRight - textLeft);
333
- }));
334
- (0, fixtures_1.test)("endText displays at end of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
335
- yield initTestBed(`<TextBox testId="input" direction="ltr" endText="USD" />`);
336
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
337
- const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("USD"));
338
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("USD");
368
+ (0, fixtures_1.test)("endText displays at end of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
369
+ yield initTestBed(`<TextBox testId="input" endText="USD" />`);
370
+ const driver = yield createTextBoxDriver("input");
371
+ const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
372
+ const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(driver.endAdornment);
373
+ yield (0, fixtures_1.expect)(driver.endAdornment).toContainText("USD");
339
374
  (0, fixtures_1.expect)(textRight - compLeft).toBeGreaterThanOrEqual(compRight - textLeft);
340
375
  }));
341
- (0, fixtures_1.test)("endText displays at end of input (rtl)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
342
- yield initTestBed(`<TextBox testId="input" direction="rtl" endText="USD" />`);
343
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
344
- const { left: textLeft, right: textRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("USD"));
345
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("USD");
346
- (0, fixtures_1.expect)(textRight - compLeft).toBeLessThanOrEqual(compRight - textLeft);
347
- }));
348
- (0, fixtures_1.test)("startIcon displays at beginning of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
349
- yield initTestBed(`<TextBox testId="input" direction="ltr" startIcon="search" />`);
350
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
351
- const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img"));
376
+ (0, fixtures_1.test)("startIcon displays at beginning of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
377
+ yield initTestBed(`<TextBox testId="input" startIcon="search" />`);
378
+ const driver = yield createTextBoxDriver("input");
379
+ const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
380
+ const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(driver.startAdornment);
352
381
  (0, fixtures_1.expect)(iconRight - compLeft).toBeLessThanOrEqual(compRight - iconLeft);
353
382
  }));
354
- (0, fixtures_1.test)("startIcon displays at beginning of input (rtl)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
355
- yield initTestBed(`<TextBox testId="input" direction="rtl" startIcon="search" />`);
356
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
357
- const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img"));
358
- (0, fixtures_1.expect)(iconRight - compLeft).toBeGreaterThanOrEqual(compRight - iconLeft);
359
- }));
360
- (0, fixtures_1.test)("endIcon displays at end of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
383
+ (0, fixtures_1.test)("endIcon displays at end of input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
361
384
  yield initTestBed(`<TextBox testId="input" endIcon="search" />`);
362
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
363
- const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img"));
385
+ const driver = yield createTextBoxDriver("input");
386
+ const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
387
+ const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(driver.endAdornment);
364
388
  (0, fixtures_1.expect)(iconRight - compLeft).toBeGreaterThanOrEqual(compRight - iconLeft);
365
389
  }));
366
- (0, fixtures_1.test)("endIcon displays at end of input (rtl)", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
367
- yield initTestBed(`<TextBox testId="input" direction="rtl" endIcon="search" />`);
368
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
369
- const { left: iconLeft, right: iconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img"));
370
- (0, fixtures_1.expect)(iconRight - compLeft).toBeLessThanOrEqual(compRight - iconLeft);
371
- }));
372
- (0, fixtures_1.test)("multiple adornments can be combined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
390
+ (0, fixtures_1.test)("multiple adornments can be combined", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
373
391
  yield initTestBed(`
374
392
  <TextBox testId="input" startText="$" endText="USD" startIcon="search" endIcon="search" />`);
375
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("$");
376
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toContainText("USD");
377
- yield (0, fixtures_1.expect)(page.getByRole("img").first()).toBeVisible();
378
- yield (0, fixtures_1.expect)(page.getByRole("img").last()).toBeVisible();
393
+ const driver = yield createTextBoxDriver("input");
394
+ yield (0, fixtures_1.expect)(driver.startAdornment).toContainText("$");
395
+ yield (0, fixtures_1.expect)(driver.endAdornment).toContainText("USD");
396
+ yield (0, fixtures_1.expect)(driver.startAdornment).toBeVisible();
397
+ yield (0, fixtures_1.expect)(driver.endAdornment).toBeVisible();
379
398
  }));
380
- (0, fixtures_1.test)("all adornments appear in the right place", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
399
+ (0, fixtures_1.test)("all adornments appear in the right place", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
381
400
  yield initTestBed(`
382
401
  <TextBox testId="input" startText="$" endText="USD" startIcon="search" endIcon="search" direction="ltr" />
383
402
  `);
384
- const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(page.getByTestId("input"));
385
- const { left: startTextLeft, right: startTextRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("$"));
386
- const { left: endTextLeft, right: endTextRight } = yield (0, component_test_helpers_1.getBounds)(page.getByText("USD"));
387
- const { left: startIconLeft, right: startIconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img").first());
388
- const { left: endIconLeft, right: endIconRight } = yield (0, component_test_helpers_1.getBounds)(page.getByRole("img").last());
403
+ const driver = yield createTextBoxDriver("input");
404
+ const { left: compLeft, right: compRight } = yield (0, component_test_helpers_1.getBounds)(driver.input);
405
+ const { left: startTextLeft, right: startTextRight } = yield (0, component_test_helpers_1.getBounds)(driver.startAdornment);
406
+ const { left: endTextLeft, right: endTextRight } = yield (0, component_test_helpers_1.getBounds)(driver.endAdornment);
407
+ const { left: startIconLeft, right: startIconRight } = yield (0, component_test_helpers_1.getBounds)(driver.startAdornment);
408
+ const { left: endIconLeft, right: endIconRight } = yield (0, component_test_helpers_1.getBounds)(driver.endAdornment);
389
409
  // Check order of adornments
390
410
  (0, fixtures_1.expect)(startTextRight - compLeft).toBeLessThanOrEqual(compRight - startTextLeft);
391
411
  (0, fixtures_1.expect)(startIconRight - compLeft).toBeLessThanOrEqual(compRight - startIconLeft);
@@ -397,30 +417,34 @@ fixtures_1.test.describe("Input Adornments", () => {
397
417
  // PASSWORD INPUT TESTS
398
418
  // =============================================================================
399
419
  fixtures_1.test.describe("Password Input", () => {
400
- (0, fixtures_1.test)("component renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
401
- yield initTestBed(`<PasswordInput />`);
402
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toBeVisible();
403
- }));
404
- (0, fixtures_1.test)("component has password type", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
405
- yield initTestBed(`<PasswordInput />`);
406
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("type", "password");
407
- }));
408
- (0, fixtures_1.test)("component has initial value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
409
- yield initTestBed(`<PasswordInput initialValue="secret" />`);
410
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("secret");
411
- }));
412
- (0, fixtures_1.test)("showPasswordToggle displays visibility toggle", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
420
+ (0, fixtures_1.test)("component renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
421
+ yield initTestBed(`<PasswordInput testId="input" />`);
422
+ const driver = yield createTextBoxDriver("input");
423
+ yield (0, fixtures_1.expect)(driver.component).toBeVisible();
424
+ }));
425
+ (0, fixtures_1.test)("component has password type", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
426
+ yield initTestBed(`<PasswordInput testId="input" />`);
427
+ const driver = yield createTextBoxDriver("input");
428
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("type", "password");
429
+ }));
430
+ (0, fixtures_1.test)("component has initial value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
431
+ yield initTestBed(`<PasswordInput testId="input" initialValue="secret" />`);
432
+ const driver = yield createTextBoxDriver("input");
433
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("secret");
434
+ }));
435
+ (0, fixtures_1.test)("showPasswordToggle displays visibility toggle", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
413
436
  yield initTestBed(`<PasswordInput testId="input" showPasswordToggle="true" />`);
414
- yield (0, fixtures_1.expect)(page.getByTestId("input").getByRole("button")).toBeVisible();
437
+ const driver = yield createTextBoxDriver("input");
438
+ yield (0, fixtures_1.expect)(driver.input).toBeVisible();
415
439
  }));
416
- (0, fixtures_1.test)("password toggle switches between visible and hidden", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
440
+ (0, fixtures_1.test)("password toggle switches between visible and hidden", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
417
441
  yield initTestBed(`<PasswordInput testId="input" showPasswordToggle="true" />`);
418
- const toggleButton = page.getByTestId("input").getByRole("button");
419
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("type", "password");
420
- yield toggleButton.click();
421
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveAttribute("type", "text");
442
+ const driver = yield createTextBoxDriver("input");
443
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("type", "password");
444
+ yield driver.button.click();
445
+ yield (0, fixtures_1.expect)(driver.input).toHaveAttribute("type", "text");
422
446
  }));
423
- (0, fixtures_1.test)("custom password icons work correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
447
+ (0, fixtures_1.test)("custom password icons work correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
424
448
  yield initTestBed(`
425
449
  <PasswordInput
426
450
  testId="input"
@@ -432,9 +456,10 @@ fixtures_1.test.describe("Password Input", () => {
432
456
  "icon.test": "resources/bell.svg",
433
457
  },
434
458
  });
435
- const icon = page.getByTestId("input").getByRole("img");
459
+ const driver = yield createTextBoxDriver("input");
460
+ const icon = driver.button;
436
461
  yield (0, fixtures_1.expect)(icon).toBeVisible();
437
- yield page.getByTestId("input").getByRole("button").click();
462
+ yield icon.click();
438
463
  yield (0, fixtures_1.expect)(icon).toBeVisible();
439
464
  }));
440
465
  });
@@ -442,118 +467,130 @@ fixtures_1.test.describe("Password Input", () => {
442
467
  // VISUAL STATE TESTS
443
468
  // =============================================================================
444
469
  fixtures_1.test.describe("Theme Vars", () => {
445
- (0, fixtures_1.test)("backgroundColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
470
+ (0, fixtures_1.test)("backgroundColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
446
471
  yield initTestBed(`<TextBox testId="input" />`, {
447
472
  testThemeVars: {
448
473
  "backgroundColor-TextBox": "rgb(255, 240, 240)",
449
474
  },
450
475
  });
451
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("background-color", "rgb(255, 240, 240)");
476
+ const driver = yield createTextBoxDriver("input");
477
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("background-color", "rgb(255, 240, 240)");
452
478
  }));
453
- (0, fixtures_1.test)("borderColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
479
+ (0, fixtures_1.test)("borderColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
454
480
  yield initTestBed(`<TextBox testId="input" />`, {
455
481
  testThemeVars: {
456
482
  "borderColor-TextBox": "rgb(255, 0, 0)",
457
483
  },
458
484
  });
459
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(255, 0, 0)");
485
+ const driver = yield createTextBoxDriver("input");
486
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(255, 0, 0)");
460
487
  }));
461
- (0, fixtures_1.test)("textColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
488
+ (0, fixtures_1.test)("textColor applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
462
489
  yield initTestBed(`<TextBox testId="input" />`, {
463
490
  testThemeVars: {
464
491
  "textColor-TextBox": "rgb(0, 0, 255)",
465
492
  },
466
493
  });
467
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("color", "rgb(0, 0, 255)");
494
+ const driver = yield createTextBoxDriver("input");
495
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("color", "rgb(0, 0, 255)");
468
496
  }));
469
- (0, fixtures_1.test)("focus borderColor applies on focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
497
+ (0, fixtures_1.test)("focus borderColor applies on focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
470
498
  yield initTestBed(`<TextBox testId="input" />`, {
471
499
  testThemeVars: {
472
500
  "borderColor-TextBox--focus": "rgb(0, 255, 0)",
473
501
  },
474
502
  });
475
- const input = page.getByTestId("input");
476
- yield input.focus();
477
- yield (0, fixtures_1.expect)(input).toHaveCSS("border-color", "rgb(0, 255, 0)");
503
+ const driver = yield createTextBoxDriver("input");
504
+ yield driver.input.focus();
505
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(0, 255, 0)");
478
506
  }));
479
- (0, fixtures_1.test)("disabled backgroundColor applies when disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
507
+ (0, fixtures_1.test)("disabled backgroundColor applies when disabled", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
480
508
  yield initTestBed(`<TextBox testId="input" enabled="false" />`, {
481
509
  testThemeVars: {
482
510
  "backgroundColor-TextBox--disabled": "rgb(240, 240, 240)",
483
511
  },
484
512
  });
485
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("background-color", "rgb(240, 240, 240)");
513
+ const driver = yield createTextBoxDriver("input");
514
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("background-color", "rgb(240, 240, 240)");
486
515
  }));
487
- (0, fixtures_1.test)("error borderColor applies with error validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
516
+ (0, fixtures_1.test)("error borderColor applies with error validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
488
517
  yield initTestBed(`<TextBox testId="input" validationStatus="error" />`, {
489
518
  testThemeVars: {
490
519
  "borderColor-TextBox-error": "rgb(255, 0, 0)",
491
520
  },
492
521
  });
493
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(255, 0, 0)");
522
+ const driver = yield createTextBoxDriver("input");
523
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(255, 0, 0)");
494
524
  }));
495
- (0, fixtures_1.test)("warning borderColor applies with warning validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
525
+ (0, fixtures_1.test)("warning borderColor applies with warning validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
496
526
  yield initTestBed(`<TextBox testId="input" validationStatus="warning" />`, {
497
527
  testThemeVars: {
498
528
  "borderColor-TextBox-warning": "rgb(255, 165, 0)",
499
529
  },
500
530
  });
501
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(255, 165, 0)");
531
+ const driver = yield createTextBoxDriver("input");
532
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(255, 165, 0)");
502
533
  }));
503
- (0, fixtures_1.test)("success borderColor applies with valid validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
534
+ (0, fixtures_1.test)("success borderColor applies with valid validation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
504
535
  yield initTestBed(`<TextBox testId="input" validationStatus="valid" />`, {
505
536
  testThemeVars: {
506
537
  "borderColor-TextBox-success": "rgb(0, 255, 0)",
507
538
  },
508
539
  });
509
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(0, 255, 0)");
540
+ const driver = yield createTextBoxDriver("input");
541
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(0, 255, 0)");
510
542
  }));
511
- (0, fixtures_1.test)("borderRadius applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
543
+ (0, fixtures_1.test)("borderRadius applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
512
544
  yield initTestBed(`<TextBox testId="input" />`, {
513
545
  testThemeVars: {
514
546
  "borderRadius-TextBox": "8px",
515
547
  },
516
548
  });
517
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-radius", "8px");
549
+ const driver = yield createTextBoxDriver("input");
550
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-radius", "8px");
518
551
  }));
519
- (0, fixtures_1.test)("padding applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
552
+ (0, fixtures_1.test)("padding applies correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
520
553
  yield initTestBed(`<TextBox testId="input" />`, {
521
554
  testThemeVars: {
522
555
  "padding-TextBox": "12px",
523
556
  },
524
557
  });
525
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("padding", "12px");
558
+ const driver = yield createTextBoxDriver("input");
559
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("padding", "12px");
526
560
  }));
527
561
  });
528
562
  // =============================================================================
529
563
  // VALIDATION STATUS TESTS
530
564
  // =============================================================================
531
565
  fixtures_1.test.describe("Validation", () => {
532
- (0, fixtures_1.test)("validationStatus=error correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
566
+ (0, fixtures_1.test)("validationStatus=error correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
533
567
  yield initTestBed(`<TextBox testId="input" validationStatus="error" />`, {
534
568
  testThemeVars: {
535
569
  "borderColor-TextBox-error": "rgb(255, 0, 0)",
536
570
  },
537
571
  });
538
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(255, 0, 0)");
572
+ const driver = yield createTextBoxDriver("input");
573
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(255, 0, 0)");
539
574
  }));
540
- (0, fixtures_1.test)("validationStatus=warning correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
575
+ (0, fixtures_1.test)("validationStatus=warning correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
541
576
  yield initTestBed(`<TextBox testId="input" validationStatus="warning" />`, {
542
577
  testThemeVars: {
543
578
  "borderColor-TextBox-warning": "rgb(255, 165, 0)",
544
579
  },
545
580
  });
546
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(255, 165, 0)");
581
+ const driver = yield createTextBoxDriver("input");
582
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(255, 165, 0)");
547
583
  }));
548
- (0, fixtures_1.test)("validationStatus=valid correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
584
+ (0, fixtures_1.test)("validationStatus=valid correctly displayed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
549
585
  yield initTestBed(`<TextBox testId="input" validationStatus="valid" />`, {
550
586
  testThemeVars: {
551
587
  "borderColor-TextBox-success": "rgb(0, 255, 0)",
552
588
  },
553
589
  });
554
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(0, 255, 0)");
590
+ const driver = yield createTextBoxDriver("input");
591
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(0, 255, 0)");
555
592
  }));
556
- (0, fixtures_1.test)("handles invalid validationStatus gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
593
+ (0, fixtures_1.test)("handles invalid validationStatus gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
557
594
  yield initTestBed(`<TextBox testId="input" validationStatus="invalid-status" />`, {
558
595
  testThemeVars: {
559
596
  "borderColor-TextBox": "rgb(0, 0, 0)",
@@ -562,82 +599,89 @@ fixtures_1.test.describe("Validation", () => {
562
599
  "borderColor-TextBox-success": "rgb(0, 255, 0)",
563
600
  },
564
601
  });
565
- yield (0, fixtures_1.expect)(page.getByTestId("input")).not.toHaveCSS("border-color", "rgb(255, 0, 0)");
566
- yield (0, fixtures_1.expect)(page.getByTestId("input")).not.toHaveCSS("border-color", "rgb(255, 165, 0)");
567
- yield (0, fixtures_1.expect)(page.getByTestId("input")).not.toHaveCSS("border-color", "rgb(0, 255, 0)");
568
- yield (0, fixtures_1.expect)(page.getByTestId("input")).toHaveCSS("border-color", "rgb(0, 0, 0)");
602
+ const driver = yield createTextBoxDriver("input");
603
+ yield (0, fixtures_1.expect)(driver.component).not.toHaveCSS("border-color", "rgb(255, 0, 0)");
604
+ yield (0, fixtures_1.expect)(driver.component).not.toHaveCSS("border-color", "rgb(255, 165, 0)");
605
+ yield (0, fixtures_1.expect)(driver.component).not.toHaveCSS("border-color", "rgb(0, 255, 0)");
606
+ yield (0, fixtures_1.expect)(driver.component).toHaveCSS("border-color", "rgb(0, 0, 0)");
569
607
  }));
570
608
  });
571
609
  // =============================================================================
572
610
  // EDGE CASE TESTS
573
611
  // =============================================================================
574
612
  fixtures_1.test.describe("Edge Cases", () => {
575
- (0, fixtures_1.test)("handle special characters in input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
576
- yield initTestBed(`<TextBox />`);
577
- yield page.getByRole("textbox").fill("Hello 日本語 @#$%!");
578
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("Hello 日本語 @#$%!");
579
- }));
580
- (0, fixtures_1.test)("handle Unicode characters in input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
581
- yield initTestBed(`<TextBox />`);
582
- yield page.getByRole("textbox").fill("🚀 Unicode test 🎉");
583
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue("🚀 Unicode test 🎉");
584
- }));
585
- (0, fixtures_1.test)("component handles very long input text", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
613
+ (0, fixtures_1.test)("handle special characters in input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
614
+ yield initTestBed(`<TextBox testId="input"/>`);
615
+ const driver = yield createTextBoxDriver("input");
616
+ yield driver.input.fill("Hello 日本語 @#$%!");
617
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("Hello 日本語 @#$%!");
618
+ }));
619
+ (0, fixtures_1.test)("handle Unicode characters in input", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
620
+ yield initTestBed(`<TextBox testId="input"/>`);
621
+ const driver = yield createTextBoxDriver("input");
622
+ yield driver.input.fill("🚀 Unicode test 🎉");
623
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue("🚀 Unicode test 🎉");
624
+ }));
625
+ (0, fixtures_1.test)("component handles very long input text", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
586
626
  const longText = "This is a very long text that might cause layout or performance issues in the component".repeat(10);
587
- yield initTestBed(`<TextBox />`);
588
- yield page.getByRole("textbox").fill(longText);
589
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue(longText);
590
- }));
591
- (0, fixtures_1.test)("component handles special characters correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
592
- yield initTestBed(`<TextBox label="Input with !@#$%^&*()"/>`, {});
593
- yield (0, fixtures_1.expect)(page.getByText("Input with !@#$%^&*()")).toBeVisible();
594
- }));
595
- (0, fixtures_1.test)("component handles extremely long input values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
596
- yield initTestBed(`<TextBox />`);
627
+ yield initTestBed(`<TextBox testId="input"/>`);
628
+ const driver = yield createTextBoxDriver("input");
629
+ yield driver.input.fill(longText);
630
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue(longText);
631
+ }));
632
+ (0, fixtures_1.test)("component handles special characters correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
633
+ yield initTestBed(`<TextBox testId="input" label="Input with !@#$%^&*()"/>`, {});
634
+ const driver = yield createTextBoxDriver("input");
635
+ yield (0, fixtures_1.expect)(driver.label).toBeVisible();
636
+ }));
637
+ (0, fixtures_1.test)("component handles extremely long input values", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
638
+ yield initTestBed(`<TextBox testId="input"/>`);
639
+ const driver = yield createTextBoxDriver("input");
597
640
  const veryLongText = "A".repeat(10000);
598
- yield page.getByRole("textbox").fill(veryLongText);
599
- yield (0, fixtures_1.expect)(page.getByRole("textbox")).toHaveValue(veryLongText);
641
+ yield driver.input.fill(veryLongText);
642
+ yield (0, fixtures_1.expect)(driver.input).toHaveValue(veryLongText);
600
643
  }));
601
644
  });
602
645
  // =============================================================================
603
646
  // INTEGRATION TESTS
604
647
  // =============================================================================
605
648
  fixtures_1.test.describe("Integration", () => {
606
- (0, fixtures_1.test)("component works correctly in Stack layout contexts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
649
+ (0, fixtures_1.test)("component works correctly in Stack layout contexts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
607
650
  yield initTestBed(`<Stack><TextBox testId="input" /></Stack>`);
608
- const input = page.getByTestId("input");
609
- const { width, height } = yield (0, component_test_helpers_1.getBounds)(input);
610
- yield (0, fixtures_1.expect)(input).toBeVisible();
651
+ const driver = yield createTextBoxDriver("input");
652
+ const { width, height } = yield (0, component_test_helpers_1.getBounds)(driver.input);
653
+ yield (0, fixtures_1.expect)(driver.input).toBeVisible();
611
654
  (0, fixtures_1.expect)(width).toBeGreaterThan(0);
612
655
  (0, fixtures_1.expect)(height).toBeGreaterThan(0);
613
656
  }));
614
- (0, fixtures_1.test)("component works correctly in FlowLayout layout contexts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
657
+ (0, fixtures_1.test)("component works correctly in FlowLayout layout contexts", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
615
658
  yield initTestBed(`<FlowLayout><TextBox testId="input" /></FlowLayout>`);
616
- const input = page.getByTestId("input");
617
- const { width, height } = yield (0, component_test_helpers_1.getBounds)(input);
618
- yield (0, fixtures_1.expect)(input).toBeVisible();
659
+ const driver = yield createTextBoxDriver("input");
660
+ const { width, height } = yield (0, component_test_helpers_1.getBounds)(driver.input);
661
+ yield (0, fixtures_1.expect)(driver.input).toBeVisible();
619
662
  (0, fixtures_1.expect)(width).toBeGreaterThan(0);
620
663
  (0, fixtures_1.expect)(height).toBeGreaterThan(0);
621
664
  }));
622
- (0, fixtures_1.test)("component integrates with forms correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
623
- yield initTestBed(`<Form><TextBox label="Username" /></Form>`);
624
- const input = page.getByLabel("Username");
625
- const { width, height } = yield (0, component_test_helpers_1.getBounds)(input);
626
- yield (0, fixtures_1.expect)(input).toBeVisible();
665
+ (0, fixtures_1.test)("component integrates with forms correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createTextBoxDriver }) {
666
+ yield initTestBed(`<Form><TextBox testId="input" label="Username" /></Form>`);
667
+ const driver = yield createTextBoxDriver("input");
668
+ const { width, height } = yield (0, component_test_helpers_1.getBounds)(driver.input);
669
+ yield (0, fixtures_1.expect)(driver.input).toBeVisible();
627
670
  (0, fixtures_1.expect)(width).toBeGreaterThan(0);
628
671
  (0, fixtures_1.expect)(height).toBeGreaterThan(0);
629
672
  }));
630
- (0, fixtures_1.test)("component works with conditional rendering", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
673
+ (0, fixtures_1.test)("component works with conditional rendering", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createTextBoxDriver }) {
631
674
  yield initTestBed(`
632
675
  <Fragment var.showInput="{true}">
633
676
  <Fragment when="{showInput}">
634
- <TextBox label="Conditional input" />
677
+ <TextBox testId="input" label="Conditional input" />
635
678
  </Fragment>
636
679
  <Button testId="toggleBtn" onClick="showInput = !showInput">Toggle</Button>
637
680
  </Fragment>
638
681
  `);
639
- yield (0, fixtures_1.expect)(page.getByLabel("Conditional input")).toBeVisible();
682
+ const driver = yield createTextBoxDriver("input");
683
+ yield (0, fixtures_1.expect)(driver.label).toBeVisible();
640
684
  yield page.getByTestId("toggleBtn").click();
641
- yield (0, fixtures_1.expect)(page.getByLabel("Conditional input")).not.toBeVisible();
685
+ yield (0, fixtures_1.expect)(driver.label).not.toBeVisible();
642
686
  }));
643
687
  });