@dimailn/vuetify 2.7.2-alpha24 → 2.7.2-alpha26
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 +583 -388
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAppBar/VAppBarNavIcon.js +5 -1
- package/es5/components/VAppBar/VAppBarNavIcon.js.map +1 -1
- package/es5/components/VBanner/VBanner.js +15 -6
- package/es5/components/VBanner/VBanner.js.map +1 -1
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js +18 -6
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/es5/components/VBtn/VBtn.js +19 -15
- package/es5/components/VBtn/VBtn.js.map +1 -1
- package/es5/components/VCarousel/VCarousel.js +10 -4
- package/es5/components/VCarousel/VCarousel.js.map +1 -1
- package/es5/components/VCarousel/VCarouselItem.js +7 -3
- package/es5/components/VCarousel/VCarouselItem.js.map +1 -1
- package/es5/components/VCheckbox/VCheckbox.js +5 -1
- package/es5/components/VCheckbox/VCheckbox.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/VDataIterator/VDataFooter.js +5 -1
- package/es5/components/VDataIterator/VDataFooter.js.map +1 -1
- package/es5/components/VDataTable/VDataTable.js +28 -18
- package/es5/components/VDataTable/VDataTable.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeader.js +2 -6
- package/es5/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/es5/components/VDataTable/VEditDialog.js +6 -2
- package/es5/components/VDataTable/VEditDialog.js.map +1 -1
- package/es5/components/VDataTable/mixins/header.js +5 -1
- package/es5/components/VDataTable/mixins/header.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerHeader.js +8 -2
- package/es5/components/VDatePicker/VDatePickerHeader.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerTitle.js +13 -5
- package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js +5 -3
- package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +16 -12
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js +11 -9
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js +15 -9
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/es5/components/VImg/VImg.js +6 -2
- package/es5/components/VImg/VImg.js.map +1 -1
- package/es5/components/VInput/VInput.js +28 -8
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VList/VListGroup.js +27 -9
- package/es5/components/VList/VListGroup.js.map +1 -1
- package/es5/components/VList/VListItem.js +5 -1
- package/es5/components/VList/VListItem.js.map +1 -1
- package/es5/components/VMessages/VMessages.js +5 -1
- package/es5/components/VMessages/VMessages.js.map +1 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js +3 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/es5/components/VPagination/VPagination.js +3 -1
- package/es5/components/VPagination/VPagination.js.map +1 -1
- package/es5/components/VPicker/VPicker.js +5 -1
- package/es5/components/VPicker/VPicker.js.map +1 -1
- package/es5/components/VRadioGroup/VRadio.js +10 -2
- package/es5/components/VRadioGroup/VRadio.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +6 -2
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSelect/VSelectList.js +17 -9
- package/es5/components/VSelect/VSelectList.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +26 -18
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VSlider/VSlider.js +36 -27
- package/es5/components/VSlider/VSlider.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +3 -1
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VSwitch/VSwitch.js +10 -6
- package/es5/components/VSwitch/VSwitch.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +6 -2
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +7 -3
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +6 -8
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +11 -3
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/transitions/createTransition.js +8 -2
- package/es5/components/transitions/createTransition.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/picker/index.js +13 -3
- package/es5/mixins/picker/index.js.map +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.js +1 -1
- package/lib/components/VAppBar/VAppBarNavIcon.js.map +1 -1
- package/lib/components/VBanner/VBanner.js +3 -3
- package/lib/components/VBanner/VBanner.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js +2 -2
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/lib/components/VBtn/VBtn.js +20 -19
- package/lib/components/VBtn/VBtn.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.js +3 -3
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VCarousel/VCarouselItem.js +1 -1
- package/lib/components/VCarousel/VCarouselItem.js.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.js +1 -1
- package/lib/components/VCheckbox/VCheckbox.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/VDataIterator/VDataFooter.js +1 -1
- package/lib/components/VDataIterator/VDataFooter.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +8 -9
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeader.js +3 -6
- package/lib/components/VDataTable/VDataTableHeader.js.map +1 -1
- package/lib/components/VDataTable/VEditDialog.js +2 -2
- package/lib/components/VDataTable/VEditDialog.js.map +1 -1
- package/lib/components/VDataTable/mixins/header.js +1 -1
- package/lib/components/VDataTable/mixins/header.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerHeader.js +2 -2
- package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.js +2 -2
- package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +2 -2
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js +2 -2
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/lib/components/VImg/VImg.js +2 -2
- package/lib/components/VImg/VImg.js.map +1 -1
- package/lib/components/VInput/VInput.js +14 -6
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VList/VListGroup.js +5 -5
- package/lib/components/VList/VListGroup.js.map +1 -1
- package/lib/components/VList/VListItem.js +3 -1
- package/lib/components/VList/VListItem.js.map +1 -1
- package/lib/components/VMessages/VMessages.js +1 -1
- package/lib/components/VMessages/VMessages.js.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/lib/components/VPagination/VPagination.js +1 -1
- package/lib/components/VPagination/VPagination.js.map +1 -1
- package/lib/components/VPicker/VPicker.js +1 -1
- package/lib/components/VPicker/VPicker.js.map +1 -1
- package/lib/components/VRadioGroup/VRadio.js +2 -2
- package/lib/components/VRadioGroup/VRadio.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +2 -2
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSelect/VSelectList.js +2 -2
- package/lib/components/VSelect/VSelectList.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +3 -3
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VSlider/VSlider.js +26 -21
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +1 -1
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.js +1 -1
- package/lib/components/VSwitch/VSwitch.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +2 -2
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +1 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +7 -10
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +3 -3
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/transitions/createTransition.js +2 -2
- package/lib/components/transitions/createTransition.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/picker/index.js +5 -3
- package/lib/mixins/picker/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VAppBar/VAppBarNavIcon.ts +1 -1
- package/src/components/VBanner/VBanner.ts +3 -3
- package/src/components/VBreadcrumbs/VBreadcrumbs.ts +2 -2
- package/src/components/VBtn/VBtn.ts +24 -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/VCarousel/VCarousel.ts +3 -3
- package/src/components/VCarousel/VCarouselItem.ts +1 -1
- package/src/components/VCheckbox/VCheckbox.ts +1 -1
- 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/VDataIterator/VDataFooter.ts +1 -1
- package/src/components/VDataTable/VDataTable.ts +8 -8
- package/src/components/VDataTable/VDataTableHeader.ts +2 -4
- package/src/components/VDataTable/VEditDialog.ts +2 -2
- package/src/components/VDataTable/mixins/header.ts +1 -1
- package/src/components/VDatePicker/VDatePickerHeader.ts +3 -3
- package/src/components/VDatePicker/VDatePickerTitle.ts +2 -2
- package/src/components/VDatePicker/mixins/date-picker-table.ts +1 -1
- package/src/components/VDialog/VDialog.ts +2 -2
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +1 -1
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +2 -2
- package/src/components/VImg/VImg.ts +2 -2
- package/src/components/VInput/VInput.ts +10 -4
- 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/VList/VListGroup.ts +5 -5
- package/src/components/VList/VListItem.ts +7 -4
- package/src/components/VMessages/VMessages.ts +1 -1
- package/src/components/VOverflowBtn/VOverflowBtn.ts +1 -1
- package/src/components/VPagination/VPagination.ts +1 -1
- package/src/components/VPicker/VPicker.ts +1 -1
- package/src/components/VRadioGroup/VRadio.ts +2 -2
- package/src/components/VSelect/VSelect.ts +2 -2
- package/src/components/VSelect/VSelectList.ts +3 -3
- 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/VSlideGroup/VSlideGroup.ts +3 -3
- package/src/components/VSlider/VSlider.ts +44 -28
- 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/VStepper/VStepperContent.ts +1 -1
- package/src/components/VSwitch/VSwitch.ts +1 -1
- package/src/components/VTabs/VTabs.ts +2 -2
- package/src/components/VTabs/__tests__/VTab.spec.ts +3 -3
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +2 -2
- package/src/components/VTextField/VTextField.ts +1 -1
- package/src/components/VTooltip/VTooltip.ts +21 -21
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +60 -75
- package/src/components/VTreeview/VTreeviewNode.ts +3 -3
- package/src/components/transitions/createTransition.ts +2 -2
- package/src/mixins/picker/index.ts +4 -4
|
@@ -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
|
+
});
|