@dimailn/vuetify 2.7.2-alpha23 → 2.7.2-alpha25
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/vuetify.js +280 -256
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VBadge/VBadge.js +17 -14
- package/es5/components/VBadge/VBadge.js.map +1 -1
- package/es5/components/VBtn/VBtn.js +16 -16
- package/es5/components/VBtn/VBtn.js.map +1 -1
- package/es5/components/VColorPicker/VColorPicker.js +18 -31
- package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerCanvas.js +45 -46
- package/es5/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerEdit.js +27 -26
- package/es5/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerPreview.js +41 -30
- package/es5/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerSwatches.js +13 -10
- package/es5/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/es5/components/VDataTable/VDataTable.js +7 -11
- package/es5/components/VDataTable/VDataTable.js.map +1 -1
- package/es5/components/VInput/VInput.js +24 -6
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VSelect/VSelectList.js +1 -1
- package/es5/components/VSelect/VSelectList.js.map +1 -1
- package/es5/components/VSlider/VSlider.js +23 -18
- package/es5/components/VSlider/VSlider.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +3 -7
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/activatable/index.js +2 -1
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/bootable/index.js +1 -2
- package/es5/mixins/bootable/index.js.map +1 -1
- package/es5/mixins/mouse/index.js +10 -5
- package/es5/mixins/mouse/index.js.map +1 -1
- package/es5/mixins/selectable/index.js +3 -0
- package/es5/mixins/selectable/index.js.map +1 -1
- package/lib/components/VBadge/VBadge.js +14 -13
- package/lib/components/VBadge/VBadge.js.map +1 -1
- package/lib/components/VBtn/VBtn.js +18 -19
- package/lib/components/VBtn/VBtn.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.js +29 -37
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.js +41 -43
- package/lib/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.js +25 -31
- package/lib/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.js +45 -32
- package/lib/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.js +15 -9
- package/lib/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +3 -4
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VInput/VInput.js +16 -4
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VSelect/VSelectList.js +2 -1
- package/lib/components/VSelect/VSelectList.js.map +1 -1
- package/lib/components/VSlider/VSlider.js +26 -21
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +6 -9
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/activatable/index.js +2 -1
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/bootable/index.js +2 -4
- package/lib/mixins/bootable/index.js.map +1 -1
- package/lib/mixins/mouse/index.js +9 -5
- package/lib/mixins/mouse/index.js.map +1 -1
- package/lib/mixins/selectable/index.js +4 -0
- package/lib/mixins/selectable/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VBadge/VBadge.ts +24 -25
- package/src/components/VBadge/__tests__/VBadge.spec.ts +47 -30
- package/src/components/VBadge/__tests__/__snapshots__/VBadge.spec.ts.snap +5 -5
- package/src/components/VBtn/VBtn.ts +18 -16
- package/src/components/VBtn/__tests__/VBtn.spec.ts +257 -242
- package/src/components/VBtn/__tests__/__snapshots__/VBtn.spec.ts.snap +13 -73
- package/src/components/VColorPicker/VColorPicker.ts +32 -35
- package/src/components/VColorPicker/VColorPickerCanvas.ts +44 -37
- package/src/components/VColorPicker/VColorPickerEdit.ts +37 -35
- package/src/components/VColorPicker/VColorPickerPreview.ts +48 -28
- package/src/components/VColorPicker/VColorPickerSwatches.ts +23 -12
- package/src/components/VColorPicker/__tests__/VColorPicker.spec.ts +47 -47
- package/src/components/VColorPicker/__tests__/VColorPickerCanvas.spec.ts +15 -13
- package/src/components/VColorPicker/__tests__/VColorPickerEdit.spec.ts +52 -50
- package/src/components/VColorPicker/__tests__/VColorPickerPreview.spec.ts +101 -30
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +200 -157
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +28 -11
- package/src/components/VDataTable/VDataTable.ts +3 -3
- package/src/components/VInput/VInput.ts +12 -2
- package/src/components/VInput/__tests__/VInput.spec.ts +170 -234
- package/src/components/VInput/__tests__/__snapshots__/VInput.spec.ts.snap +50 -101
- package/src/components/VSelect/VSelectList.ts +1 -0
- package/src/components/VSkeletonLoader/__tests__/VSkeletonLoader.spec.ts +22 -15
- package/src/components/VSkeletonLoader/__tests__/__snapshots__/VSkeletonLoader.spec.ts.snap +60 -60
- package/src/components/VSlider/VSlider.ts +43 -27
- package/src/components/VSlider/__tests__/VSlider.spec.ts +188 -286
- package/src/components/VSlider/__tests__/__snapshots__/VSlider.spec.ts.snap +157 -246
- package/src/components/VTabs/__tests__/VTab.spec.ts +3 -3
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +2 -2
- package/src/components/VTooltip/VTooltip.ts +20 -20
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +60 -75
- package/src/mixins/activatable/index.ts +2 -1
- package/src/mixins/bootable/__tests__/bootable.spec.ts +17 -11
- package/src/mixins/bootable/index.ts +4 -3
- package/src/mixins/mouse/__tests__/mouse.spec.ts +54 -40
- package/src/mixins/mouse/index.ts +10 -6
- package/src/mixins/selectable/index.ts +4 -0
|
@@ -1,279 +1,215 @@
|
|
|
1
|
-
import VInput from
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import VInput from "../VInput";
|
|
2
|
+
import { mount, MountingOptions, VueWrapper } from "@vue/test-utils";
|
|
3
|
+
import { h } from "vue";
|
|
4
|
+
|
|
5
|
+
describe("VInput.ts", () => {
|
|
6
|
+
type Instance = InstanceType<typeof VInput>;
|
|
7
|
+
let mountFunction: (
|
|
8
|
+
options?: MountingOptions<Instance>
|
|
9
|
+
) => VueWrapper<Instance>;
|
|
10
|
+
|
|
11
11
|
beforeEach(() => {
|
|
12
|
-
mountFunction = (options?:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
mountFunction = (options?: MountingOptions<Instance>) => {
|
|
13
|
+
const defaultOptions = {
|
|
14
|
+
global: {
|
|
15
|
+
mocks: {
|
|
16
|
+
// Мокаем только необходимые свойства Vuetify
|
|
17
|
+
$vuetify: {
|
|
18
|
+
lang: {
|
|
19
|
+
t: (val: string) => val
|
|
20
|
+
},
|
|
21
|
+
icons: {
|
|
22
|
+
component: "mdi"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Объединяем опции правильно
|
|
30
|
+
const mergedOptions = {
|
|
31
|
+
...defaultOptions,
|
|
23
32
|
...options,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const wrapper = mountFunction({
|
|
30
|
-
propsData: {
|
|
31
|
-
hint: 'foo',
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
expect(wrapper.vm.hasHint).toBe(false)
|
|
36
|
-
wrapper.setProps({ persistentHint: true })
|
|
37
|
-
expect(wrapper.vm.hasHint).toBe(true)
|
|
38
|
-
wrapper.setProps({ persistentHint: false })
|
|
39
|
-
expect(wrapper.vm.hasHint).toBe(false)
|
|
40
|
-
wrapper.setData({ isFocused: true })
|
|
41
|
-
expect(wrapper.vm.hasHint).toBe(true)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('should emit an input update', () => {
|
|
45
|
-
const wrapper = mountFunction()
|
|
46
|
-
|
|
47
|
-
const input = jest.fn()
|
|
48
|
-
wrapper.vm.$on('input', input)
|
|
49
|
-
|
|
50
|
-
expect(wrapper.vm.lazyValue).toBeUndefined()
|
|
51
|
-
wrapper.vm.internalValue = 'foo'
|
|
52
|
-
expect(input).toHaveBeenCalledWith('foo')
|
|
53
|
-
expect(wrapper.vm.lazyValue).toBe('foo')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('should generate append and prepend slots', () => {
|
|
57
|
-
const el = slot => ({
|
|
58
|
-
render: h => h('div', slot),
|
|
59
|
-
})
|
|
60
|
-
const wrapper = mountFunction({
|
|
61
|
-
slots: { append: [el('append')] },
|
|
62
|
-
})
|
|
63
|
-
const wrapper2 = mountFunction({
|
|
64
|
-
slots: { prepend: [el('prepend')] },
|
|
65
|
-
})
|
|
33
|
+
global: {
|
|
34
|
+
...defaultOptions.global,
|
|
35
|
+
...options?.global
|
|
36
|
+
}
|
|
37
|
+
};
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
39
|
+
return mount(VInput, mergedOptions);
|
|
40
|
+
};
|
|
41
|
+
});
|
|
70
42
|
|
|
71
|
-
it(
|
|
43
|
+
it("should have hint", async () => {
|
|
44
|
+
const wrapper = mountFunction({
|
|
45
|
+
props: {
|
|
46
|
+
hint: "foo"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
expect(wrapper.vm.hasHint).toBe(false);
|
|
51
|
+
await wrapper.setProps({ persistentHint: true });
|
|
52
|
+
expect(wrapper.vm.hasHint).toBe(true);
|
|
53
|
+
await wrapper.setProps({ persistentHint: false });
|
|
54
|
+
expect(wrapper.vm.hasHint).toBe(false);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("should update lazyValue when value is updated", async () => {
|
|
72
58
|
const wrapper = mountFunction({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
})
|
|
59
|
+
props: {
|
|
60
|
+
modelValue: "foo"
|
|
61
|
+
}
|
|
62
|
+
});
|
|
77
63
|
|
|
78
|
-
expect(wrapper.
|
|
64
|
+
expect(wrapper.vm.lazyValue).toBe("foo");
|
|
79
65
|
|
|
80
|
-
wrapper.setProps({
|
|
81
|
-
prependIcon: undefined,
|
|
82
|
-
appendIcon: 'list',
|
|
83
|
-
})
|
|
66
|
+
await wrapper.setProps({ modelValue: "bar" });
|
|
84
67
|
|
|
85
|
-
|
|
68
|
+
expect(wrapper.vm.lazyValue).toBe("bar");
|
|
69
|
+
});
|
|
86
70
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
it('should not generate input details', () => {
|
|
71
|
+
it("should generate append and prepend slots", () => {
|
|
72
|
+
const el = (slot: string) => h("div", slot);
|
|
91
73
|
const wrapper = mountFunction({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
})
|
|
74
|
+
slots: {
|
|
75
|
+
append: () => [el("append")]
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
const wrapper2 = mountFunction({
|
|
79
|
+
slots: {
|
|
80
|
+
prepend: () => [el("prepend")]
|
|
81
|
+
}
|
|
82
|
+
});
|
|
96
83
|
|
|
97
|
-
expect(wrapper.
|
|
98
|
-
expect(
|
|
99
|
-
})
|
|
84
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
85
|
+
expect(wrapper2.html()).toMatchSnapshot();
|
|
86
|
+
});
|
|
100
87
|
|
|
101
|
-
it(
|
|
102
|
-
const cb = jest.fn()
|
|
103
|
-
const wrapper = mountFunction({
|
|
104
|
-
propsData: {
|
|
105
|
-
prependIcon: 'list',
|
|
106
|
-
appendIcon: 'search',
|
|
107
|
-
},
|
|
108
|
-
listeners: {
|
|
109
|
-
'click:prepend': cb,
|
|
110
|
-
'click:append': cb,
|
|
111
|
-
},
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
const click = jest.fn()
|
|
115
|
-
wrapper.vm.$on('click', click)
|
|
116
|
-
|
|
117
|
-
const prepend = wrapper.findAll('.v-icon').at(0)
|
|
118
|
-
const append = wrapper.findAll('.v-icon').at(1)
|
|
119
|
-
const slot = wrapper.find('.v-input__slot')
|
|
120
|
-
|
|
121
|
-
prepend.trigger('click')
|
|
122
|
-
expect(cb).toHaveBeenCalledTimes(1)
|
|
123
|
-
append.trigger('click')
|
|
124
|
-
expect(cb).toHaveBeenCalledTimes(2)
|
|
125
|
-
expect(click).not.toHaveBeenCalled()
|
|
126
|
-
|
|
127
|
-
slot.trigger('click')
|
|
128
|
-
expect(click).toHaveBeenCalled()
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
it('should accept a custom height', async () => {
|
|
132
|
-
const wrapper = mountFunction()
|
|
133
|
-
|
|
134
|
-
const inputWrapper = wrapper.find('.v-input__slot')
|
|
135
|
-
expect(inputWrapper.element.style.height).toBe('')
|
|
136
|
-
expect(wrapper.vm.height).toBeUndefined()
|
|
137
|
-
|
|
138
|
-
wrapper.setProps({ height: 10 })
|
|
139
|
-
await wrapper.vm.$nextTick()
|
|
140
|
-
expect(inputWrapper.element.style.height).toBe('10px')
|
|
141
|
-
wrapper.setProps({ height: '20px' })
|
|
142
|
-
await wrapper.vm.$nextTick()
|
|
143
|
-
expect(inputWrapper.element.style.height).toBe('20px')
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
it('should update lazyValue when value is updated', async () => {
|
|
88
|
+
it("should generate an icon and match snapshot", async () => {
|
|
147
89
|
const wrapper = mountFunction({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
})
|
|
90
|
+
props: {
|
|
91
|
+
prependIcon: "list"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
152
94
|
|
|
153
|
-
expect(wrapper.
|
|
95
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
154
96
|
|
|
155
|
-
wrapper.setProps({
|
|
156
|
-
|
|
97
|
+
await wrapper.setProps({
|
|
98
|
+
prependIcon: undefined,
|
|
99
|
+
appendIcon: "list"
|
|
100
|
+
});
|
|
157
101
|
|
|
158
|
-
expect(wrapper.
|
|
159
|
-
})
|
|
102
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
103
|
+
});
|
|
160
104
|
|
|
161
|
-
it(
|
|
162
|
-
const onClick = jest.fn()
|
|
163
|
-
const onMouseDown = jest.fn()
|
|
164
|
-
const onMouseUp = jest.fn()
|
|
105
|
+
it("should not generate input details", () => {
|
|
165
106
|
const wrapper = mountFunction({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
wrapper
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
expect(
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
107
|
+
props: {
|
|
108
|
+
hideDetails: true
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
expect(wrapper.vm.genMessages()).toBeNull();
|
|
113
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should accept a custom height", async () => {
|
|
117
|
+
const wrapper = mountFunction();
|
|
118
|
+
|
|
119
|
+
const inputWrapper = wrapper.find(".v-input__slot");
|
|
120
|
+
expect(inputWrapper.element?.getAttribute("style")).toBe(null);
|
|
121
|
+
expect(wrapper.vm.height).toBeUndefined();
|
|
122
|
+
|
|
123
|
+
await wrapper.setProps({ height: 10 });
|
|
124
|
+
expect(inputWrapper.element?.getAttribute("style")).toContain(
|
|
125
|
+
"height: 10px"
|
|
126
|
+
);
|
|
127
|
+
await wrapper.setProps({ height: "20px" });
|
|
128
|
+
expect(inputWrapper.element?.getAttribute("style")).toContain(
|
|
129
|
+
"height: 20px"
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("should be in an error state", async () => {
|
|
188
134
|
const wrapper = mountFunction({
|
|
189
|
-
|
|
190
|
-
})
|
|
135
|
+
props: { error: true }
|
|
136
|
+
});
|
|
191
137
|
|
|
192
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
138
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
193
139
|
|
|
194
|
-
wrapper.setProps({ errorMessages:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
})
|
|
140
|
+
await wrapper.setProps({ errorMessages: "required", error: false });
|
|
141
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
142
|
+
});
|
|
198
143
|
|
|
199
|
-
it(
|
|
144
|
+
it("should hide messages if no messages and hide-details is auto", async () => {
|
|
200
145
|
const wrapper = mountFunction({
|
|
201
|
-
|
|
202
|
-
hideDetails:
|
|
203
|
-
}
|
|
204
|
-
})
|
|
146
|
+
props: {
|
|
147
|
+
hideDetails: "auto"
|
|
148
|
+
}
|
|
149
|
+
});
|
|
205
150
|
|
|
206
|
-
expect(wrapper.vm.genMessages()).toBeNull()
|
|
151
|
+
expect(wrapper.vm.genMessages()).toBeNull();
|
|
207
152
|
|
|
208
|
-
wrapper.setProps({ error: true })
|
|
209
|
-
expect(wrapper.vm.genMessages()).toBeNull()
|
|
153
|
+
await wrapper.setProps({ error: true });
|
|
154
|
+
expect(wrapper.vm.genMessages()).toBeNull();
|
|
210
155
|
|
|
211
|
-
wrapper.setProps({ errorMessages:
|
|
212
|
-
expect(wrapper.vm.genMessages()).not.toBeNull()
|
|
213
|
-
})
|
|
156
|
+
await wrapper.setProps({ errorMessages: "required" });
|
|
157
|
+
expect(wrapper.vm.genMessages()).not.toBeNull();
|
|
158
|
+
});
|
|
214
159
|
|
|
215
|
-
it(
|
|
216
|
-
const wrapper = mountFunction()
|
|
160
|
+
it("should be disabled", async () => {
|
|
161
|
+
const wrapper = mountFunction();
|
|
217
162
|
|
|
218
|
-
expect(wrapper.vm.isInteractive).toBe(true)
|
|
163
|
+
expect(wrapper.vm.isInteractive).toBe(true);
|
|
219
164
|
|
|
220
|
-
wrapper.setProps({ disabled: true })
|
|
165
|
+
await wrapper.setProps({ disabled: true });
|
|
221
166
|
|
|
222
|
-
expect(wrapper.vm.isInteractive).toBe(false)
|
|
167
|
+
expect(wrapper.vm.isInteractive).toBe(false);
|
|
223
168
|
|
|
224
|
-
wrapper.setProps({
|
|
169
|
+
await wrapper.setProps({
|
|
225
170
|
disabled: false,
|
|
226
|
-
readonly: true
|
|
227
|
-
})
|
|
171
|
+
readonly: true
|
|
172
|
+
});
|
|
228
173
|
|
|
229
|
-
expect(wrapper.vm.isInteractive).toBe(false)
|
|
174
|
+
expect(wrapper.vm.isInteractive).toBe(false);
|
|
230
175
|
|
|
231
|
-
wrapper.setProps({ readonly: false })
|
|
176
|
+
await wrapper.setProps({ readonly: false });
|
|
232
177
|
|
|
233
|
-
expect(wrapper.vm.isInteractive).toBe(true)
|
|
234
|
-
})
|
|
178
|
+
expect(wrapper.vm.isInteractive).toBe(true);
|
|
179
|
+
});
|
|
235
180
|
|
|
236
|
-
it(
|
|
181
|
+
it("should render a label", () => {
|
|
237
182
|
const wrapper = mountFunction({
|
|
238
|
-
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
expect(wrapper.vm.hasLabel).toBe(true)
|
|
242
|
-
|
|
243
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
244
|
-
|
|
245
|
-
const wrapper2 = mountFunction({
|
|
246
|
-
slots: {
|
|
247
|
-
label: [{ render: h => h('div', 'foo') }],
|
|
248
|
-
},
|
|
249
|
-
})
|
|
183
|
+
props: { label: "foo" }
|
|
184
|
+
});
|
|
250
185
|
|
|
251
|
-
expect(
|
|
252
|
-
|
|
186
|
+
expect(wrapper.vm.hasLabel).toBe(true);
|
|
187
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
188
|
+
});
|
|
253
189
|
|
|
254
|
-
it(
|
|
190
|
+
it("should apply theme to label, counter, messages and icons", () => {
|
|
255
191
|
const wrapper = mountFunction({
|
|
256
|
-
|
|
257
|
-
label:
|
|
258
|
-
hint:
|
|
192
|
+
props: {
|
|
193
|
+
label: "foo",
|
|
194
|
+
hint: "bar",
|
|
259
195
|
persistentHint: true,
|
|
260
196
|
light: true,
|
|
261
|
-
prependIcon:
|
|
262
|
-
appendIcon:
|
|
263
|
-
}
|
|
264
|
-
})
|
|
197
|
+
prependIcon: "prepend",
|
|
198
|
+
appendIcon: "append"
|
|
199
|
+
}
|
|
200
|
+
});
|
|
265
201
|
|
|
266
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
267
|
-
})
|
|
202
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
203
|
+
});
|
|
268
204
|
|
|
269
|
-
it(
|
|
205
|
+
it("should apply attrs to root element", () => {
|
|
270
206
|
const wrapper = mountFunction({
|
|
271
|
-
|
|
272
|
-
foo:
|
|
273
|
-
}
|
|
274
|
-
})
|
|
275
|
-
|
|
276
|
-
expect(wrapper.html()).toMatchSnapshot()
|
|
277
|
-
expect(wrapper.attributes()).
|
|
278
|
-
})
|
|
279
|
-
})
|
|
207
|
+
props: {
|
|
208
|
+
foo: "bar"
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
213
|
+
expect(wrapper.attributes()).toHaveProperty("foo", "bar");
|
|
214
|
+
});
|
|
215
|
+
});
|