vueless 1.3.1-beta.1 → 1.3.2-beta.0
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/icons/internal/progress_activity.svg +1 -0
- package/package.json +1 -1
- package/ui.container-accordion/tests/UAccordion.test.ts +6 -9
- package/ui.container-accordion-item/tests/UAccordionItem.test.ts +18 -41
- package/ui.container-card/config.ts +2 -0
- package/ui.container-card/tests/UCard.test.ts +14 -31
- package/ui.container-card/types.ts +1 -1
- package/ui.container-col/tests/UCol.test.ts +11 -25
- package/ui.container-drawer/config.ts +1 -0
- package/ui.container-drawer/types.ts +1 -1
- package/ui.container-group/tests/UGroup.test.ts +12 -26
- package/ui.container-groups/tests/UGroups.test.ts +4 -11
- package/ui.container-modal/UModal.vue +1 -1
- package/ui.container-modal/config.ts +2 -1
- package/ui.container-modal/types.ts +1 -1
- package/ui.container-modal-confirm/UModalConfirm.vue +2 -2
- package/ui.container-modal-confirm/tests/UModalConfirm.test.ts +28 -57
- package/ui.container-modal-confirm/types.ts +1 -1
- package/ui.container-page/config.ts +2 -0
- package/ui.container-page/tests/UPage.test.ts +18 -38
- package/ui.container-page/types.ts +1 -1
- package/ui.container-row/tests/URow.test.ts +11 -25
- package/ui.form-calendar/config.ts +0 -1
- package/ui.form-checkbox/config.ts +14 -15
- package/ui.form-checkbox/storybook/docs.mdx +0 -16
- package/ui.form-checkbox/storybook/optionKeys.mdx +17 -0
- package/ui.form-checkbox/storybook/stories.ts +1 -3
- package/ui.form-checkbox-group/storybook/docs.mdx +2 -2
- package/ui.form-checkbox-multi-state/storybook/docs.mdx +3 -0
- package/ui.loader/ULoader.vue +10 -2
- package/ui.loader/config.ts +14 -1
- package/ui.loader/storybook/stories.ts +4 -1
- package/ui.loader/tests/ULoader.test.ts +74 -17
- package/ui.loader/types.ts +5 -0
- package/ui.loader-overlay/tests/ULoaderOverlay.test.ts +6 -15
- package/ui.loader-progress/tests/ULoaderProgress.test.ts +8 -18
- package/ui.navigation-breadcrumbs/tests/UBreadcrumbs.test.ts +18 -40
- package/ui.navigation-pagination/tests/UPagination.test.ts +18 -40
- package/ui.navigation-progress/tests/UProgress.test.ts +11 -25
- package/ui.navigation-tab/tests/UTab.test.ts +21 -46
- package/ui.navigation-tabs/tests/UTabs.test.ts +13 -30
- package/ui.other-chip/tests/UChip.test.ts +13 -29
- package/ui.other-dot/tests/UDot.test.ts +4 -10
- package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +13 -29
- package/ui.skeleton/USkeleton.vue +6 -6
- package/ui.skeleton/config.ts +1 -13
- package/ui.skeleton/storybook/stories.ts +3 -20
- package/ui.skeleton/tests/USkeleton.test.ts +2 -27
- package/ui.skeleton/types.ts +0 -5
- package/ui.skeleton-choice/USkeletonChoice.vue +8 -8
- package/ui.skeleton-choice/config.ts +0 -1
- package/ui.skeleton-choice/storybook/stories.ts +3 -6
- package/ui.skeleton-choice/tests/USkeletonChoice.test.ts +7 -35
- package/ui.skeleton-choice/types.ts +0 -5
- package/ui.skeleton-input/USkeletonInput.vue +11 -10
- package/ui.skeleton-input/config.ts +0 -1
- package/ui.skeleton-input/storybook/stories.ts +4 -7
- package/ui.skeleton-input/tests/USkeletonInput.test.ts +11 -48
- package/ui.skeleton-input/types.ts +0 -5
- package/ui.skeleton-text/USkeletonText.vue +8 -8
- package/ui.skeleton-text/config.ts +2 -2
- package/ui.skeleton-text/storybook/stories.ts +1 -4
- package/ui.skeleton-text/tests/USkeletonText.test.ts +5 -32
- package/ui.skeleton-text/types.ts +0 -5
- package/ui.text-alert/tests/UAlert.test.ts +17 -38
- package/ui.text-badge/tests/UBadge.test.ts +19 -42
- package/ui.text-block/UText.vue +7 -7
- package/ui.text-block/config.ts +8 -7
- package/ui.text-block/storybook/stories.ts +13 -25
- package/ui.text-block/tests/UText.test.ts +27 -28
- package/ui.text-block/types.ts +6 -1
- package/ui.text-empty/tests/UEmpty.test.ts +14 -31
- package/ui.text-file/tests/UFile.test.ts +13 -30
- package/ui.text-files/tests/UFiles.test.ts +14 -32
- package/ui.text-header/config.ts +2 -0
- package/ui.text-header/tests/UHeader.test.ts +10 -23
- package/ui.text-notify/tests/UNotify.test.ts +12 -26
- package/ui.text-number/tests/UNumber.test.ts +16 -35
|
@@ -7,10 +7,8 @@ import UStepperProgress from "../UStepperProgress.vue";
|
|
|
7
7
|
import type { Props } from "../types";
|
|
8
8
|
|
|
9
9
|
describe("UProgress.vue", () => {
|
|
10
|
-
// Props tests
|
|
11
10
|
describe("Props", () => {
|
|
12
|
-
|
|
13
|
-
it("sets the correct value for progress", () => {
|
|
11
|
+
it("Value – sets the correct value for progress", () => {
|
|
14
12
|
const value = 50;
|
|
15
13
|
const max = 100;
|
|
16
14
|
|
|
@@ -28,8 +26,7 @@ describe("UProgress.vue", () => {
|
|
|
28
26
|
expect(progressElement.attributes("max")).toBe(max.toString());
|
|
29
27
|
});
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
it("sets the correct max value for progress", () => {
|
|
29
|
+
it("Max – sets the correct max value for progress", () => {
|
|
33
30
|
const value = 5;
|
|
34
31
|
const max = 10;
|
|
35
32
|
|
|
@@ -46,8 +43,7 @@ describe("UProgress.vue", () => {
|
|
|
46
43
|
expect(progressElement.attributes("max")).toBe(max.toString());
|
|
47
44
|
});
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
it("handles array of steps for max prop", () => {
|
|
46
|
+
it("Max – handles array of steps for max prop", () => {
|
|
51
47
|
const value = 1;
|
|
52
48
|
const max = ["Step 1", "Step 2", "Step 3"];
|
|
53
49
|
|
|
@@ -65,8 +61,7 @@ describe("UProgress.vue", () => {
|
|
|
65
61
|
expect(activeStep.text()).toBe(max[value]);
|
|
66
62
|
});
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
it("applies the correct size class", () => {
|
|
64
|
+
it("Size – applies the correct size class", () => {
|
|
70
65
|
const size = {
|
|
71
66
|
xs: "h-0.5",
|
|
72
67
|
sm: "h-1",
|
|
@@ -91,8 +86,7 @@ describe("UProgress.vue", () => {
|
|
|
91
86
|
});
|
|
92
87
|
});
|
|
93
88
|
|
|
94
|
-
|
|
95
|
-
it("applies the correct color class", () => {
|
|
89
|
+
it("Color – applies the correct color class", () => {
|
|
96
90
|
const colors = [
|
|
97
91
|
"primary",
|
|
98
92
|
"secondary",
|
|
@@ -121,8 +115,7 @@ describe("UProgress.vue", () => {
|
|
|
121
115
|
});
|
|
122
116
|
});
|
|
123
117
|
|
|
124
|
-
|
|
125
|
-
it("renders the correct component based on variant", () => {
|
|
118
|
+
it("Variant – renders the correct component based on variant", () => {
|
|
126
119
|
const value = 50;
|
|
127
120
|
const max = 100;
|
|
128
121
|
const variants = ["progress", "stepper"];
|
|
@@ -146,8 +139,7 @@ describe("UProgress.vue", () => {
|
|
|
146
139
|
});
|
|
147
140
|
});
|
|
148
141
|
|
|
149
|
-
|
|
150
|
-
it("shows indicator when indicator prop is true", () => {
|
|
142
|
+
it("Indicator – shows indicator when indicator prop is true", () => {
|
|
151
143
|
const value = 50;
|
|
152
144
|
const indicator = true;
|
|
153
145
|
|
|
@@ -169,8 +161,7 @@ describe("UProgress.vue", () => {
|
|
|
169
161
|
expect(indicatorElement.attributes("style")).toContain(expectedWidth);
|
|
170
162
|
});
|
|
171
163
|
|
|
172
|
-
|
|
173
|
-
it("applies the correct data-test attribute", () => {
|
|
164
|
+
it("DataTest – applies the correct data-test attribute", () => {
|
|
174
165
|
const value = 1;
|
|
175
166
|
const dataTest = "test-progress";
|
|
176
167
|
|
|
@@ -186,10 +177,8 @@ describe("UProgress.vue", () => {
|
|
|
186
177
|
});
|
|
187
178
|
});
|
|
188
179
|
|
|
189
|
-
// Slots tests
|
|
190
180
|
describe("Slots", () => {
|
|
191
|
-
|
|
192
|
-
it("renders content from indicator slot", () => {
|
|
181
|
+
it("Indicator – renders content from indicator slot", () => {
|
|
193
182
|
const value = 50;
|
|
194
183
|
const slotContent = "Custom Indicator";
|
|
195
184
|
const slotClass = "indicator-content";
|
|
@@ -209,8 +198,7 @@ describe("UProgress.vue", () => {
|
|
|
209
198
|
expect(component.find(`.${slotClass}`).text()).toBe(slotContent);
|
|
210
199
|
});
|
|
211
200
|
|
|
212
|
-
|
|
213
|
-
it("renders content from step slot", () => {
|
|
201
|
+
it("Step – renders content from step slot", () => {
|
|
214
202
|
const value = 1;
|
|
215
203
|
const max = ["Step 1", "Step 2", "Step 3"];
|
|
216
204
|
const slotContent = "Custom Step";
|
|
@@ -232,10 +220,8 @@ describe("UProgress.vue", () => {
|
|
|
232
220
|
});
|
|
233
221
|
});
|
|
234
222
|
|
|
235
|
-
// Exposed refs tests
|
|
236
223
|
describe("Exposed refs", () => {
|
|
237
|
-
|
|
238
|
-
it("exposes wrapperRef", () => {
|
|
224
|
+
it("wrapperRef – exposes wrapperRef", () => {
|
|
239
225
|
const value = 50;
|
|
240
226
|
|
|
241
227
|
const component = mount(UProgress, {
|
|
@@ -16,10 +16,8 @@ describe("UTab.vue", () => {
|
|
|
16
16
|
getUTabsSize: "md",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
// Props tests
|
|
20
19
|
describe("Props", () => {
|
|
21
|
-
|
|
22
|
-
it("renders the correct label text", () => {
|
|
20
|
+
it("Label – renders the correct label text", () => {
|
|
23
21
|
const label = "Tab Item";
|
|
24
22
|
|
|
25
23
|
const component = mount(UTab, {
|
|
@@ -35,8 +33,7 @@ describe("UTab.vue", () => {
|
|
|
35
33
|
expect(component.text()).toBe(label);
|
|
36
34
|
});
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
it("uses the provided value for tab identity", async () => {
|
|
36
|
+
it("Value – uses the provided value for tab identity", async () => {
|
|
40
37
|
const value = "tab1";
|
|
41
38
|
const setUTabsSelectedItem = vi.fn();
|
|
42
39
|
|
|
@@ -57,8 +54,7 @@ describe("UTab.vue", () => {
|
|
|
57
54
|
expect(setUTabsSelectedItem).toHaveBeenCalledWith(value);
|
|
58
55
|
});
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
it("passes icon prop to UButton", () => {
|
|
57
|
+
it("Icon – passes icon prop to UButton", () => {
|
|
62
58
|
const icon = "home";
|
|
63
59
|
|
|
64
60
|
const component = mount(UTab, {
|
|
@@ -77,8 +73,7 @@ describe("UTab.vue", () => {
|
|
|
77
73
|
expect(button.props("icon")).toBe(icon);
|
|
78
74
|
});
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
it("passes leftIcon prop to UButton", () => {
|
|
76
|
+
it("Left – passes leftIcon prop to UButton", () => {
|
|
82
77
|
const leftIcon = "arrow-left";
|
|
83
78
|
|
|
84
79
|
const component = mount(UTab, {
|
|
@@ -97,8 +92,7 @@ describe("UTab.vue", () => {
|
|
|
97
92
|
expect(button.props("leftIcon")).toBe(leftIcon);
|
|
98
93
|
});
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
it("passes rightIcon prop to UButton", () => {
|
|
95
|
+
it("Right – passes rightIcon prop to UButton", () => {
|
|
102
96
|
const rightIcon = "arrow-right";
|
|
103
97
|
|
|
104
98
|
const component = mount(UTab, {
|
|
@@ -117,8 +111,7 @@ describe("UTab.vue", () => {
|
|
|
117
111
|
expect(button.props("rightIcon")).toBe(rightIcon);
|
|
118
112
|
});
|
|
119
113
|
|
|
120
|
-
|
|
121
|
-
it("passes disabled prop to UButton", () => {
|
|
114
|
+
it("Disabled – passes disabled prop to UButton", () => {
|
|
122
115
|
const disabled = true;
|
|
123
116
|
|
|
124
117
|
const component = mount(UTab, {
|
|
@@ -137,8 +130,7 @@ describe("UTab.vue", () => {
|
|
|
137
130
|
expect(button.props("disabled")).toBe(disabled);
|
|
138
131
|
});
|
|
139
132
|
|
|
140
|
-
|
|
141
|
-
it("applies the correct data-test attribute", () => {
|
|
133
|
+
it("DataTest – applies the correct data-test attribute", () => {
|
|
142
134
|
const dataTest = "test-tab";
|
|
143
135
|
|
|
144
136
|
const component = mount(UTab, {
|
|
@@ -158,8 +150,7 @@ describe("UTab.vue", () => {
|
|
|
158
150
|
|
|
159
151
|
// Active state tests
|
|
160
152
|
describe("Active state", () => {
|
|
161
|
-
|
|
162
|
-
it("applies active classes when tab is selected", () => {
|
|
153
|
+
it("Active – applies active classes when tab is selected", () => {
|
|
163
154
|
const value = "tab1";
|
|
164
155
|
const expectedClass = "border-primary";
|
|
165
156
|
|
|
@@ -181,8 +172,7 @@ describe("UTab.vue", () => {
|
|
|
181
172
|
expect(button.attributes("class")).toContain(expectedClass);
|
|
182
173
|
});
|
|
183
174
|
|
|
184
|
-
|
|
185
|
-
it("applies inactive classes when tab is not selected", () => {
|
|
175
|
+
it("Inactive – applies inactive classes when tab is not selected", () => {
|
|
186
176
|
const value = "tab1";
|
|
187
177
|
const expectedClass = "border-transparent";
|
|
188
178
|
const nonExpectedClass = "border-primary";
|
|
@@ -206,8 +196,7 @@ describe("UTab.vue", () => {
|
|
|
206
196
|
expect(button.attributes("class")).not.toContain(nonExpectedClass);
|
|
207
197
|
});
|
|
208
198
|
|
|
209
|
-
|
|
210
|
-
it("does not call setUTabsSelectedItem when disabled", async () => {
|
|
199
|
+
it("Disabled – does not call setUTabsSelectedItem when disabled", async () => {
|
|
211
200
|
const disabled = true;
|
|
212
201
|
const setUTabsSelectedItem = vi.fn();
|
|
213
202
|
|
|
@@ -232,8 +221,7 @@ describe("UTab.vue", () => {
|
|
|
232
221
|
|
|
233
222
|
// Injected props tests
|
|
234
223
|
describe("Injected props", () => {
|
|
235
|
-
|
|
236
|
-
it("uses the size from UTabs provider", () => {
|
|
224
|
+
it("Size – uses the size from UTabs provider", () => {
|
|
237
225
|
const size = "lg";
|
|
238
226
|
|
|
239
227
|
const component = mount(UTab, {
|
|
@@ -254,8 +242,7 @@ describe("UTab.vue", () => {
|
|
|
254
242
|
expect(button.props("size")).toBe(size);
|
|
255
243
|
});
|
|
256
244
|
|
|
257
|
-
|
|
258
|
-
it("uses the block prop from UTabs provider", () => {
|
|
245
|
+
it("Block – uses the block prop from UTabs provider", () => {
|
|
259
246
|
const block = true;
|
|
260
247
|
|
|
261
248
|
const component = mount(UTab, {
|
|
@@ -276,8 +263,7 @@ describe("UTab.vue", () => {
|
|
|
276
263
|
expect(button.props("block")).toBe(block);
|
|
277
264
|
});
|
|
278
265
|
|
|
279
|
-
|
|
280
|
-
it("uses the square prop from UTabs provider", () => {
|
|
266
|
+
it("Square – uses the square prop from UTabs provider", () => {
|
|
281
267
|
const square = true;
|
|
282
268
|
|
|
283
269
|
const component = mount(UTab, {
|
|
@@ -298,8 +284,7 @@ describe("UTab.vue", () => {
|
|
|
298
284
|
expect(button.props("square")).toBe(square);
|
|
299
285
|
});
|
|
300
286
|
|
|
301
|
-
|
|
302
|
-
it("applies correct classes based on scrollable prop from UTabs", () => {
|
|
287
|
+
it("Scrollable – applies correct classes based on scrollable prop from UTabs", () => {
|
|
303
288
|
const scrollable = false;
|
|
304
289
|
const expectedClasses = "-mb-px";
|
|
305
290
|
|
|
@@ -322,10 +307,8 @@ describe("UTab.vue", () => {
|
|
|
322
307
|
});
|
|
323
308
|
});
|
|
324
309
|
|
|
325
|
-
// Slots tests
|
|
326
310
|
describe("Slots", () => {
|
|
327
|
-
|
|
328
|
-
it("renders content from left slot", () => {
|
|
311
|
+
it("Left – renders content from left slot", () => {
|
|
329
312
|
const label = "Tab Item";
|
|
330
313
|
const slotText = "Left";
|
|
331
314
|
const slotClass = "left-content";
|
|
@@ -348,8 +331,7 @@ describe("UTab.vue", () => {
|
|
|
348
331
|
expect(component.find(`.${slotClass}`).text()).toBe(slotText);
|
|
349
332
|
});
|
|
350
333
|
|
|
351
|
-
|
|
352
|
-
it("renders content from label slot", () => {
|
|
334
|
+
it("Label – renders content from label slot", () => {
|
|
353
335
|
const label = "Tab Item";
|
|
354
336
|
const slotText = "Custom Label";
|
|
355
337
|
const slotClass = "label-content";
|
|
@@ -372,8 +354,7 @@ describe("UTab.vue", () => {
|
|
|
372
354
|
expect(component.find(`.${slotClass}`).text()).toBe(slotText);
|
|
373
355
|
});
|
|
374
356
|
|
|
375
|
-
|
|
376
|
-
it("renders content from right slot", () => {
|
|
357
|
+
it("Right – renders content from right slot", () => {
|
|
377
358
|
const label = "Tab Item";
|
|
378
359
|
const slotText = "Right";
|
|
379
360
|
const slotClass = "right-content";
|
|
@@ -396,8 +377,7 @@ describe("UTab.vue", () => {
|
|
|
396
377
|
expect(component.find(`.${slotClass}`).text()).toBe(slotText);
|
|
397
378
|
});
|
|
398
379
|
|
|
399
|
-
|
|
400
|
-
it("passes active state to slots", () => {
|
|
380
|
+
it("Slot – passes active state to slots", () => {
|
|
401
381
|
const value = "tab1";
|
|
402
382
|
|
|
403
383
|
const component = mount(UTab, {
|
|
@@ -419,8 +399,7 @@ describe("UTab.vue", () => {
|
|
|
419
399
|
expect(component.find('[data-active="true"]').exists()).toBe(true);
|
|
420
400
|
});
|
|
421
401
|
|
|
422
|
-
|
|
423
|
-
it("passes icon-name to slots", () => {
|
|
402
|
+
it("Slot – passes icon-name to slots", () => {
|
|
424
403
|
const leftIcon = "home";
|
|
425
404
|
|
|
426
405
|
const component = mount(UTab, {
|
|
@@ -441,10 +420,8 @@ describe("UTab.vue", () => {
|
|
|
441
420
|
});
|
|
442
421
|
});
|
|
443
422
|
|
|
444
|
-
// Events tests
|
|
445
423
|
describe("Events", () => {
|
|
446
|
-
|
|
447
|
-
it("calls setUTabsSelectedItem when clicked", async () => {
|
|
424
|
+
it("Click – calls setUTabsSelectedItem when clicked", async () => {
|
|
448
425
|
const value = "tab1";
|
|
449
426
|
const setUTabsSelectedItem = vi.fn();
|
|
450
427
|
|
|
@@ -466,10 +443,8 @@ describe("UTab.vue", () => {
|
|
|
466
443
|
});
|
|
467
444
|
});
|
|
468
445
|
|
|
469
|
-
// Exposed refs tests
|
|
470
446
|
describe("Exposed refs", () => {
|
|
471
|
-
|
|
472
|
-
it("exposes button ref", () => {
|
|
447
|
+
it("button – exposes button ref", () => {
|
|
473
448
|
const component = mount(UTab, {
|
|
474
449
|
props: {
|
|
475
450
|
label: "Tab Item",
|
|
@@ -15,10 +15,8 @@ describe("UTabs.vue", () => {
|
|
|
15
15
|
{ value: "tab3", label: "Tab 3" },
|
|
16
16
|
];
|
|
17
17
|
|
|
18
|
-
// Props tests
|
|
19
18
|
describe("Props", () => {
|
|
20
|
-
|
|
21
|
-
it("correctly sets the selected tab", () => {
|
|
19
|
+
it("ModelValue – correctly sets the selected tab", () => {
|
|
22
20
|
const modelValue = "tab2";
|
|
23
21
|
const expectedActiveClass = "border-primary";
|
|
24
22
|
|
|
@@ -41,8 +39,7 @@ describe("UTabs.vue", () => {
|
|
|
41
39
|
expect(activeTab.classes()).toContain(expectedActiveClass);
|
|
42
40
|
});
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
it("renders the correct number of tabs from options", () => {
|
|
42
|
+
it("Options – renders the correct number of tabs from options", () => {
|
|
46
43
|
const component = mount(UTabs, {
|
|
47
44
|
props: {
|
|
48
45
|
options,
|
|
@@ -61,8 +58,7 @@ describe("UTabs.vue", () => {
|
|
|
61
58
|
});
|
|
62
59
|
});
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
it("applies the correct size to tabs", () => {
|
|
61
|
+
it("Size – applies the correct size to tabs", () => {
|
|
66
62
|
const sizes = ["2xs", "xs", "sm", "md", "lg", "xl"];
|
|
67
63
|
|
|
68
64
|
sizes.forEach((size) => {
|
|
@@ -84,8 +80,7 @@ describe("UTabs.vue", () => {
|
|
|
84
80
|
});
|
|
85
81
|
});
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
it("applies scrollable class when scrollable prop is true", () => {
|
|
83
|
+
it("Scrollable – applies scrollable class when scrollable prop is true", () => {
|
|
89
84
|
const scrollable = true;
|
|
90
85
|
|
|
91
86
|
const component = mount(UTabs, {
|
|
@@ -102,8 +97,7 @@ describe("UTabs.vue", () => {
|
|
|
102
97
|
expect(tabsContainer.classes()).toContain("scroll-smooth");
|
|
103
98
|
});
|
|
104
99
|
|
|
105
|
-
|
|
106
|
-
it("shows scroll buttons when scrollable and content overflows", async () => {
|
|
100
|
+
it("Scroll – shows scroll buttons when scrollable and content overflows", async () => {
|
|
107
101
|
const manyOptions: UTabsOption[] = Array.from({ length: 10 }, (_, i) => ({
|
|
108
102
|
value: `tab${i}`,
|
|
109
103
|
label: `Tab ${i}`,
|
|
@@ -140,8 +134,7 @@ describe("UTabs.vue", () => {
|
|
|
140
134
|
expect(nextButton).toBeDefined();
|
|
141
135
|
});
|
|
142
136
|
|
|
143
|
-
|
|
144
|
-
it("provides block value to tabs", () => {
|
|
137
|
+
it("Block – provides block value to tabs", () => {
|
|
145
138
|
const block = true;
|
|
146
139
|
|
|
147
140
|
const component = mount(UTabs, {
|
|
@@ -161,8 +154,7 @@ describe("UTabs.vue", () => {
|
|
|
161
154
|
expect(button.props("block")).toBe(block);
|
|
162
155
|
});
|
|
163
156
|
|
|
164
|
-
|
|
165
|
-
it("provides square value to tabs", () => {
|
|
157
|
+
it("Square – provides square value to tabs", () => {
|
|
166
158
|
const square = true;
|
|
167
159
|
|
|
168
160
|
const component = mount(UTabs, {
|
|
@@ -182,8 +174,7 @@ describe("UTabs.vue", () => {
|
|
|
182
174
|
expect(button.props("square")).toBe(square);
|
|
183
175
|
});
|
|
184
176
|
|
|
185
|
-
|
|
186
|
-
it("applies the correct data-test attribute", () => {
|
|
177
|
+
it("DataTest – applies the correct data-test attribute", () => {
|
|
187
178
|
const dataTest = "test-tabs";
|
|
188
179
|
const singleOption = [options[0]];
|
|
189
180
|
|
|
@@ -207,10 +198,8 @@ describe("UTabs.vue", () => {
|
|
|
207
198
|
});
|
|
208
199
|
});
|
|
209
200
|
|
|
210
|
-
// Slots tests
|
|
211
201
|
describe("Slots", () => {
|
|
212
|
-
|
|
213
|
-
it("renders content from default slot", () => {
|
|
202
|
+
it("Default – renders content from default slot", () => {
|
|
214
203
|
const slotContent = "Custom Tabs";
|
|
215
204
|
const slotClass = "custom-tabs";
|
|
216
205
|
|
|
@@ -224,8 +213,7 @@ describe("UTabs.vue", () => {
|
|
|
224
213
|
expect(component.find(`.${slotClass}`).text()).toBe(slotContent);
|
|
225
214
|
});
|
|
226
215
|
|
|
227
|
-
|
|
228
|
-
it("renders content from prev slot when scrollable", async () => {
|
|
216
|
+
it("Prev – renders content from prev slot when scrollable", async () => {
|
|
229
217
|
const slotContent = "Prev";
|
|
230
218
|
const slotClass = "prev-content";
|
|
231
219
|
const dataTest = "test-tabs";
|
|
@@ -261,8 +249,7 @@ describe("UTabs.vue", () => {
|
|
|
261
249
|
expect(component.find(`.${slotClass}`).text()).toBe(slotContent);
|
|
262
250
|
});
|
|
263
251
|
|
|
264
|
-
|
|
265
|
-
it("renders content from next slot when scrollable", async () => {
|
|
252
|
+
it("Next – renders content from next slot when scrollable", async () => {
|
|
266
253
|
const slotContent = "Next";
|
|
267
254
|
const slotClass = "next-content";
|
|
268
255
|
const dataTest = "test-tabs";
|
|
@@ -299,10 +286,8 @@ describe("UTabs.vue", () => {
|
|
|
299
286
|
});
|
|
300
287
|
});
|
|
301
288
|
|
|
302
|
-
// Events tests
|
|
303
289
|
describe("Events", () => {
|
|
304
|
-
|
|
305
|
-
it("emits update:modelValue event when tab is clicked", async () => {
|
|
290
|
+
it("Update:modelValue – emits update:modelValue event when tab is clicked", async () => {
|
|
306
291
|
const component = mount(UTabs, {
|
|
307
292
|
props: {
|
|
308
293
|
options,
|
|
@@ -321,10 +306,8 @@ describe("UTabs.vue", () => {
|
|
|
321
306
|
});
|
|
322
307
|
});
|
|
323
308
|
|
|
324
|
-
// Exposed refs tests
|
|
325
309
|
describe("Exposed refs", () => {
|
|
326
|
-
|
|
327
|
-
it("exposes wrapperRef", () => {
|
|
310
|
+
it("wrapperRef – exposes wrapperRef", () => {
|
|
328
311
|
const singleOption = [options[0]];
|
|
329
312
|
|
|
330
313
|
const component = mount(UTabs, {
|
|
@@ -8,10 +8,8 @@ import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
|
8
8
|
import type { Props } from "../types";
|
|
9
9
|
|
|
10
10
|
describe("UChip.vue", () => {
|
|
11
|
-
// Props tests
|
|
12
11
|
describe("Props", () => {
|
|
13
|
-
|
|
14
|
-
it("renders UIcon when icon prop is provided", () => {
|
|
12
|
+
it("Icon – renders UIcon when icon prop is provided", () => {
|
|
15
13
|
const icon = "close";
|
|
16
14
|
|
|
17
15
|
const component = mount(UChip, {
|
|
@@ -28,8 +26,7 @@ describe("UChip.vue", () => {
|
|
|
28
26
|
expect(nestedUDotComponents.length).toBe(0);
|
|
29
27
|
});
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
it("renders UDot when no icon prop is provided", () => {
|
|
29
|
+
it("Default – renders UDot when no icon prop is provided", () => {
|
|
33
30
|
const component = mount(UChip, {});
|
|
34
31
|
|
|
35
32
|
const nestedUIconComponents = component.findAllComponents(UIcon);
|
|
@@ -39,8 +36,7 @@ describe("UChip.vue", () => {
|
|
|
39
36
|
expect(nestedUDotComponents.length).toBe(1);
|
|
40
37
|
});
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
it("applies the correct color class to UDot component", async () => {
|
|
39
|
+
it("Color – applies the correct color class to UDot component", async () => {
|
|
44
40
|
const colors = [
|
|
45
41
|
"primary",
|
|
46
42
|
"secondary",
|
|
@@ -68,8 +64,7 @@ describe("UChip.vue", () => {
|
|
|
68
64
|
});
|
|
69
65
|
});
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
it("applies the correct color class to UIcon component", async () => {
|
|
67
|
+
it("Color – applies the correct color class to UIcon component", async () => {
|
|
73
68
|
const colors = [
|
|
74
69
|
"primary",
|
|
75
70
|
"secondary",
|
|
@@ -98,8 +93,7 @@ describe("UChip.vue", () => {
|
|
|
98
93
|
});
|
|
99
94
|
});
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
it("applies the correct size class", async () => {
|
|
96
|
+
it("Size – applies the correct size class", async () => {
|
|
103
97
|
const sizes = ["3xs", "2xs", "xs", "sm", "md", "lg", "xl", "2xl"];
|
|
104
98
|
|
|
105
99
|
sizes.forEach((size) => {
|
|
@@ -115,8 +109,7 @@ describe("UChip.vue", () => {
|
|
|
115
109
|
});
|
|
116
110
|
});
|
|
117
111
|
|
|
118
|
-
|
|
119
|
-
it("applies the correct xPosition class", async () => {
|
|
112
|
+
it("X Position – applies the correct xPosition class", async () => {
|
|
120
113
|
const xPositions = {
|
|
121
114
|
left: "left-px",
|
|
122
115
|
right: "right-px",
|
|
@@ -135,8 +128,7 @@ describe("UChip.vue", () => {
|
|
|
135
128
|
});
|
|
136
129
|
});
|
|
137
130
|
|
|
138
|
-
|
|
139
|
-
it("applies the correct yPosition class", async () => {
|
|
131
|
+
it("Y Position – applies the correct yPosition class", async () => {
|
|
140
132
|
const yPositions = {
|
|
141
133
|
top: "top-px",
|
|
142
134
|
bottom: "bottom-px",
|
|
@@ -155,8 +147,7 @@ describe("UChip.vue", () => {
|
|
|
155
147
|
});
|
|
156
148
|
});
|
|
157
149
|
|
|
158
|
-
|
|
159
|
-
it("applies transform classes when inset prop is false", async () => {
|
|
150
|
+
it("Inset – applies transform classes when inset prop is false", async () => {
|
|
160
151
|
const inset = false;
|
|
161
152
|
const yPosition = "top";
|
|
162
153
|
const xPosition = "right";
|
|
@@ -175,8 +166,7 @@ describe("UChip.vue", () => {
|
|
|
175
166
|
expect(chipWrapper.attributes("class")).toContain("translate-x-1/2");
|
|
176
167
|
});
|
|
177
168
|
|
|
178
|
-
|
|
179
|
-
it("does not apply transform classes when inset prop is true", async () => {
|
|
169
|
+
it("Inset – does not apply transform classes when inset prop is true", async () => {
|
|
180
170
|
const inset = true;
|
|
181
171
|
const yPosition = "top";
|
|
182
172
|
const xPosition = "right";
|
|
@@ -195,8 +185,7 @@ describe("UChip.vue", () => {
|
|
|
195
185
|
expect(chipWrapper.attributes("class")).not.toContain("translate-x-1/2");
|
|
196
186
|
});
|
|
197
187
|
|
|
198
|
-
|
|
199
|
-
it("applies the correct data-test attribute", () => {
|
|
188
|
+
it("DataTest – applies the correct data-test attribute", () => {
|
|
200
189
|
const dataTest = "test-chip";
|
|
201
190
|
|
|
202
191
|
const component = mount(UChip, {
|
|
@@ -209,10 +198,8 @@ describe("UChip.vue", () => {
|
|
|
209
198
|
});
|
|
210
199
|
});
|
|
211
200
|
|
|
212
|
-
// Slots tests
|
|
213
201
|
describe("Slots", () => {
|
|
214
|
-
|
|
215
|
-
it("renders content from default slot", () => {
|
|
202
|
+
it("Default – renders content from default slot", () => {
|
|
216
203
|
const slotContent = "Custom Content";
|
|
217
204
|
|
|
218
205
|
const component = mount(UChip, {
|
|
@@ -224,8 +211,7 @@ describe("UChip.vue", () => {
|
|
|
224
211
|
expect(component.text()).toContain(slotContent);
|
|
225
212
|
});
|
|
226
213
|
|
|
227
|
-
|
|
228
|
-
it("renders content from chip slot", () => {
|
|
214
|
+
it("Chip – renders content from chip slot", () => {
|
|
229
215
|
const slotText = "Custom Chip";
|
|
230
216
|
const slotClass = "custom-chip";
|
|
231
217
|
|
|
@@ -242,10 +228,8 @@ describe("UChip.vue", () => {
|
|
|
242
228
|
});
|
|
243
229
|
});
|
|
244
230
|
|
|
245
|
-
// Exposed refs tests
|
|
246
231
|
describe("Exposed refs", () => {
|
|
247
|
-
|
|
248
|
-
it("exposes wrapperRef", () => {
|
|
232
|
+
it("wrapperRef – exposes wrapperRef", () => {
|
|
249
233
|
const component = mount(UChip, {});
|
|
250
234
|
|
|
251
235
|
expect(component.vm.wrapperRef).toBeDefined();
|
|
@@ -7,10 +7,8 @@ import type { Props } from "../types";
|
|
|
7
7
|
import type { ComponentPublicInstance } from "vue";
|
|
8
8
|
|
|
9
9
|
describe("UDot.vue", () => {
|
|
10
|
-
// Props tests
|
|
11
10
|
describe("Props", () => {
|
|
12
|
-
|
|
13
|
-
it("applies the correct size class", () => {
|
|
11
|
+
it("Size – applies the correct size class", () => {
|
|
14
12
|
const sizes = {
|
|
15
13
|
xs: "size-1",
|
|
16
14
|
sm: "size-1.5",
|
|
@@ -30,8 +28,7 @@ describe("UDot.vue", () => {
|
|
|
30
28
|
});
|
|
31
29
|
});
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
it("applies the correct color class", () => {
|
|
31
|
+
it("Color – applies the correct color class", () => {
|
|
35
32
|
const colors = [
|
|
36
33
|
"primary",
|
|
37
34
|
"secondary",
|
|
@@ -55,8 +52,7 @@ describe("UDot.vue", () => {
|
|
|
55
52
|
});
|
|
56
53
|
});
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
it("applies the correct data-test attribute", () => {
|
|
55
|
+
it("DataTest – applies the correct data-test attribute", () => {
|
|
60
56
|
const dataTest = "test-dot";
|
|
61
57
|
|
|
62
58
|
const component = mount(UDot, {
|
|
@@ -69,10 +65,8 @@ describe("UDot.vue", () => {
|
|
|
69
65
|
});
|
|
70
66
|
});
|
|
71
67
|
|
|
72
|
-
// Exposed refs tests
|
|
73
68
|
describe("Exposed refs", () => {
|
|
74
|
-
|
|
75
|
-
it("exposes dotRef", () => {
|
|
69
|
+
it("dotRef – exposes dotRef", () => {
|
|
76
70
|
const component = mount(UDot);
|
|
77
71
|
|
|
78
72
|
expect(
|