@simplysm/solid 13.0.70 → 13.0.71
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/README.md +1 -1
- package/dist/components/disclosure/Dropdown.d.ts +6 -4
- package/dist/components/disclosure/Dropdown.d.ts.map +1 -1
- package/dist/components/disclosure/Dropdown.js +24 -8
- package/dist/components/disclosure/Dropdown.js.map +2 -2
- package/dist/components/disclosure/dialogZIndex.d.ts +2 -0
- package/dist/components/disclosure/dialogZIndex.d.ts.map +1 -1
- package/dist/components/disclosure/dialogZIndex.js +4 -0
- package/dist/components/disclosure/dialogZIndex.js.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.d.ts.map +1 -1
- package/dist/components/features/crud-detail/CrudDetail.js +16 -7
- package/dist/components/features/crud-detail/CrudDetail.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.d.ts.map +1 -1
- package/dist/components/features/crud-sheet/CrudSheet.js +14 -5
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/crudRegistry.d.ts +16 -0
- package/dist/components/features/crudRegistry.d.ts.map +1 -0
- package/dist/components/features/crudRegistry.js +37 -0
- package/dist/components/features/crudRegistry.js.map +6 -0
- package/dist/components/features/permission-table/PermissionTable.d.ts.map +1 -1
- package/dist/components/features/permission-table/PermissionTable.js +71 -86
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelect.js +2 -4
- package/dist/components/features/shared-data/SharedDataSelect.js.map +2 -2
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts +2 -4
- package/dist/components/features/shared-data/SharedDataSelectList.d.ts.map +1 -1
- package/dist/components/features/shared-data/SharedDataSelectList.js +11 -46
- package/dist/components/features/shared-data/SharedDataSelectList.js.map +2 -2
- package/dist/components/form-control/select/Select.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.js +1 -1
- package/dist/components/form-control/select/Select.js.map +1 -1
- package/dist/helpers/createAppStructure.d.ts.map +1 -1
- package/dist/helpers/createAppStructure.js +3 -2
- package/dist/helpers/createAppStructure.js.map +1 -1
- package/dist/helpers/createHmrSafeContext.d.ts +3 -0
- package/dist/helpers/createHmrSafeContext.d.ts.map +1 -0
- package/dist/helpers/createHmrSafeContext.js +10 -0
- package/dist/helpers/createHmrSafeContext.js.map +6 -0
- package/dist/hooks/createSelectionGroup.d.ts.map +1 -1
- package/dist/hooks/createSelectionGroup.js +3 -2
- package/dist/hooks/createSelectionGroup.js.map +2 -2
- package/package.json +6 -5
- package/src/components/disclosure/Dropdown.tsx +31 -17
- package/src/components/disclosure/dialogZIndex.ts +5 -0
- package/src/components/features/crud-detail/CrudDetail.tsx +16 -5
- package/src/components/features/crud-sheet/CrudSheet.tsx +13 -3
- package/src/components/features/crudRegistry.ts +60 -0
- package/src/components/features/permission-table/PermissionTable.tsx +49 -46
- package/src/components/features/shared-data/SharedDataSelect.tsx +2 -2
- package/src/components/features/shared-data/SharedDataSelectList.tsx +11 -36
- package/src/components/form-control/select/Select.tsx +1 -5
- package/src/helpers/createAppStructure.ts +3 -2
- package/src/helpers/createHmrSafeContext.ts +8 -0
- package/src/hooks/createSelectionGroup.tsx +4 -2
- package/tests/components/data/List.spec.tsx +52 -52
- package/tests/components/data/Pagination.spec.tsx +43 -43
- package/tests/components/data/Table.spec.tsx +4 -4
- package/tests/components/data/kanban/Kanban.selection.spec.tsx +21 -21
- package/tests/components/data/sheet/DataSheet.spec.tsx +50 -50
- package/tests/components/disclosure/Collapse.spec.tsx +24 -24
- package/tests/components/disclosure/Dialog.spec.tsx +33 -33
- package/tests/components/disclosure/DialogProvider.spec.tsx +9 -9
- package/tests/components/disclosure/Dropdown.spec.tsx +134 -14
- package/tests/components/disclosure/Tabs.spec.tsx +21 -21
- package/tests/components/disclosure/dialogZIndex.spec.ts +45 -0
- package/tests/components/display/Alert.spec.tsx +4 -4
- package/tests/components/display/Barcode.spec.tsx +7 -7
- package/tests/components/display/Card.spec.tsx +3 -3
- package/tests/components/display/Link.spec.tsx +5 -5
- package/tests/components/display/Tag.spec.tsx +4 -4
- package/tests/components/features/address/AddressSearch.spec.tsx +3 -3
- package/tests/components/features/crudRegistry.spec.ts +119 -0
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +8 -8
- package/tests/components/features/permission-table/PermissionTable.spec.tsx +43 -43
- package/tests/components/features/shared-data/SharedDataSelectList.spec.tsx +2 -17
- package/tests/components/feedback/busy/BusyContainer.spec.tsx +7 -7
- package/tests/components/feedback/notification/NotificationBell.spec.tsx +9 -9
- package/tests/components/feedback/print/Print.spec.tsx +4 -4
- package/tests/components/form-control/Button.spec.tsx +18 -18
- package/tests/components/form-control/checkbox/Checkbox.spec.tsx +20 -20
- package/tests/components/form-control/checkbox/CheckboxGroup.spec.tsx +12 -12
- package/tests/components/form-control/checkbox/Radio.spec.tsx +21 -21
- package/tests/components/form-control/checkbox/RadioGroup.spec.tsx +12 -12
- package/tests/components/form-control/color-picker/ColorPicker.spec.tsx +10 -10
- package/tests/components/form-control/combobox/Combobox.spec.tsx +16 -16
- package/tests/components/form-control/combobox/ComboboxItem.spec.tsx +7 -7
- package/tests/components/form-control/date-range-picker/DateRangePicker.spec.tsx +24 -24
- package/tests/components/form-control/field/DatePicker.spec.tsx +50 -50
- package/tests/components/form-control/field/DateTimePicker.spec.tsx +47 -47
- package/tests/components/form-control/field/NumberInput.spec.tsx +54 -54
- package/tests/components/form-control/field/TextInput.spec.tsx +49 -49
- package/tests/components/form-control/field/Textarea.spec.tsx +33 -33
- package/tests/components/form-control/field/TimePicker.spec.tsx +42 -42
- package/tests/components/form-control/numpad/Numpad.spec.tsx +40 -40
- package/tests/components/form-control/select/Select.spec.tsx +9 -9
- package/tests/components/form-control/select/SelectItem.spec.tsx +10 -10
- package/tests/helpers/createAppStructure.spec.tsx +57 -57
- package/tests/helpers/mergeStyles.spec.ts +31 -31
|
@@ -5,28 +5,28 @@ import { NumberInput } from "../../../../src/components/form-control/field/Numbe
|
|
|
5
5
|
|
|
6
6
|
describe("NumberInput", () => {
|
|
7
7
|
describe("basic rendering", () => {
|
|
8
|
-
it("input
|
|
8
|
+
it("renders input element", () => {
|
|
9
9
|
render(() => <NumberInput />);
|
|
10
10
|
|
|
11
11
|
const input = screen.getByRole("textbox");
|
|
12
12
|
expect(input).toBeInTheDocument();
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
it("inputmode
|
|
15
|
+
it("sets inputmode to numeric", () => {
|
|
16
16
|
render(() => <NumberInput />);
|
|
17
17
|
|
|
18
18
|
const input = screen.getByRole("textbox");
|
|
19
19
|
expect(input).toHaveAttribute("inputmode", "numeric");
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
it("input type
|
|
22
|
+
it("sets input type to text", () => {
|
|
23
23
|
render(() => <NumberInput />);
|
|
24
24
|
|
|
25
25
|
const input = screen.getByRole("textbox");
|
|
26
26
|
expect(input).toHaveAttribute("type", "text");
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
it("autocomplete
|
|
29
|
+
it("defaults autocomplete to one-time-code", () => {
|
|
30
30
|
render(() => <NumberInput />);
|
|
31
31
|
|
|
32
32
|
const input = screen.getByRole("textbox");
|
|
@@ -34,23 +34,23 @@ describe("NumberInput", () => {
|
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
describe("
|
|
38
|
-
it("
|
|
37
|
+
describe("value conversion", () => {
|
|
38
|
+
it("displays numeric value as string", () => {
|
|
39
39
|
render(() => <NumberInput value={12345} />);
|
|
40
40
|
|
|
41
41
|
const input = screen.getByRole("textbox");
|
|
42
|
-
// comma
|
|
42
|
+
// comma is true by default, so commas are included
|
|
43
43
|
expect(input).toHaveValue("12,345");
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
it("
|
|
46
|
+
it("displays decimal numbers correctly", () => {
|
|
47
47
|
render(() => <NumberInput value={1234.56} />);
|
|
48
48
|
|
|
49
49
|
const input = screen.getByRole("textbox");
|
|
50
50
|
expect(input).toHaveValue("1,234.56");
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
it("
|
|
53
|
+
it("works correctly during input", () => {
|
|
54
54
|
const handleChange = vi.fn();
|
|
55
55
|
render(() => <NumberInput onValueChange={handleChange} />);
|
|
56
56
|
|
|
@@ -60,32 +60,32 @@ describe("NumberInput", () => {
|
|
|
60
60
|
expect(handleChange).toHaveBeenCalledWith(123);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
it("
|
|
63
|
+
it("preserves trailing decimal point during input", () => {
|
|
64
64
|
const [value, setValue] = createSignal<number | undefined>(undefined);
|
|
65
65
|
render(() => <NumberInput value={value()} onValueChange={setValue} />);
|
|
66
66
|
|
|
67
67
|
const input = screen.getByRole("textbox");
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// preserve trailing decimal while entering "123."
|
|
70
70
|
fireEvent.input(input, { target: { value: "123." } });
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// value converts to 123, but display must retain "123."
|
|
73
73
|
expect(input).toHaveValue("123.");
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
it("
|
|
76
|
+
it("ignores invalid input", () => {
|
|
77
77
|
const handleChange = vi.fn();
|
|
78
78
|
render(() => <NumberInput value={100} onValueChange={handleChange} />);
|
|
79
79
|
|
|
80
80
|
const input = screen.getByRole("textbox");
|
|
81
|
-
//
|
|
81
|
+
// attempt to input non-numeric characters
|
|
82
82
|
fireEvent.input(input, { target: { value: "abc" } });
|
|
83
83
|
|
|
84
|
-
//
|
|
84
|
+
// invalid input so callback is not called or value is retained
|
|
85
85
|
expect(handleChange).not.toHaveBeenCalled();
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
it("
|
|
88
|
+
it("converts empty input to undefined", () => {
|
|
89
89
|
const handleChange = vi.fn();
|
|
90
90
|
render(() => <NumberInput value={100} onValueChange={handleChange} />);
|
|
91
91
|
|
|
@@ -95,7 +95,7 @@ describe("NumberInput", () => {
|
|
|
95
95
|
expect(handleChange).toHaveBeenCalledWith(undefined);
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
it("
|
|
98
|
+
it("handles negative numbers correctly", () => {
|
|
99
99
|
const handleChange = vi.fn();
|
|
100
100
|
render(() => <NumberInput onValueChange={handleChange} />);
|
|
101
101
|
|
|
@@ -106,36 +106,36 @@ describe("NumberInput", () => {
|
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
describe("
|
|
110
|
-
it("
|
|
109
|
+
describe("display format", () => {
|
|
110
|
+
it("displays thousands comma when comma=true", () => {
|
|
111
111
|
render(() => <NumberInput value={1234567} comma={true} />);
|
|
112
112
|
|
|
113
113
|
const input = screen.getByRole("textbox");
|
|
114
114
|
expect(input).toHaveValue("1,234,567");
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
it("
|
|
117
|
+
it("displays without comma when comma=false", () => {
|
|
118
118
|
render(() => <NumberInput value={1234567} comma={false} />);
|
|
119
119
|
|
|
120
120
|
const input = screen.getByRole("textbox");
|
|
121
121
|
expect(input).toHaveValue("1234567");
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
it("comma
|
|
124
|
+
it("defaults comma to true", () => {
|
|
125
125
|
render(() => <NumberInput value={1234567} />);
|
|
126
126
|
|
|
127
127
|
const input = screen.getByRole("textbox");
|
|
128
128
|
expect(input).toHaveValue("1,234,567");
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
it("
|
|
131
|
+
it("sets minimum decimal digits with minDigits", () => {
|
|
132
132
|
render(() => <NumberInput value={100} minDigits={2} />);
|
|
133
133
|
|
|
134
134
|
const input = screen.getByRole("textbox");
|
|
135
135
|
expect(input).toHaveValue("100.00");
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
it("
|
|
138
|
+
it("displays decimals longer than minDigits as-is", () => {
|
|
139
139
|
render(() => <NumberInput value={100.12345} minDigits={2} />);
|
|
140
140
|
|
|
141
141
|
const input = screen.getByRole("textbox");
|
|
@@ -143,24 +143,24 @@ describe("NumberInput", () => {
|
|
|
143
143
|
});
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
describe("disabled/readonly
|
|
147
|
-
it("
|
|
146
|
+
describe("disabled/readonly state", () => {
|
|
147
|
+
it("renders as div when disabled", () => {
|
|
148
148
|
render(() => <NumberInput value={1234} disabled />);
|
|
149
149
|
|
|
150
|
-
//
|
|
150
|
+
// renders as div, not input, when disabled
|
|
151
151
|
expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
|
|
152
|
-
//
|
|
152
|
+
// value is displayed in the div
|
|
153
153
|
expect(screen.getByText("1,234")).toBeInTheDocument();
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
it("
|
|
156
|
+
it("renders as div when readonly", () => {
|
|
157
157
|
render(() => <NumberInput value={5678} readonly />);
|
|
158
158
|
|
|
159
159
|
expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
|
|
160
160
|
expect(screen.getByText("5,678")).toBeInTheDocument();
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
it("disabled
|
|
163
|
+
it("applies disabled style", () => {
|
|
164
164
|
const { container } = render(() => <NumberInput value={100} disabled />);
|
|
165
165
|
|
|
166
166
|
const wrapper = container.firstChild as HTMLElement;
|
|
@@ -168,8 +168,8 @@ describe("NumberInput", () => {
|
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
describe("
|
|
172
|
-
it("input
|
|
171
|
+
describe("right alignment", () => {
|
|
172
|
+
it("aligns input to the right", () => {
|
|
173
173
|
render(() => <NumberInput />);
|
|
174
174
|
|
|
175
175
|
const input = screen.getByRole("textbox");
|
|
@@ -177,25 +177,25 @@ describe("NumberInput", () => {
|
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
|
|
180
|
-
describe("
|
|
181
|
-
it("size='sm'
|
|
180
|
+
describe("style options", () => {
|
|
181
|
+
it("applies small padding when size='sm'", () => {
|
|
182
182
|
const { container } = render(() => <NumberInput size="sm" />);
|
|
183
183
|
|
|
184
184
|
const wrapper = container.firstChild as HTMLElement;
|
|
185
185
|
expect(wrapper.className).toContain("px-1.5");
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
it("size='lg'
|
|
188
|
+
it("applies large padding when size='lg'", () => {
|
|
189
189
|
const { container } = render(() => <NumberInput size="lg" />);
|
|
190
190
|
|
|
191
191
|
const wrapper = container.firstChild as HTMLElement;
|
|
192
192
|
expect(wrapper.className).toContain("px-3");
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
it("inset
|
|
195
|
+
it("applies inset style", () => {
|
|
196
196
|
const { container } = render(() => <NumberInput inset />);
|
|
197
197
|
|
|
198
|
-
//
|
|
198
|
+
// outer div is relative when inset, inner content div has border-none
|
|
199
199
|
const outer = container.firstChild as HTMLElement;
|
|
200
200
|
expect(outer.classList.contains("relative")).toBe(true);
|
|
201
201
|
const contentDiv = outer.querySelector("[data-number-field-content]") as HTMLElement;
|
|
@@ -204,7 +204,7 @@ describe("NumberInput", () => {
|
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
describe("inset dual-element", () => {
|
|
207
|
-
it("
|
|
207
|
+
it("shows content div and no input when inset + readonly", () => {
|
|
208
208
|
const { container } = render(() => <NumberInput inset readonly value={1234} />);
|
|
209
209
|
const outer = container.firstChild as HTMLElement;
|
|
210
210
|
expect(outer.classList.contains("relative")).toBe(true);
|
|
@@ -216,7 +216,7 @@ describe("NumberInput", () => {
|
|
|
216
216
|
expect(outer.querySelector("input:not([aria-hidden])")).toBeFalsy();
|
|
217
217
|
});
|
|
218
218
|
|
|
219
|
-
it("
|
|
219
|
+
it("shows hidden content div and input when inset + editable", () => {
|
|
220
220
|
const { container } = render(() => <NumberInput inset value={1234} />);
|
|
221
221
|
const outer = container.firstChild as HTMLElement;
|
|
222
222
|
|
|
@@ -228,14 +228,14 @@ describe("NumberInput", () => {
|
|
|
228
228
|
expect(input).toBeTruthy();
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
it("inset + readonly
|
|
231
|
+
it("applies right alignment in inset + readonly", () => {
|
|
232
232
|
const { container } = render(() => <NumberInput inset readonly value={100} />);
|
|
233
233
|
const outer = container.firstChild as HTMLElement;
|
|
234
234
|
const contentDiv = outer.querySelector("[data-number-field-content]") as HTMLElement;
|
|
235
235
|
expect(contentDiv.classList.contains("justify-end")).toBe(true);
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
it("
|
|
238
|
+
it("shows NBSP in content div when inset + empty value", () => {
|
|
239
239
|
const { container } = render(() => <NumberInput inset readonly />);
|
|
240
240
|
const outer = container.firstChild as HTMLElement;
|
|
241
241
|
const contentDiv = outer.querySelector("[data-number-field-content]") as HTMLElement;
|
|
@@ -243,8 +243,8 @@ describe("NumberInput", () => {
|
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
describe("controlled/uncontrolled
|
|
247
|
-
it("
|
|
246
|
+
describe("controlled/uncontrolled pattern", () => {
|
|
247
|
+
it("reflects external value changes in controlled mode", () => {
|
|
248
248
|
const [value, setValue] = createSignal<number | undefined>(100);
|
|
249
249
|
render(() => <NumberInput value={value()} onValueChange={setValue} />);
|
|
250
250
|
|
|
@@ -255,7 +255,7 @@ describe("NumberInput", () => {
|
|
|
255
255
|
expect(input).toHaveValue("200");
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
it("
|
|
258
|
+
it("manages internal state in uncontrolled mode", () => {
|
|
259
259
|
render(() => <NumberInput />);
|
|
260
260
|
|
|
261
261
|
const input = screen.getByRole("textbox");
|
|
@@ -266,7 +266,7 @@ describe("NumberInput", () => {
|
|
|
266
266
|
});
|
|
267
267
|
|
|
268
268
|
describe("placeholder", () => {
|
|
269
|
-
it("placeholder
|
|
269
|
+
it("displays placeholder", () => {
|
|
270
270
|
render(() => <NumberInput placeholder="숫자를 입력하세요" />);
|
|
271
271
|
|
|
272
272
|
const input = screen.getByRole("textbox");
|
|
@@ -281,25 +281,25 @@ describe("NumberInput", () => {
|
|
|
281
281
|
expect(hiddenInput.validationMessage).toBe("This field is required");
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
it("required
|
|
284
|
+
it("is valid when required and value exists", () => {
|
|
285
285
|
const { container } = render(() => <NumberInput required value={42} />);
|
|
286
286
|
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
287
287
|
expect(hiddenInput.validity.valid).toBe(true);
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
it("
|
|
290
|
+
it("sets error message when min is violated", () => {
|
|
291
291
|
const { container } = render(() => <NumberInput min={10} value={5} />);
|
|
292
292
|
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
293
293
|
expect(hiddenInput.validationMessage).toBe("Minimum value is 10");
|
|
294
294
|
});
|
|
295
295
|
|
|
296
|
-
it("
|
|
296
|
+
it("sets error message when max is violated", () => {
|
|
297
297
|
const { container } = render(() => <NumberInput max={100} value={150} />);
|
|
298
298
|
const hiddenInput = container.querySelector("input[aria-hidden='true']") as HTMLInputElement;
|
|
299
299
|
expect(hiddenInput.validationMessage).toBe("Maximum value is 100");
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
it("
|
|
302
|
+
it("sets error message returned by validate function", () => {
|
|
303
303
|
const { container } = render(() => (
|
|
304
304
|
<NumberInput
|
|
305
305
|
validate={(v) => (v !== undefined && v % 2 === 0 ? undefined : "짝수만 입력하세요")}
|
|
@@ -311,8 +311,8 @@ describe("NumberInput", () => {
|
|
|
311
311
|
});
|
|
312
312
|
});
|
|
313
313
|
|
|
314
|
-
describe("Prefix
|
|
315
|
-
it("NumberInput.Prefix
|
|
314
|
+
describe("Prefix slot", () => {
|
|
315
|
+
it("renders NumberInput.Prefix slot", () => {
|
|
316
316
|
render(() => (
|
|
317
317
|
<NumberInput>
|
|
318
318
|
<NumberInput.Prefix>
|
|
@@ -324,7 +324,7 @@ describe("NumberInput", () => {
|
|
|
324
324
|
expect(document.querySelector('[data-testid="prefix"]')).not.toBeNull();
|
|
325
325
|
});
|
|
326
326
|
|
|
327
|
-
it("
|
|
327
|
+
it("applies gap class when Prefix slot is used", () => {
|
|
328
328
|
const { container } = render(() => (
|
|
329
329
|
<NumberInput>
|
|
330
330
|
<NumberInput.Prefix>
|
|
@@ -337,14 +337,14 @@ describe("NumberInput", () => {
|
|
|
337
337
|
expect(wrapper.className).toContain("gap-");
|
|
338
338
|
});
|
|
339
339
|
|
|
340
|
-
it("
|
|
340
|
+
it("does not apply gap class without Prefix slot", () => {
|
|
341
341
|
const { container } = render(() => <NumberInput />);
|
|
342
342
|
|
|
343
343
|
const wrapper = container.querySelector("[data-number-field]") as HTMLElement;
|
|
344
344
|
expect(wrapper.className).not.toContain("gap-");
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
-
it("
|
|
347
|
+
it("renders Prefix slot when disabled", () => {
|
|
348
348
|
render(() => (
|
|
349
349
|
<NumberInput disabled value={100}>
|
|
350
350
|
<NumberInput.Prefix>
|
|
@@ -356,7 +356,7 @@ describe("NumberInput", () => {
|
|
|
356
356
|
expect(document.querySelector('[data-testid="prefix"]')).not.toBeNull();
|
|
357
357
|
});
|
|
358
358
|
|
|
359
|
-
it("
|
|
359
|
+
it("renders Prefix slot in inset mode", () => {
|
|
360
360
|
render(() => (
|
|
361
361
|
<NumberInput inset value={100}>
|
|
362
362
|
<NumberInput.Prefix>
|