xmlui 0.10.18 → 0.10.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{apiInterceptorWorker-DPgtUtdA.mjs → apiInterceptorWorker-QiltRtq1.mjs} +1 -1
- package/dist/lib/{index-Cy6Emsex.mjs → index-Ckhnrf1F.mjs} +1093 -714
- package/dist/lib/index.css +1 -1
- package/dist/{metadata/initMock-D0wDKF_I.mjs → lib/initMock-qnCFw6Zc.mjs} +25 -15
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{metadata-utils-CtY0QcvH.mjs → metadata-utils-BTIt1_wE.mjs} +1 -1
- package/dist/lib/{server-common-Cine5nRR.mjs → server-common-DYZtsdM7.mjs} +51 -14
- package/dist/lib/{transform-bHBjkKSL.mjs → transform-Tooy42EB.mjs} +16 -18
- package/dist/lib/xmlui-parser.mjs +2 -2
- package/dist/lib/{xmlui-serializer-DB6BLiXK.mjs → xmlui-serializer-uCYa8_tZ.mjs} +1 -1
- package/dist/lib/xmlui.d.ts +11 -3
- package/dist/lib/xmlui.mjs +2 -2
- package/dist/metadata/{apiInterceptorWorker-BmKP8bnq.mjs → apiInterceptorWorker-Dql7QGw2.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-CB63ngkU.mjs → collectedComponentMetadata-Dg7P-zOz.mjs} +1071 -701
- package/dist/{lib/initMock-B-rmnC-t.mjs → metadata/initMock-ZyyFNOpL.mjs} +25 -15
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +3 -3
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/components/Animation/AnimationNative.js +28 -28
- package/dist/scripts/src/components/App/App.spec.js +17 -17
- package/dist/scripts/src/components/AppState/AppState.js +3 -2
- package/dist/scripts/src/components/AppState/AppState.spec.js +26 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +3 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +15 -10
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +25 -4
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +4 -4
- package/dist/scripts/src/components/Carousel/Carousel.spec.js +214 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +5 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +1 -1
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +2 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.spec.js +193 -0
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +28 -23
- package/dist/scripts/src/components/DatePicker/DatePicker.js +14 -9
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +21 -18
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +24 -21
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.spec.js +3 -3
- package/dist/scripts/src/components/FileInput/FileInput.spec.js +7 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +4 -13
- package/dist/scripts/src/components/Form/Form.spec.js +25 -9
- package/dist/scripts/src/components/Form/FormNative.js +7 -4
- package/dist/scripts/src/components/FormItem/FormItem.js +3 -1
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +5 -14
- package/dist/scripts/src/components/FormItem/FormItemNative.js +12 -8
- package/dist/scripts/src/components/FormItem/Validations.js +2 -2
- package/dist/scripts/src/components/Icon/Icon.js +1 -1
- package/dist/scripts/src/components/IconRegistryContext.js +1 -1
- package/dist/scripts/src/components/List/ListNative.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +3 -12
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +6 -3
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +1 -1
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +3 -3
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +7 -2
- package/dist/scripts/src/components/Pagination/Pagination.spec.js +5 -0
- package/dist/scripts/src/components/Pagination/PaginationNative.js +1 -3
- package/dist/scripts/src/components/Queue/Queue.spec.js +45 -47
- package/dist/scripts/src/components/Queue/QueueNative.js +1 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +14 -5
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +1 -1
- package/dist/scripts/src/components/Select/MultiSelectOption.js +42 -0
- package/dist/scripts/src/components/Select/Select.js +3 -3
- package/dist/scripts/src/components/Select/Select.spec.js +286 -217
- package/dist/scripts/src/components/Select/SelectContext.js +8 -1
- package/dist/scripts/src/components/Select/SelectNative.js +134 -142
- package/dist/scripts/src/components/Select/SelectOption.js +34 -0
- package/dist/scripts/src/components/Select/SimpleSelect.js +57 -0
- package/dist/scripts/src/components/Slider/Slider.spec.js +7 -0
- package/dist/scripts/src/components/Spinner/Spinner.spec.js +1 -1
- package/dist/scripts/src/components/Switch/Switch.spec.js +24 -17
- package/dist/scripts/src/components/Table/Table.js +11 -1
- package/dist/scripts/src/components/Table/Table.spec.js +272 -0
- package/dist/scripts/src/components/Table/TableNative.js +162 -5
- package/dist/scripts/src/components/Table/useRowSelection.js +14 -23
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +59 -8
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +7 -0
- package/dist/scripts/src/components/Theme/Theme.js +2 -1
- package/dist/scripts/src/components/Theme/Theme.spec.js +266 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +8 -1
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +47 -40
- package/dist/scripts/src/components/TimeInput/TimeInputNative.js +6 -20
- package/dist/scripts/src/components/Toggle/Toggle.js +3 -1
- package/dist/scripts/src/components/Tree/TreeNative.js +9 -11
- package/dist/scripts/src/components-core/InspectorContext.js +1 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +6 -8
- package/dist/scripts/src/components-core/action/FileUploadAction.js +1 -1
- package/dist/scripts/src/components-core/behaviors/BehaviorContext.js +50 -0
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +6 -1
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +9 -11
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +3 -3
- package/dist/scripts/src/components-core/interception/Backend.js +1 -1
- package/dist/scripts/src/components-core/interception/IndexedDb.js +64 -66
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +2 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +6 -14
- package/dist/scripts/src/components-core/loader/Loader.js +11 -11
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +4 -2
- package/dist/scripts/src/components-core/loader/PageableLoader.js +10 -9
- package/dist/scripts/src/components-core/rendering/AppContent.js +1 -7
- package/dist/scripts/src/components-core/rendering/ErrorBoundary.js +1 -1
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +1 -1
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +180 -186
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +6 -6
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +2 -2
- package/dist/scripts/src/components-core/utils/actionUtils.js +1 -1
- package/dist/scripts/src/components-core/utils/hooks.js +1 -1
- package/dist/scripts/src/components-core/utils/misc.js +4 -4
- package/dist/scripts/src/components-core/xmlui-parser.js +47 -31
- package/dist/scripts/src/language-server/server-common.js +25 -24
- package/dist/scripts/src/language-server/services/common/lsp-utils.js +2 -2
- package/dist/scripts/src/language-server/services/completion.js +20 -2
- package/dist/scripts/src/language-server/services/diagnostic.js +1 -1
- package/dist/scripts/src/language-server/services/hover.js +2 -2
- package/dist/scripts/src/parsers/common/utils.js +2 -2
- package/dist/scripts/src/parsers/scripting/Lexer.js +21 -15
- package/dist/scripts/src/parsers/scripting/Parser.js +8 -9
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +22 -22
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +70 -68
- package/dist/scripts/src/testing/ComponentDrivers.js +20 -39
- package/dist/scripts/src/testing/component-test-helpers.js +34 -50
- package/dist/scripts/src/testing/fixtures.js +114 -113
- package/dist/scripts/src/testing/themed-app-test-helpers.js +7 -13
- package/dist/standalone/xmlui-standalone.es.d.ts +11 -3
- package/dist/standalone/xmlui-standalone.umd.js +34 -34
- package/package.json +1 -1
|
@@ -10,21 +10,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const fixtures_1 = require("../../testing/fixtures");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// BASIC FUNCTIONALITY TESTS
|
|
15
|
+
// =============================================================================
|
|
16
|
+
fixtures_1.test.describe("Basic Functionality", () => {
|
|
17
|
+
// --- Component rendering
|
|
18
|
+
(0, fixtures_1.test)("dynamic options displayed with Items component", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createSelectDriver, page, }) {
|
|
19
|
+
yield initTestBed(`
|
|
20
|
+
<Select>
|
|
21
|
+
<Items data="{['One', 'Two', 'Three']}" >
|
|
22
|
+
<Option value="{$itemIndex}" label="{$item}" />
|
|
23
|
+
</Items>
|
|
24
|
+
</Select>`);
|
|
25
|
+
const driver = yield createSelectDriver();
|
|
26
|
+
yield driver.click();
|
|
27
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "One" })).toBeVisible();
|
|
28
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "Two" })).toBeVisible();
|
|
29
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "Three" })).toBeVisible();
|
|
30
|
+
}));
|
|
31
|
+
(0, fixtures_1.test)("changing selected option in form", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createSelectDriver }) {
|
|
32
|
+
yield initTestBed(`
|
|
28
33
|
<Form data="{{sel: 'opt1'}}">
|
|
29
34
|
<FormItem testId="mySelect" type="select" bindTo="sel">
|
|
30
35
|
<Option value="opt1" label="first"/>
|
|
@@ -32,14 +37,15 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
32
37
|
<Option value="opt3" label="third"/>
|
|
33
38
|
</FormItem>
|
|
34
39
|
</Form>`);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}));
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const driver = yield createSelectDriver("mySelect");
|
|
41
|
+
yield (0, fixtures_1.expect)(driver.component.locator("select")).toHaveValue("opt1");
|
|
42
|
+
yield driver.toggleOptionsVisibility();
|
|
43
|
+
yield driver.selectLabel("second");
|
|
44
|
+
yield (0, fixtures_1.expect)(driver.component.locator("select")).toHaveValue("opt2");
|
|
45
|
+
}));
|
|
46
|
+
// --- initialValue prop
|
|
47
|
+
(0, fixtures_1.test)("initialValue set to first valid value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
48
|
+
yield initTestBed(`
|
|
43
49
|
<Fragment>
|
|
44
50
|
<Select id="mySelect" initialValue="{0}">
|
|
45
51
|
<Option value="{0}" label="Zero"/>
|
|
@@ -49,12 +55,12 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
49
55
|
<Text testId="text">Selected value: {mySelect.value}</Text>
|
|
50
56
|
</Fragment>
|
|
51
57
|
`);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}));
|
|
56
|
-
(0, fixtures_1.test)("initialValue set to non-existant option", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
57
|
-
|
|
58
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 0");
|
|
59
|
+
yield (0, fixtures_1.expect)(page.getByText("Zero", { exact: true })).toBeVisible();
|
|
60
|
+
yield (0, fixtures_1.expect)(page.getByText("One", { exact: true })).not.toBeVisible();
|
|
61
|
+
}));
|
|
62
|
+
(0, fixtures_1.test)("initialValue set to non-existant option", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
63
|
+
yield initTestBed(`
|
|
58
64
|
<Fragment>
|
|
59
65
|
<Select id="mySelect" initialValue="{42}">
|
|
60
66
|
<Option value="{0}" label="Zero"/>
|
|
@@ -64,10 +70,10 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
64
70
|
<Text testId="text">Selected value: {mySelect.value}</Text>
|
|
65
71
|
</Fragment>
|
|
66
72
|
`);
|
|
67
|
-
|
|
68
|
-
}));
|
|
69
|
-
(0, fixtures_1.test)("reset works with initialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, createButtonDriver, }) {
|
|
70
|
-
|
|
73
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 42");
|
|
74
|
+
}));
|
|
75
|
+
(0, fixtures_1.test)("reset works with initialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, createButtonDriver, }) {
|
|
76
|
+
yield initTestBed(`
|
|
71
77
|
<Fragment>
|
|
72
78
|
<Select id="mySelect" initialValue="{0}">
|
|
73
79
|
<Option value="{0}" label="Zero"/>
|
|
@@ -77,17 +83,17 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
77
83
|
<Button id="resetBtn" label="reset" onClick="mySelect.reset()"/>
|
|
78
84
|
<Text testId="text">Selected value: {mySelect.value}</Text>
|
|
79
85
|
</Fragment>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}));
|
|
89
|
-
(0, fixtures_1.test)("reset works with no intialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, createButtonDriver, }) {
|
|
90
|
-
|
|
86
|
+
`);
|
|
87
|
+
const selectDrv = yield createSelectDriver("mySelect");
|
|
88
|
+
yield selectDrv.toggleOptionsVisibility();
|
|
89
|
+
yield selectDrv.selectLabel("One");
|
|
90
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 1");
|
|
91
|
+
const btnDriver = yield createButtonDriver("resetBtn");
|
|
92
|
+
yield btnDriver.click();
|
|
93
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 0");
|
|
94
|
+
}));
|
|
95
|
+
(0, fixtures_1.test)("reset works with no intialValue", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, createButtonDriver, }) {
|
|
96
|
+
yield initTestBed(`
|
|
91
97
|
<Fragment>
|
|
92
98
|
<Select id="mySelect">
|
|
93
99
|
<Option value="{0}" label="Zero"/>
|
|
@@ -97,88 +103,90 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
97
103
|
<Button id="resetBtn" label="reset" onClick="mySelect.reset()"/>
|
|
98
104
|
<Text testId="text">Selected value: {mySelect.value}</Text>
|
|
99
105
|
</Fragment>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}));
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
`);
|
|
107
|
+
const selectDrv = yield createSelectDriver("mySelect");
|
|
108
|
+
yield selectDrv.toggleOptionsVisibility();
|
|
109
|
+
yield selectDrv.selectLabel("One");
|
|
110
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 1");
|
|
111
|
+
const btnDriver = yield createButtonDriver("resetBtn");
|
|
112
|
+
yield btnDriver.click();
|
|
113
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).not.toContainText("1");
|
|
114
|
+
}));
|
|
115
|
+
// --- enabled prop
|
|
116
|
+
(0, fixtures_1.test)("disabled Select cannot be opened", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, createSelectDriver, initTestBed }) {
|
|
117
|
+
yield initTestBed(`
|
|
111
118
|
<Select enabled="{false}">
|
|
112
119
|
<Option value="1" label="One"/>
|
|
113
120
|
<Option value="2" label="Two"/>
|
|
114
121
|
</Select>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}));
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
`);
|
|
123
|
+
const driver = yield createSelectDriver();
|
|
124
|
+
yield driver.click({ force: true });
|
|
125
|
+
yield (0, fixtures_1.expect)(page.getByText("One")).not.toBeVisible();
|
|
126
|
+
}));
|
|
127
|
+
// --- readOnly prop
|
|
128
|
+
(0, fixtures_1.test)("readOnly Select shows options, but value cannot be changed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, }) {
|
|
129
|
+
yield initTestBed(`
|
|
122
130
|
<Select readOnly initialValue="1">
|
|
123
131
|
<Option value="1" label="One"/>
|
|
124
132
|
<Option value="2" label="Two"/>
|
|
125
133
|
</Select>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}));
|
|
136
|
-
(0, fixtures_1.test)("readOnly multi-Select shows options, but value cannot be changed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, }) {
|
|
137
|
-
|
|
134
|
+
`);
|
|
135
|
+
const driver = yield createSelectDriver();
|
|
136
|
+
yield (0, fixtures_1.expect)(page.getByText("Two")).not.toBeVisible();
|
|
137
|
+
yield (0, fixtures_1.expect)(page.getByText("One")).toBeVisible();
|
|
138
|
+
yield driver.toggleOptionsVisibility();
|
|
139
|
+
yield driver.selectLabel("Two");
|
|
140
|
+
yield (0, fixtures_1.expect)(page.getByText("Two")).not.toBeVisible();
|
|
141
|
+
yield (0, fixtures_1.expect)(page.getByText("One")).toBeVisible();
|
|
142
|
+
// verify dropdown is not visible but value is shown
|
|
143
|
+
}));
|
|
144
|
+
(0, fixtures_1.test)("readOnly multi-Select shows options, but value cannot be changed", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, }) {
|
|
145
|
+
yield initTestBed(`
|
|
138
146
|
<Select readOnly initialValue="{[1, 2]}" multiSelect>
|
|
139
147
|
<Option value="1" label="One"/>
|
|
140
148
|
<Option value="2" label="Two"/>
|
|
141
149
|
<Option value="3" label="Three"/>
|
|
142
150
|
</Select>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}));
|
|
154
|
-
(0, fixtures_1.test)("disabled Option cannot be selected", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createSelectDriver, page }) {
|
|
155
|
-
|
|
151
|
+
`);
|
|
152
|
+
const driver = yield createSelectDriver();
|
|
153
|
+
yield (0, fixtures_1.expect)(page.getByText("Three")).not.toBeVisible();
|
|
154
|
+
yield (0, fixtures_1.expect)(page.getByText("One")).toBeVisible();
|
|
155
|
+
yield (0, fixtures_1.expect)(page.getByText("Two")).toBeVisible();
|
|
156
|
+
yield driver.toggleOptionsVisibility();
|
|
157
|
+
yield driver.selectLabel("Three");
|
|
158
|
+
yield (0, fixtures_1.expect)(page.getByText("Three")).not.toBeVisible();
|
|
159
|
+
yield (0, fixtures_1.expect)(page.getByText("One")).toBeVisible();
|
|
160
|
+
yield (0, fixtures_1.expect)(page.getByText("Two")).toBeVisible();
|
|
161
|
+
}));
|
|
162
|
+
(0, fixtures_1.test)("disabled Option cannot be selected", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createSelectDriver, page }) {
|
|
163
|
+
yield initTestBed(`
|
|
156
164
|
<Select>
|
|
157
165
|
<Option value="1" label="One"/>
|
|
158
166
|
<Option value="2" label="Two" enabled="{false}"/>
|
|
159
167
|
</Select>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}));
|
|
169
|
-
(0, fixtures_1.test)("clicking label brings up the options", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
170
|
-
|
|
168
|
+
`);
|
|
169
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "One" })).not.toBeVisible();
|
|
170
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "Two" })).not.toBeVisible();
|
|
171
|
+
const driver = yield createSelectDriver();
|
|
172
|
+
yield driver.toggleOptionsVisibility();
|
|
173
|
+
yield driver.selectLabel("Two");
|
|
174
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "One" })).toBeVisible();
|
|
175
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "Two" })).toBeVisible();
|
|
176
|
+
}));
|
|
177
|
+
(0, fixtures_1.test)("clicking label brings up the options", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
178
|
+
yield initTestBed(`
|
|
171
179
|
<Select label="Choose an option">
|
|
172
180
|
<Option value="1" label="One"/>
|
|
173
181
|
<Option value="2" label="Two"/>
|
|
174
182
|
</Select>
|
|
175
183
|
`);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}));
|
|
180
|
-
(0, fixtures_1.test)("label displayed for selected numeric value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
181
|
-
|
|
184
|
+
yield page.getByLabel("Choose an option").click();
|
|
185
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "One" })).toBeVisible();
|
|
186
|
+
yield (0, fixtures_1.expect)(page.getByRole("option", { name: "Two" })).toBeVisible();
|
|
187
|
+
}));
|
|
188
|
+
(0, fixtures_1.test)("label displayed for selected numeric value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
189
|
+
yield initTestBed(`
|
|
182
190
|
<Fragment>
|
|
183
191
|
<Select initialValue="{0}" >
|
|
184
192
|
<Option value="{0}" label="Zero"/>
|
|
@@ -187,10 +195,11 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
187
195
|
</Select>
|
|
188
196
|
</Fragment>
|
|
189
197
|
`);
|
|
190
|
-
|
|
191
|
-
}));
|
|
192
|
-
|
|
193
|
-
|
|
198
|
+
yield (0, fixtures_1.expect)(page.getByText("Zero")).toBeVisible();
|
|
199
|
+
}));
|
|
200
|
+
// --- autoFocus prop
|
|
201
|
+
(0, fixtures_1.test)("autoFocus brings the focus to component", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver, }) {
|
|
202
|
+
yield initTestBed(`
|
|
194
203
|
<Select>
|
|
195
204
|
<Option value="1" label="One"/>
|
|
196
205
|
<Option value="2" label="Two"/>
|
|
@@ -199,12 +208,13 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
199
208
|
<Option value="1" label="One"/>
|
|
200
209
|
<Option value="2" label="Two"/>
|
|
201
210
|
</Select>
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}));
|
|
206
|
-
|
|
207
|
-
|
|
211
|
+
`);
|
|
212
|
+
const driver = yield createSelectDriver("focused-select");
|
|
213
|
+
yield (0, fixtures_1.expect)(driver.component).toBeFocused();
|
|
214
|
+
}));
|
|
215
|
+
// --- Templates
|
|
216
|
+
(0, fixtures_1.test)("emptyListTemplate shown when wrapped inside an App component", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver, }) {
|
|
217
|
+
yield initTestBed(`
|
|
208
218
|
<App>
|
|
209
219
|
<Select testId="mySelect">
|
|
210
220
|
<property name="emptyListTemplate">
|
|
@@ -212,13 +222,13 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
212
222
|
</property>
|
|
213
223
|
</Select>
|
|
214
224
|
</App>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}));
|
|
220
|
-
(0, fixtures_1.test)("optionTemplate is shown", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
221
|
-
|
|
225
|
+
`);
|
|
226
|
+
const driver = yield createSelectDriver("mySelect");
|
|
227
|
+
yield driver.click();
|
|
228
|
+
yield (0, fixtures_1.expect)(page.getByText("Nothing to see here!", { exact: true })).toBeVisible();
|
|
229
|
+
}));
|
|
230
|
+
(0, fixtures_1.test)("optionTemplate is shown", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
231
|
+
yield initTestBed(`
|
|
222
232
|
<Select>
|
|
223
233
|
<Items items="{[
|
|
224
234
|
{ value: 'opt1', label: 'first' },
|
|
@@ -230,66 +240,90 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
230
240
|
</Option>
|
|
231
241
|
</Items>
|
|
232
242
|
</Select>
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}));
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
`);
|
|
244
|
+
const driver = yield createSelectDriver();
|
|
245
|
+
yield driver.click();
|
|
246
|
+
yield (0, fixtures_1.expect)(page.getByText("Template for value opt1")).toBeVisible();
|
|
247
|
+
yield (0, fixtures_1.expect)(page.getByText("Template for value opt2")).toBeVisible();
|
|
248
|
+
yield (0, fixtures_1.expect)(page.getByText("Template for value opt3")).toBeVisible();
|
|
249
|
+
}));
|
|
250
|
+
// --- placeholder prop
|
|
251
|
+
(0, fixtures_1.test)("placeholder is shown", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
252
|
+
yield initTestBed(`
|
|
253
|
+
<Select placeholder="Please select an item">
|
|
254
|
+
<Option value="opt1" label="first"/>
|
|
255
|
+
<Option value="opt2" label="second"/>
|
|
256
|
+
<Option value="opt3" label="third"/>
|
|
257
|
+
</Select>
|
|
258
|
+
`);
|
|
259
|
+
yield (0, fixtures_1.expect)(page.getByText("Please select an item")).toBeVisible();
|
|
260
|
+
}));
|
|
261
|
+
(0, fixtures_1.test)("Option without label and value is not rendered", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
262
|
+
yield initTestBed(`
|
|
263
|
+
<Select placeholder="Please select an item">
|
|
264
|
+
<Option />
|
|
265
|
+
<Option />
|
|
266
|
+
<Option />
|
|
267
|
+
</Select>
|
|
268
|
+
`);
|
|
269
|
+
const driver = yield createSelectDriver();
|
|
270
|
+
yield driver.click();
|
|
271
|
+
yield (0, fixtures_1.expect)(page.getByRole("option")).not.toBeVisible();
|
|
272
|
+
}));
|
|
273
|
+
(0, fixtures_1.test)("Option value defaults to label", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
274
|
+
yield initTestBed(`
|
|
275
|
+
<Fragment>
|
|
276
|
+
<Select id="mySelect">
|
|
277
|
+
<Option label="Zero"/>
|
|
278
|
+
<Option label="One"/>
|
|
279
|
+
<Option label="Two"/>
|
|
280
|
+
</Select>
|
|
281
|
+
<Text testId="text">Selected value: {mySelect.value}</Text>
|
|
282
|
+
</Fragment>
|
|
283
|
+
`);
|
|
284
|
+
const driver = yield createSelectDriver("mySelect");
|
|
285
|
+
yield driver.toggleOptionsVisibility();
|
|
286
|
+
yield driver.selectLabel("Zero");
|
|
287
|
+
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: Zero");
|
|
288
|
+
}));
|
|
289
|
+
});
|
|
290
|
+
// =============================================================================
|
|
291
|
+
// LABEL POSITIONING TESTS
|
|
292
|
+
// =============================================================================
|
|
293
|
+
fixtures_1.test.describe("Label", () => {
|
|
294
|
+
(0, fixtures_1.test)("labelBreak prop defaults to false", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
295
|
+
yield page.setViewportSize({ width: 300, height: 720 });
|
|
296
|
+
yield initTestBed(`
|
|
243
297
|
<Select
|
|
244
298
|
label="Dignissimos esse quasi esse cupiditate qui qui. Ut provident ad voluptatem tenetur sit consequuntur. Aliquam nisi fugit ut temporibus itaque ducimus rerum. Dolorem reprehenderit qui adipisci. Ullam harum atque ipsa."
|
|
245
299
|
>
|
|
246
300
|
<Option value="1" label="One"/>
|
|
247
301
|
<Option value="2" label="Two"/>
|
|
248
302
|
</Select>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}));
|
|
255
|
-
(0, fixtures_1.test)(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
<
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}));
|
|
265
|
-
(0, fixtures_1.test)("Option without label and value is not rendered", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
266
|
-
yield initTestBed(`
|
|
267
|
-
<Select placeholder="Please select an item">
|
|
268
|
-
<Option />
|
|
269
|
-
<Option />
|
|
270
|
-
<Option />
|
|
271
|
-
</Select>
|
|
272
|
-
`);
|
|
273
|
-
const driver = yield createSelectDriver();
|
|
274
|
-
yield driver.click();
|
|
275
|
-
yield (0, fixtures_1.expect)(page.getByRole("option")).not.toBeVisible();
|
|
276
|
-
}));
|
|
277
|
-
(0, fixtures_1.test)("Option value defaults to label", { tag: "@smoke" }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
278
|
-
yield initTestBed(`
|
|
279
|
-
<Fragment>
|
|
280
|
-
<Select id="mySelect">
|
|
281
|
-
<Option label="Zero"/>
|
|
282
|
-
<Option label="One"/>
|
|
283
|
-
<Option label="Two"/>
|
|
303
|
+
`);
|
|
304
|
+
const labelWidth = (yield page.getByText("Dignissimos esse quasi").boundingBox()).width;
|
|
305
|
+
const select = page.getByRole("button").or(page.getByRole("combobox")).first();
|
|
306
|
+
const { width: selectWidth } = yield select.boundingBox();
|
|
307
|
+
(0, fixtures_1.expect)(labelWidth).toBe(selectWidth);
|
|
308
|
+
}));
|
|
309
|
+
(0, fixtures_1.test)('labelWidth applies with labelPosition="start"', (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
310
|
+
yield page.setViewportSize({ width: 300, height: 720 });
|
|
311
|
+
yield initTestBed(`
|
|
312
|
+
<Select label="Dignissimos esse quasi" labelWidth="200px" labelPosition="start" >
|
|
313
|
+
<Option value="opt1" label="first"/>
|
|
314
|
+
<Option value="opt2" label="second"/>
|
|
315
|
+
<Option value="opt3" label="third"/>
|
|
316
|
+
<Option value="opt4" label="fourth"/>
|
|
317
|
+
<Option value="opt5" label="fifth"/>
|
|
284
318
|
</Select>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
319
|
+
`);
|
|
320
|
+
const labelWidth = (yield page.getByText("Dignissimos esse quasi").boundingBox()).width;
|
|
321
|
+
(0, fixtures_1.expect)(labelWidth).toBeGreaterThanOrEqual(200);
|
|
322
|
+
}));
|
|
323
|
+
});
|
|
324
|
+
// =============================================================================
|
|
325
|
+
// SEARCHABLE SELECT TESTS
|
|
326
|
+
// =============================================================================
|
|
293
327
|
fixtures_1.test.describe("searchable select", () => {
|
|
294
328
|
(0, fixtures_1.test)("placeholder is shown", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, createSelectDriver }) {
|
|
295
329
|
yield initTestBed(`
|
|
@@ -341,20 +375,9 @@ fixtures_1.test.describe("searchable select", () => {
|
|
|
341
375
|
yield (0, fixtures_1.expect)(options[0]).toHaveText("second");
|
|
342
376
|
}));
|
|
343
377
|
});
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
<Select label="Dignissimos esse quasi" labelWidth="200px" labelPosition="start" >
|
|
348
|
-
<Option value="opt1" label="first"/>
|
|
349
|
-
<Option value="opt2" label="second"/>
|
|
350
|
-
<Option value="opt3" label="third"/>
|
|
351
|
-
<Option value="opt4" label="fourth"/>
|
|
352
|
-
<Option value="opt5" label="fifth"/>
|
|
353
|
-
</Select>
|
|
354
|
-
`);
|
|
355
|
-
const labelWidth = (yield page.getByText("Dignissimos esse quasi").boundingBox()).width;
|
|
356
|
-
(0, fixtures_1.expect)(labelWidth).toBeGreaterThanOrEqual(200);
|
|
357
|
-
}));
|
|
378
|
+
// =============================================================================
|
|
379
|
+
// MULTISELECT TESTS
|
|
380
|
+
// =============================================================================
|
|
358
381
|
fixtures_1.test.describe("multiSelect", () => {
|
|
359
382
|
(0, fixtures_1.test)("initialValue='{[0]}' works", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
360
383
|
yield initTestBed(`
|
|
@@ -382,7 +405,7 @@ fixtures_1.test.describe("multiSelect", () => {
|
|
|
382
405
|
`);
|
|
383
406
|
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 0,1");
|
|
384
407
|
}));
|
|
385
|
-
(0, fixtures_1.test)("select multiple items without closing listbox", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver,
|
|
408
|
+
(0, fixtures_1.test)("select multiple items without closing listbox", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, }) {
|
|
386
409
|
const { testStateDriver } = yield initTestBed(`
|
|
387
410
|
<Fragment>
|
|
388
411
|
<Select id="mySelect" multiSelect>
|
|
@@ -425,7 +448,7 @@ fixtures_1.test.describe("multiSelect", () => {
|
|
|
425
448
|
const { width: selectWidth } = yield select.boundingBox();
|
|
426
449
|
(0, fixtures_1.expect)(labelWidth).toBe(selectWidth);
|
|
427
450
|
}));
|
|
428
|
-
(0, fixtures_1.test)('labelPosition="start" is left in ltr language', (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page
|
|
451
|
+
(0, fixtures_1.test)('labelPosition="start" is left in ltr language', (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
429
452
|
yield initTestBed(`
|
|
430
453
|
<Select multiSelect label="hi there" labelPosition="start" labelBreak="false">
|
|
431
454
|
<Option value="1" label="One"/>
|
|
@@ -437,7 +460,7 @@ fixtures_1.test.describe("multiSelect", () => {
|
|
|
437
460
|
const { x: selectX } = yield select.boundingBox();
|
|
438
461
|
(0, fixtures_1.expect)(labelX).toBeLessThan(selectX);
|
|
439
462
|
}));
|
|
440
|
-
(0, fixtures_1.test)('labelPosition="start" is right in rtl language', (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page
|
|
463
|
+
(0, fixtures_1.test)('labelPosition="start" is right in rtl language', (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
441
464
|
yield initTestBed(`
|
|
442
465
|
<VStack direction="rtl">
|
|
443
466
|
<Select multiSelect label="hi there" labelPosition="start" labelBreak="false">
|
|
@@ -492,6 +515,9 @@ fixtures_1.test.describe("multiSelect", () => {
|
|
|
492
515
|
yield (0, fixtures_1.expect)(page.getByText("opt1=first", { exact: true })).not.toBeVisible();
|
|
493
516
|
}));
|
|
494
517
|
});
|
|
518
|
+
// =============================================================================
|
|
519
|
+
// SEARCHABLE MULTISELECT TESTS
|
|
520
|
+
// =============================================================================
|
|
495
521
|
fixtures_1.test.describe("searchable multiselect", { tag: "@smoke" }, () => {
|
|
496
522
|
(0, fixtures_1.test)("searching for and selecting 2 items works", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createSelectDriver, }) {
|
|
497
523
|
yield initTestBed(`
|
|
@@ -511,6 +537,47 @@ fixtures_1.test.describe("searchable multiselect", { tag: "@smoke" }, () => {
|
|
|
511
537
|
yield (0, fixtures_1.expect)(page.getByTestId("text")).toHaveText("Selected value: 1,2");
|
|
512
538
|
}));
|
|
513
539
|
});
|
|
540
|
+
// =============================================================================
|
|
541
|
+
// EVENT HANDLING TESTS
|
|
542
|
+
// =============================================================================
|
|
543
|
+
fixtures_1.test.describe("Event Handling", () => {
|
|
544
|
+
(0, fixtures_1.test)("gotFocus event fires on focus", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
545
|
+
const { testStateDriver } = yield initTestBed(`
|
|
546
|
+
<Select onGotFocus="testState = 'focused'">
|
|
547
|
+
<Option value="1" label="One"/>
|
|
548
|
+
<Option value="2" label="Two"/>
|
|
549
|
+
</Select>
|
|
550
|
+
`);
|
|
551
|
+
const selectButton = page.getByRole("combobox");
|
|
552
|
+
yield selectButton.focus();
|
|
553
|
+
yield fixtures_1.expect.poll(testStateDriver.testState).toBe("focused");
|
|
554
|
+
}));
|
|
555
|
+
(0, fixtures_1.test)("gotFocus event fires on label click", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
556
|
+
const { testStateDriver } = yield initTestBed(`
|
|
557
|
+
<Select label="Choose" onGotFocus="testState = 'focused'">
|
|
558
|
+
<Option value="1" label="One"/>
|
|
559
|
+
<Option value="2" label="Two"/>
|
|
560
|
+
</Select>
|
|
561
|
+
`);
|
|
562
|
+
yield page.getByText("Choose").click();
|
|
563
|
+
yield fixtures_1.expect.poll(testStateDriver.testState).toBe("focused");
|
|
564
|
+
}));
|
|
565
|
+
(0, fixtures_1.test)("lostFocus event fires on blur", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
566
|
+
const { testStateDriver } = yield initTestBed(`
|
|
567
|
+
<Select onLostFocus="testState = 'blurred'">
|
|
568
|
+
<Option value="1" label="One"/>
|
|
569
|
+
<Option value="2" label="Two"/>
|
|
570
|
+
</Select>
|
|
571
|
+
`);
|
|
572
|
+
const selectButton = page.getByRole("combobox");
|
|
573
|
+
yield selectButton.focus();
|
|
574
|
+
yield selectButton.blur();
|
|
575
|
+
yield fixtures_1.expect.poll(testStateDriver.testState).toBe("blurred");
|
|
576
|
+
}));
|
|
577
|
+
});
|
|
578
|
+
// =============================================================================
|
|
579
|
+
// FORM INTEGRATION TESTS
|
|
580
|
+
// =============================================================================
|
|
514
581
|
//this is an upstream issue: https://github.com/radix-ui/primitives/issues/3135
|
|
515
582
|
(0, fixtures_1.test)("initialValue honored when used within Form", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
516
583
|
yield initTestBed(`
|
|
@@ -527,29 +594,31 @@ fixtures_1.test.describe("searchable multiselect", { tag: "@smoke" }, () => {
|
|
|
527
594
|
// =============================================================================
|
|
528
595
|
// VISUAL STATE TESTS
|
|
529
596
|
// =============================================================================
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
597
|
+
fixtures_1.test.describe("Visual State", () => {
|
|
598
|
+
(0, fixtures_1.test)("input has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
599
|
+
yield initTestBed(`<Select width="200px" testId="test"/>`, {});
|
|
600
|
+
const input = page.getByTestId("test");
|
|
601
|
+
const { width } = yield input.boundingBox();
|
|
602
|
+
(0, fixtures_1.expect)(width).toBe(200);
|
|
603
|
+
}));
|
|
604
|
+
(0, fixtures_1.test)("input with label has correct width in px", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
605
|
+
yield initTestBed(`<Select width="200px" label="test" testId="test"/>`, {});
|
|
606
|
+
const input = page.getByTestId("test");
|
|
607
|
+
const { width } = yield input.boundingBox();
|
|
608
|
+
(0, fixtures_1.expect)(width).toBe(200);
|
|
609
|
+
}));
|
|
610
|
+
(0, fixtures_1.test)("input has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
611
|
+
yield page.setViewportSize({ width: 400, height: 300 });
|
|
612
|
+
yield initTestBed(`<Select width="50%" testId="test"/>`, {});
|
|
613
|
+
const input = page.getByTestId("test");
|
|
614
|
+
const { width } = yield input.boundingBox();
|
|
615
|
+
(0, fixtures_1.expect)(width).toBe(200);
|
|
616
|
+
}));
|
|
617
|
+
(0, fixtures_1.test)("input with label has correct width in %", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
618
|
+
yield page.setViewportSize({ width: 400, height: 300 });
|
|
619
|
+
yield initTestBed(`<Select width="50%" label="test" testId="test"/>`, {});
|
|
620
|
+
const input = page.getByTestId("test");
|
|
621
|
+
const { width } = yield input.boundingBox();
|
|
622
|
+
(0, fixtures_1.expect)(width).toBe(200);
|
|
623
|
+
}));
|
|
624
|
+
});
|