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
|
@@ -5,10 +5,8 @@ import UGroup from "../UGroup.vue";
|
|
|
5
5
|
import UHeader from "../../ui.text-header/UHeader.vue";
|
|
6
6
|
|
|
7
7
|
describe("UGroup", () => {
|
|
8
|
-
// Props
|
|
9
8
|
describe("Props", () => {
|
|
10
|
-
|
|
11
|
-
it("renders with title prop", () => {
|
|
9
|
+
it("Title – renders with title prop", () => {
|
|
12
10
|
const title = "Group Title";
|
|
13
11
|
|
|
14
12
|
const component = mount(UGroup, {
|
|
@@ -23,8 +21,7 @@ describe("UGroup", () => {
|
|
|
23
21
|
expect(header.props("label")).toBe(title);
|
|
24
22
|
});
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
it("does not show header when title prop is not provided", () => {
|
|
24
|
+
it("Title – does not show header when title prop is not provided", () => {
|
|
28
25
|
const component = mount(UGroup);
|
|
29
26
|
|
|
30
27
|
const header = component.findComponent(UHeader);
|
|
@@ -32,8 +29,7 @@ describe("UGroup", () => {
|
|
|
32
29
|
expect(header.exists()).toBe(false);
|
|
33
30
|
});
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
it("applies upperlined class when upperlined prop is true", () => {
|
|
32
|
+
it("Upperlined – applies upperlined class when upperlined prop is true", () => {
|
|
37
33
|
const upperlined = true;
|
|
38
34
|
const title = "Group Title";
|
|
39
35
|
const expectedClass = "border-t";
|
|
@@ -51,8 +47,7 @@ describe("UGroup", () => {
|
|
|
51
47
|
expect(header.classes()).toContain(expectedClass);
|
|
52
48
|
});
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
it("applies underlined class when underlined prop is true", () => {
|
|
50
|
+
it("Underlined – applies underlined class when underlined prop is true", () => {
|
|
56
51
|
const underlined = true;
|
|
57
52
|
const title = "Group Title";
|
|
58
53
|
const expectedClass = "border-b";
|
|
@@ -70,8 +65,7 @@ describe("UGroup", () => {
|
|
|
70
65
|
expect(header.classes()).toContain(expectedClass);
|
|
71
66
|
});
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
it("applies data-test attribute", () => {
|
|
68
|
+
it("Data Test – applies data-test attribute", () => {
|
|
75
69
|
const dataTest = "group-test";
|
|
76
70
|
|
|
77
71
|
const component = mount(UGroup, {
|
|
@@ -84,10 +78,8 @@ describe("UGroup", () => {
|
|
|
84
78
|
});
|
|
85
79
|
});
|
|
86
80
|
|
|
87
|
-
// Slots
|
|
88
81
|
describe("Slots", () => {
|
|
89
|
-
|
|
90
|
-
it("renders content in default slot", () => {
|
|
82
|
+
it("Default – renders content in default slot", () => {
|
|
91
83
|
const slotClass = "default-content";
|
|
92
84
|
const slotContent = "Default Content";
|
|
93
85
|
|
|
@@ -101,8 +93,7 @@ describe("UGroup", () => {
|
|
|
101
93
|
expect(component.text()).toContain(slotContent);
|
|
102
94
|
});
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
it("renders custom content in title slot", () => {
|
|
96
|
+
it("Title – renders custom content in title slot", () => {
|
|
106
97
|
const title = "Group Title";
|
|
107
98
|
const slotClass = "custom-title";
|
|
108
99
|
const slotContent = "Custom Title";
|
|
@@ -119,7 +110,7 @@ describe("UGroup", () => {
|
|
|
119
110
|
expect(component.findComponent(UHeader).exists()).toBe(false);
|
|
120
111
|
});
|
|
121
112
|
|
|
122
|
-
it("provides title binding to title slot", () => {
|
|
113
|
+
it("Title – provides title binding to title slot", () => {
|
|
123
114
|
const title = "Group Title";
|
|
124
115
|
|
|
125
116
|
const component = mount(UGroup, {
|
|
@@ -139,8 +130,7 @@ describe("UGroup", () => {
|
|
|
139
130
|
expect(titleElement.attributes("data-title")).toBe(title);
|
|
140
131
|
});
|
|
141
132
|
|
|
142
|
-
|
|
143
|
-
it("renders content in before-title slot", () => {
|
|
133
|
+
it("Before-title – renders content in before-title slot", () => {
|
|
144
134
|
const title = "Group Title";
|
|
145
135
|
const slotClass = "before-title";
|
|
146
136
|
const slotContent = "Before Title";
|
|
@@ -156,8 +146,7 @@ describe("UGroup", () => {
|
|
|
156
146
|
expect(component.text()).toContain(slotContent);
|
|
157
147
|
});
|
|
158
148
|
|
|
159
|
-
|
|
160
|
-
it("renders content in after-title slot", () => {
|
|
149
|
+
it("After-title – renders content in after-title slot", () => {
|
|
161
150
|
const title = "Group Title";
|
|
162
151
|
const slotClass = "after-title";
|
|
163
152
|
const slotContent = "After Title";
|
|
@@ -173,8 +162,7 @@ describe("UGroup", () => {
|
|
|
173
162
|
expect(component.text()).toContain(slotContent);
|
|
174
163
|
});
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
it("renders content in actions slot", () => {
|
|
165
|
+
it("Actions – renders content in actions slot", () => {
|
|
178
166
|
const title = "Group Title";
|
|
179
167
|
const slotClass = "actions";
|
|
180
168
|
const slotContent = "Actions";
|
|
@@ -191,10 +179,8 @@ describe("UGroup", () => {
|
|
|
191
179
|
});
|
|
192
180
|
});
|
|
193
181
|
|
|
194
|
-
// Exposed refs
|
|
195
182
|
describe("Exposed refs", () => {
|
|
196
|
-
|
|
197
|
-
it("exposes wrapperRef", () => {
|
|
183
|
+
it("wrapperRef – exposes wrapperRef", () => {
|
|
198
184
|
const component = mount(UGroup);
|
|
199
185
|
|
|
200
186
|
expect(component.vm.wrapperRef).toBeDefined();
|
|
@@ -6,10 +6,8 @@ import UGroups from "../UGroups.vue";
|
|
|
6
6
|
import type { Props } from "../types";
|
|
7
7
|
|
|
8
8
|
describe("UGroups.vue", () => {
|
|
9
|
-
// Props tests
|
|
10
9
|
describe("Props", () => {
|
|
11
|
-
|
|
12
|
-
it("applies correct gap classes", () => {
|
|
10
|
+
it("Gap – applies correct gap classes", () => {
|
|
13
11
|
const gaps = {
|
|
14
12
|
none: "gap-0",
|
|
15
13
|
xs: "gap-8",
|
|
@@ -30,8 +28,7 @@ describe("UGroups.vue", () => {
|
|
|
30
28
|
});
|
|
31
29
|
});
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
it("applies the correct data-test attribute", () => {
|
|
31
|
+
it("Data Test – applies the correct data-test attribute", () => {
|
|
35
32
|
const dataTest = "groups-test";
|
|
36
33
|
|
|
37
34
|
const component = mount(UGroups, {
|
|
@@ -44,10 +41,8 @@ describe("UGroups.vue", () => {
|
|
|
44
41
|
});
|
|
45
42
|
});
|
|
46
43
|
|
|
47
|
-
// Slots tests
|
|
48
44
|
describe("Slots", () => {
|
|
49
|
-
|
|
50
|
-
it("renders content in default slot", () => {
|
|
45
|
+
it("Default – renders content in default slot", () => {
|
|
51
46
|
const slotClass = "default-content";
|
|
52
47
|
const slotContent = "Default Content";
|
|
53
48
|
|
|
@@ -62,10 +57,8 @@ describe("UGroups.vue", () => {
|
|
|
62
57
|
});
|
|
63
58
|
});
|
|
64
59
|
|
|
65
|
-
// Exposed refs tests
|
|
66
60
|
describe("Exposed refs", () => {
|
|
67
|
-
|
|
68
|
-
it("exposes wrapperRef", () => {
|
|
61
|
+
it("wrapperRef – exposes wrapperRef", () => {
|
|
69
62
|
const component = mount(UGroups);
|
|
70
63
|
|
|
71
64
|
expect(component.vm.wrapperRef).toBeDefined();
|
|
@@ -101,7 +101,7 @@ function trapFocus(e: KeyboardEvent) {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
// Tab - if focused on last element, move to first
|
|
104
|
+
// Tab - if focused on the last element, move to the first
|
|
105
105
|
if (!e.shiftKey && document.activeElement === lastElement) {
|
|
106
106
|
e.preventDefault();
|
|
107
107
|
firstElement.focus();
|
|
@@ -46,7 +46,7 @@ export default /*tw*/ {
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
compoundVariants: [
|
|
49
|
-
{ divided: true, variant: ["subtle", "soft"], class: "border-default/50" },
|
|
49
|
+
{ divided: true, variant: ["subtle", "soft", "inverted"], class: "border-default/50" },
|
|
50
50
|
{ divided: true, variant: ["solid", "outlined"], class: "border-muted" },
|
|
51
51
|
],
|
|
52
52
|
},
|
|
@@ -60,6 +60,7 @@ export default /*tw*/ {
|
|
|
60
60
|
outlined: "bg-default border-muted",
|
|
61
61
|
subtle: "bg-muted border-default/50",
|
|
62
62
|
soft: "bg-muted border-transparent",
|
|
63
|
+
inverted: "bg-inverted border-transparent",
|
|
63
64
|
},
|
|
64
65
|
size: {
|
|
65
66
|
xs: "md:w-[25rem]",
|
|
@@ -42,7 +42,7 @@ const emit = defineEmits([
|
|
|
42
42
|
|
|
43
43
|
const confirmModalRef = useTemplateRef<InstanceType<typeof UModal>>("confirmModal");
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const modalRef = computed(() => {
|
|
46
46
|
return confirmModalRef.value?.wrapperRef || null;
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -80,7 +80,7 @@ defineExpose({
|
|
|
80
80
|
* A reference to the UModal's wrapper element for direct DOM manipulation.
|
|
81
81
|
* @property {InstanceType<typeof UModal>}
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
modalRef,
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
/**
|
|
@@ -11,10 +11,8 @@ describe("UModalConfirm", () => {
|
|
|
11
11
|
// Define common test value
|
|
12
12
|
const modelValue = true;
|
|
13
13
|
|
|
14
|
-
// Props tests
|
|
15
14
|
describe("Props", () => {
|
|
16
|
-
|
|
17
|
-
it("renders when modelValue is true", () => {
|
|
15
|
+
it("Model Value – renders when modelValue is true", () => {
|
|
18
16
|
const component = mount(UModalConfirm, {
|
|
19
17
|
props: {
|
|
20
18
|
modelValue,
|
|
@@ -27,7 +25,7 @@ describe("UModalConfirm", () => {
|
|
|
27
25
|
expect(modal.props("modelValue")).toBe(modelValue);
|
|
28
26
|
});
|
|
29
27
|
|
|
30
|
-
it("does not render modal content when modelValue is false", () => {
|
|
28
|
+
it("Model Value – does not render modal content when modelValue is false", () => {
|
|
31
29
|
const modelValue = false;
|
|
32
30
|
|
|
33
31
|
const component = mount(UModalConfirm, {
|
|
@@ -42,8 +40,7 @@ describe("UModalConfirm", () => {
|
|
|
42
40
|
expect(modal.props("modelValue")).toBe(modelValue);
|
|
43
41
|
});
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
it("passes title prop to UModal", () => {
|
|
43
|
+
it("Title – passes title prop to UModal", () => {
|
|
47
44
|
const title = "Confirm Modal Title";
|
|
48
45
|
const component = mount(UModalConfirm, {
|
|
49
46
|
props: {
|
|
@@ -57,8 +54,7 @@ describe("UModalConfirm", () => {
|
|
|
57
54
|
expect(modal.props("title")).toBe(title);
|
|
58
55
|
});
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
it("passes description prop to UModal", () => {
|
|
57
|
+
it("Description – passes description prop to UModal", () => {
|
|
62
58
|
const description = "Confirm Modal Description";
|
|
63
59
|
|
|
64
60
|
const component = mount(UModalConfirm, {
|
|
@@ -73,8 +69,7 @@ describe("UModalConfirm", () => {
|
|
|
73
69
|
expect(modal.props("description")).toBe(description);
|
|
74
70
|
});
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
it("renders with custom confirmLabel prop", () => {
|
|
72
|
+
it("Confirm Label – renders with custom confirmLabel prop", () => {
|
|
78
73
|
const confirmLabel = "Custom Confirm";
|
|
79
74
|
const component = mount(UModalConfirm, {
|
|
80
75
|
props: {
|
|
@@ -87,8 +82,7 @@ describe("UModalConfirm", () => {
|
|
|
87
82
|
expect(component.find("[vl-key='confirmButton']").text()).toBe(confirmLabel);
|
|
88
83
|
});
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
it("applies correct confirmColor to confirm button", () => {
|
|
85
|
+
it("Confirm Color – applies correct confirmColor to confirm button", () => {
|
|
92
86
|
const colors = [
|
|
93
87
|
"primary",
|
|
94
88
|
"secondary",
|
|
@@ -113,8 +107,7 @@ describe("UModalConfirm", () => {
|
|
|
113
107
|
});
|
|
114
108
|
});
|
|
115
109
|
|
|
116
|
-
|
|
117
|
-
it("disables confirm button when confirmDisabled is true", () => {
|
|
110
|
+
it("Confirm Disabled – disables confirm button when confirmDisabled is true", () => {
|
|
118
111
|
const component = mount(UModalConfirm, {
|
|
119
112
|
props: {
|
|
120
113
|
modelValue,
|
|
@@ -125,8 +118,7 @@ describe("UModalConfirm", () => {
|
|
|
125
118
|
expect(component.find("[vl-key='confirmButton']").attributes("disabled")).toBeDefined();
|
|
126
119
|
});
|
|
127
120
|
|
|
128
|
-
|
|
129
|
-
it("hides cancel button when cancelHidden is true", () => {
|
|
121
|
+
it("Cancel Hidden – hides cancel button when cancelHidden is true", () => {
|
|
130
122
|
const cancelHidden = true;
|
|
131
123
|
|
|
132
124
|
const component = mount(UModalConfirm, {
|
|
@@ -143,9 +135,8 @@ describe("UModalConfirm", () => {
|
|
|
143
135
|
expect(cancelButton).toBeUndefined();
|
|
144
136
|
});
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const variants = ["solid", "outlined", "subtle", "soft"];
|
|
138
|
+
it("Variant – passes variant prop to UModal", () => {
|
|
139
|
+
const variants = ["solid", "outlined", "subtle", "soft", "inverted"];
|
|
149
140
|
|
|
150
141
|
variants.forEach((variant) => {
|
|
151
142
|
const component = mount(UModalConfirm, {
|
|
@@ -161,8 +152,7 @@ describe("UModalConfirm", () => {
|
|
|
161
152
|
});
|
|
162
153
|
});
|
|
163
154
|
|
|
164
|
-
|
|
165
|
-
it("passes size prop to UModal", () => {
|
|
155
|
+
it("Size – passes size prop to UModal", () => {
|
|
166
156
|
const sizes = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl"];
|
|
167
157
|
|
|
168
158
|
sizes.forEach((size) => {
|
|
@@ -179,8 +169,7 @@ describe("UModalConfirm", () => {
|
|
|
179
169
|
});
|
|
180
170
|
});
|
|
181
171
|
|
|
182
|
-
|
|
183
|
-
it("passes closeOnCross prop to UModal", () => {
|
|
172
|
+
it("Close On Cross – passes closeOnCross prop to UModal", () => {
|
|
184
173
|
const component = mount(UModalConfirm, {
|
|
185
174
|
props: {
|
|
186
175
|
modelValue,
|
|
@@ -193,8 +182,7 @@ describe("UModalConfirm", () => {
|
|
|
193
182
|
expect(modal.props("closeOnCross")).toBe(false);
|
|
194
183
|
});
|
|
195
184
|
|
|
196
|
-
|
|
197
|
-
it("passes closeOnOverlay prop to UModal", () => {
|
|
185
|
+
it("Close On Overlay – passes closeOnOverlay prop to UModal", () => {
|
|
198
186
|
const component = mount(UModalConfirm, {
|
|
199
187
|
props: {
|
|
200
188
|
modelValue,
|
|
@@ -221,8 +209,7 @@ describe("UModalConfirm", () => {
|
|
|
221
209
|
expect(modal.props("closeOnEsc")).toBe(false);
|
|
222
210
|
});
|
|
223
211
|
|
|
224
|
-
|
|
225
|
-
it("passes inner prop to UModal", () => {
|
|
212
|
+
it("Inner – passes inner prop to UModal", () => {
|
|
226
213
|
const component = mount(UModalConfirm, {
|
|
227
214
|
props: {
|
|
228
215
|
modelValue,
|
|
@@ -235,8 +222,7 @@ describe("UModalConfirm", () => {
|
|
|
235
222
|
expect(modal.props("inner")).toBe(true);
|
|
236
223
|
});
|
|
237
224
|
|
|
238
|
-
|
|
239
|
-
it("passes divided prop to UModal", () => {
|
|
225
|
+
it("Divided – passes divided prop to UModal", () => {
|
|
240
226
|
const component = mount(UModalConfirm, {
|
|
241
227
|
props: {
|
|
242
228
|
modelValue,
|
|
@@ -249,8 +235,7 @@ describe("UModalConfirm", () => {
|
|
|
249
235
|
expect(modal.props("divided")).toBe(true);
|
|
250
236
|
});
|
|
251
237
|
|
|
252
|
-
|
|
253
|
-
it("applies data-test attribute", () => {
|
|
238
|
+
it("Data Test – applies data-test attribute", () => {
|
|
254
239
|
const dataTest = "modal-confirm-test";
|
|
255
240
|
const component = mount(UModalConfirm, {
|
|
256
241
|
props: {
|
|
@@ -264,10 +249,8 @@ describe("UModalConfirm", () => {
|
|
|
264
249
|
});
|
|
265
250
|
});
|
|
266
251
|
|
|
267
|
-
// Slots tests
|
|
268
252
|
describe("Slots", () => {
|
|
269
|
-
|
|
270
|
-
it("passes default slot content to UModal", () => {
|
|
253
|
+
it("Default – passes default slot content to UModal", () => {
|
|
271
254
|
const slotClass = "default-content";
|
|
272
255
|
const slotContent = "Default Content";
|
|
273
256
|
|
|
@@ -288,8 +271,7 @@ describe("UModalConfirm", () => {
|
|
|
288
271
|
expect(modal.text()).toContain(slotContent);
|
|
289
272
|
});
|
|
290
273
|
|
|
291
|
-
|
|
292
|
-
it("passes before-title slot content to UModal", () => {
|
|
274
|
+
it("Before-title – passes before-title slot content to UModal", () => {
|
|
293
275
|
const slotClass = "before-title";
|
|
294
276
|
const slotContent = "Before Title";
|
|
295
277
|
|
|
@@ -310,8 +292,7 @@ describe("UModalConfirm", () => {
|
|
|
310
292
|
expect(modal.text()).toContain(slotContent);
|
|
311
293
|
});
|
|
312
294
|
|
|
313
|
-
|
|
314
|
-
it("passes title slot content to UModal", () => {
|
|
295
|
+
it("Title – passes title slot content to UModal", () => {
|
|
315
296
|
const slotClass = "title-content";
|
|
316
297
|
const slotContent = "Title Content";
|
|
317
298
|
|
|
@@ -332,8 +313,7 @@ describe("UModalConfirm", () => {
|
|
|
332
313
|
expect(modal.text()).toContain(slotContent);
|
|
333
314
|
});
|
|
334
315
|
|
|
335
|
-
|
|
336
|
-
it("passes after-title slot content to UModal", () => {
|
|
316
|
+
it("After-title – passes after-title slot content to UModal", () => {
|
|
337
317
|
const slotClass = "after-title";
|
|
338
318
|
const slotContent = "After Title";
|
|
339
319
|
|
|
@@ -354,8 +334,7 @@ describe("UModalConfirm", () => {
|
|
|
354
334
|
expect(modal.text()).toContain(slotContent);
|
|
355
335
|
});
|
|
356
336
|
|
|
357
|
-
|
|
358
|
-
it("passes actions slot content to UModal", () => {
|
|
337
|
+
it("Actions – passes actions slot content to UModal", () => {
|
|
359
338
|
const slotClass = "actions-content";
|
|
360
339
|
const slotContent = "Actions Content";
|
|
361
340
|
|
|
@@ -376,8 +355,7 @@ describe("UModalConfirm", () => {
|
|
|
376
355
|
expect(modal.text()).toContain(slotContent);
|
|
377
356
|
});
|
|
378
357
|
|
|
379
|
-
|
|
380
|
-
it("renders custom content in footer-left slot instead of default buttons", () => {
|
|
358
|
+
it("Footer-left – renders custom content in footer-left slot instead of default buttons", () => {
|
|
381
359
|
const slotClass = "footer-left";
|
|
382
360
|
const slotContent = "Footer Left";
|
|
383
361
|
|
|
@@ -405,8 +383,7 @@ describe("UModalConfirm", () => {
|
|
|
405
383
|
expect(confirmButton).toBeUndefined();
|
|
406
384
|
});
|
|
407
385
|
|
|
408
|
-
|
|
409
|
-
it("passes footer-right slot content to UModal", () => {
|
|
386
|
+
it("Footer-right – passes footer-right slot content to UModal", () => {
|
|
410
387
|
const slotClass = "footer-right";
|
|
411
388
|
const slotContent = "Footer Right";
|
|
412
389
|
const component = mount(UModalConfirm, {
|
|
@@ -427,10 +404,8 @@ describe("UModalConfirm", () => {
|
|
|
427
404
|
});
|
|
428
405
|
});
|
|
429
406
|
|
|
430
|
-
// Events tests
|
|
431
407
|
describe("Events", () => {
|
|
432
|
-
|
|
433
|
-
it("emits update:modelValue event when close button is clicked", async () => {
|
|
408
|
+
it("Update Model Value – emits update:modelValue event when close button is clicked", async () => {
|
|
434
409
|
const component = mount(UModalConfirm, {
|
|
435
410
|
props: {
|
|
436
411
|
modelValue,
|
|
@@ -447,8 +422,7 @@ describe("UModalConfirm", () => {
|
|
|
447
422
|
expect(component.emitted("update:modelValue")?.[0]).toEqual([false]);
|
|
448
423
|
});
|
|
449
424
|
|
|
450
|
-
|
|
451
|
-
it("emits confirm event when confirm button is clicked", async () => {
|
|
425
|
+
it("Confirm – emits confirm event when confirm button is clicked", async () => {
|
|
452
426
|
const component = mount(UModalConfirm, {
|
|
453
427
|
props: {
|
|
454
428
|
modelValue,
|
|
@@ -468,8 +442,7 @@ describe("UModalConfirm", () => {
|
|
|
468
442
|
expect(component.emitted("update:modelValue")?.[0]).toEqual([false]);
|
|
469
443
|
});
|
|
470
444
|
|
|
471
|
-
|
|
472
|
-
it("emits close event when cancel button is clicked", async () => {
|
|
445
|
+
it("Close – emits close event when cancel button is clicked", async () => {
|
|
473
446
|
const component = mount(UModalConfirm, {
|
|
474
447
|
props: {
|
|
475
448
|
modelValue,
|
|
@@ -490,17 +463,15 @@ describe("UModalConfirm", () => {
|
|
|
490
463
|
});
|
|
491
464
|
});
|
|
492
465
|
|
|
493
|
-
// Exposed refs tests
|
|
494
466
|
describe("Exposed refs", () => {
|
|
495
|
-
|
|
496
|
-
it("exposes modal ref", () => {
|
|
467
|
+
it("modalRef – exposes modal ref", () => {
|
|
497
468
|
const component = mount(UModalConfirm, {
|
|
498
469
|
props: {
|
|
499
470
|
modelValue,
|
|
500
471
|
},
|
|
501
472
|
});
|
|
502
473
|
|
|
503
|
-
expect(component.vm.
|
|
474
|
+
expect(component.vm.modalRef).toBeDefined();
|
|
504
475
|
});
|
|
505
476
|
});
|
|
506
477
|
});
|
|
@@ -28,6 +28,7 @@ export default /*tw*/ {
|
|
|
28
28
|
outlined: "bg-default border-muted",
|
|
29
29
|
subtle: "bg-muted border-default/50",
|
|
30
30
|
soft: "bg-muted border-transparent",
|
|
31
|
+
inverted: "bg-inverted border-transparent",
|
|
31
32
|
},
|
|
32
33
|
rounding: {
|
|
33
34
|
true: "md:pr-4 border-r-0",
|
|
@@ -51,6 +52,7 @@ export default /*tw*/ {
|
|
|
51
52
|
outlined: "bg-default border-muted",
|
|
52
53
|
subtle: "bg-muted border-default/50",
|
|
53
54
|
soft: "bg-muted border-transparent",
|
|
55
|
+
inverted: "bg-inverted border-transparent",
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
58
|
},
|