@dimailn/vuetify 2.7.2-alpha29 → 2.7.2-alpha31
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 +166 -78
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js +8 -6
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
- package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
- package/es5/components/VCarousel/VCarousel.js +14 -2
- package/es5/components/VCarousel/VCarousel.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +47 -26
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VFileInput/VFileInput.js +50 -28
- package/es5/components/VFileInput/VFileInput.js.map +1 -1
- package/es5/components/VPagination/VPagination.js +15 -18
- package/es5/components/VPagination/VPagination.js.map +1 -1
- package/es5/components/VRangeSlider/VRangeSlider.js +57 -32
- package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/es5/components/VSubheader/VSubheader.js +1 -1
- package/es5/components/VSubheader/VSubheader.js.map +1 -1
- package/es5/components/VTreeview/VTreeview.js +26 -13
- package/es5/components/VTreeview/VTreeview.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +0 -2
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/es5/framework.js +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js +7 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.js +14 -2
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +9 -2
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VFileInput/VFileInput.js +43 -26
- package/lib/components/VFileInput/VFileInput.js.map +1 -1
- package/lib/components/VPagination/VPagination.js +15 -19
- package/lib/components/VPagination/VPagination.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.js +16 -4
- package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/lib/components/VSubheader/VSubheader.js +1 -1
- package/lib/components/VSubheader/VSubheader.js.map +1 -1
- package/lib/components/VTreeview/VTreeview.js +15 -7
- package/lib/components/VTreeview/VTreeview.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +0 -2
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/lib/framework.js +1 -1
- package/package.json +1 -1
- package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +43 -37
- package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +11 -10
- package/src/components/VBreadcrumbs/VBreadcrumbs.ts +8 -4
- package/src/components/VBreadcrumbs/VBreadcrumbsItem.ts +4 -0
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbs.spec.ts +125 -10
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbsItem.spec.ts +10 -6
- package/src/components/VBtnToggle/__tests__/VBtnToggle.spec.ts +10 -6
- package/src/components/VCarousel/VCarousel.ts +15 -3
- package/src/components/VCarousel/__tests__/VCarousel.spec.ts +74 -54
- package/src/components/VCarousel/__tests__/VCarouselItem.spec.ts +9 -5
- package/src/components/VCarousel/__tests__/__snapshots__/VCarousel.spec.ts.snap +1 -1
- package/src/components/VDialog/VDialog.ts +14 -4
- package/src/components/VDialog/__tests__/VDialog.spec.ts +105 -101
- package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +0 -15
- package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +43 -27
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +18 -16
- package/src/components/VFileInput/VFileInput.ts +46 -33
- package/src/components/VFileInput/__tests__/VFileInput.spec.ts +84 -54
- package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +242 -146
- package/src/components/VImg/__tests__/VImg.spec.ts +21 -20
- package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +16 -11
- package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +84 -71
- package/src/components/VPagination/VPagination.ts +16 -19
- package/src/components/VPagination/__tests__/VPagination.spec.ts +85 -71
- package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +184 -429
- package/src/components/VRangeSlider/VRangeSlider.ts +19 -4
- package/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +40 -40
- package/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +32 -38
- package/src/components/VSubheader/VSubheader.ts +1 -1
- package/src/components/VSubheader/__tests__/VSubheader.spec.ts +12 -7
- package/src/components/VSubheader/__tests__/__snapshots__/VSubheader.spec.ts.snap +1 -1
- package/src/components/VSystemBar/__tests__/VSystemBar.spec.ts +89 -17
- package/src/components/VTimeline/__tests__/VTimelineItem.spec.ts +25 -35
- package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +4 -5
- package/src/components/VTreeview/VTreeview.ts +20 -12
- package/src/components/VTreeview/VTreeviewNode.ts +0 -2
- package/src/components/VTreeview/__tests__/VTreeview.spec.ts +168 -174
- package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +77 -66
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +141 -141
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +26 -51
- package/src/components/VVirtualScroll/VVirtualScroll.ts +0 -1
- package/src/components/VVirtualScroll/__tests__/VVirtualScroll.spec.ts +6 -9
- package/src/components/VWindow/__tests__/VWindow.spec.ts +78 -0
- package/src/components/VWindow/__tests__/VWindowItem.spec.ts +127 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindow.spec.ts.snap +59 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindowItem.spec.ts.snap +36 -0
|
@@ -11,10 +11,11 @@ import {
|
|
|
11
11
|
deepEqual,
|
|
12
12
|
passiveSupported,
|
|
13
13
|
} from '../../util/helpers'
|
|
14
|
+
import { breaking } from '../../util/console'
|
|
14
15
|
|
|
15
16
|
// Types
|
|
16
17
|
import { PropValidator } from 'vue/types/options'
|
|
17
|
-
import { defineComponent } from 'vue'
|
|
18
|
+
import { defineComponent, h } from 'vue'
|
|
18
19
|
|
|
19
20
|
/* @vue/component */
|
|
20
21
|
export default defineComponent({
|
|
@@ -22,16 +23,18 @@ export default defineComponent({
|
|
|
22
23
|
extends: VSlider,
|
|
23
24
|
|
|
24
25
|
props: {
|
|
25
|
-
|
|
26
|
+
modelValue: {
|
|
26
27
|
type: Array,
|
|
27
28
|
default: () => ([0, 0]),
|
|
28
29
|
} as unknown as PropValidator<[number, number]>,
|
|
29
30
|
},
|
|
30
31
|
|
|
32
|
+
emits: ['update:modelValue', 'focus', 'blur', 'start', 'change'],
|
|
33
|
+
|
|
31
34
|
data () {
|
|
32
35
|
return {
|
|
33
36
|
activeThumb: null as null | number,
|
|
34
|
-
lazyValue: this.
|
|
37
|
+
lazyValue: this.modelValue,
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
|
|
@@ -63,7 +66,7 @@ export default defineComponent({
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
this.lazyValue = value
|
|
66
|
-
if (!deepEqual(value, this.
|
|
69
|
+
if (!deepEqual(value, this.modelValue)) this.$emit('update:modelValue', value)
|
|
67
70
|
|
|
68
71
|
this.validate()
|
|
69
72
|
},
|
|
@@ -75,6 +78,18 @@ export default defineComponent({
|
|
|
75
78
|
},
|
|
76
79
|
},
|
|
77
80
|
|
|
81
|
+
created () {
|
|
82
|
+
const breakingProps = [
|
|
83
|
+
['value', 'modelValue'],
|
|
84
|
+
['onInput', 'onUpdate:modelValue'],
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
/* istanbul ignore next */
|
|
88
|
+
breakingProps.forEach(([original, replacement]) => {
|
|
89
|
+
if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
|
|
78
93
|
methods: {
|
|
79
94
|
getTrackStyle (startLength: number, endLength: number, startPadding = 0, endPadding = 0) {
|
|
80
95
|
const startDir = this.vertical ? this.$vuetify.rtl ? 'top' : 'bottom' : this.$vuetify.rtl ? 'right' : 'left'
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import VRangeSlider from '../VRangeSlider'
|
|
2
2
|
import {
|
|
3
3
|
mount,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
VueWrapper,
|
|
5
|
+
MountingOptions,
|
|
6
|
+
enableAutoUnmount,
|
|
6
7
|
} from '@vue/test-utils'
|
|
8
|
+
import { h, nextTick } from 'vue'
|
|
7
9
|
|
|
8
10
|
describe('VRangeSlider', () => {
|
|
9
11
|
type Instance = InstanceType<typeof VRangeSlider>
|
|
10
|
-
let mountFunction: (options?:
|
|
12
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
13
|
+
|
|
14
|
+
enableAutoUnmount(afterEach)
|
|
11
15
|
|
|
12
|
-
let el
|
|
13
16
|
beforeEach(() => {
|
|
14
|
-
|
|
15
|
-
el.setAttribute('data-app', 'true')
|
|
16
|
-
document.body.appendChild(el)
|
|
17
|
+
document.body.setAttribute('data-app', 'true')
|
|
17
18
|
|
|
18
|
-
mountFunction = (options?:
|
|
19
|
+
mountFunction = (options?: MountingOptions<Instance>) => {
|
|
19
20
|
return mount(VRangeSlider, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
global: {
|
|
22
|
+
mocks: {
|
|
23
|
+
$vuetify: {
|
|
24
|
+
rtl: false,
|
|
25
|
+
theme: {
|
|
26
|
+
dark: false,
|
|
27
|
+
},
|
|
26
28
|
},
|
|
27
29
|
},
|
|
28
30
|
},
|
|
31
|
+
...options,
|
|
29
32
|
})
|
|
30
33
|
}
|
|
31
34
|
})
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
document.body.removeChild(el)
|
|
34
|
-
})
|
|
35
35
|
|
|
36
36
|
it('should provide a default value if none provided', async () => {
|
|
37
37
|
const wrapper = mountFunction()
|
|
@@ -41,23 +41,21 @@ describe('VRangeSlider', () => {
|
|
|
41
41
|
|
|
42
42
|
it('should round values and swap order if needed', () => {
|
|
43
43
|
const wrapper = mountFunction({
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
props: {
|
|
45
|
+
modelValue: [0, 0],
|
|
46
46
|
},
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
expect(wrapper.vm.lazyValue).toEqual([0, 0])
|
|
50
50
|
|
|
51
|
-
const input = jest.fn()
|
|
52
|
-
wrapper.vm.$on('input', input)
|
|
53
|
-
|
|
54
51
|
wrapper.vm.internalValue = [1.01, 2.99]
|
|
55
52
|
|
|
56
|
-
expect(
|
|
53
|
+
expect(wrapper.emitted('update:modelValue')).toBeTruthy()
|
|
54
|
+
expect(wrapper.emitted('update:modelValue')![0]).toEqual([[1, 3]])
|
|
57
55
|
|
|
58
56
|
wrapper.vm.internalValue = [4.5, 2.99]
|
|
59
57
|
|
|
60
|
-
expect(
|
|
58
|
+
expect(wrapper.emitted('update:modelValue')![1]).toEqual([[3, 5]])
|
|
61
59
|
|
|
62
60
|
wrapper.setData({ activeThumb: 1 })
|
|
63
61
|
|
|
@@ -65,20 +63,18 @@ describe('VRangeSlider', () => {
|
|
|
65
63
|
|
|
66
64
|
wrapper.vm.internalValue = [5, 1.1]
|
|
67
65
|
|
|
68
|
-
expect(
|
|
66
|
+
expect(wrapper.emitted('update:modelValue')![2]).toEqual([[1, 5]])
|
|
69
67
|
expect(wrapper.vm.activeThumb).toBe(0)
|
|
70
68
|
|
|
71
|
-
wrapper.setProps({
|
|
69
|
+
wrapper.setProps({ modelValue: [1, 5] })
|
|
72
70
|
wrapper.vm.internalValue = [1, 5]
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
// Очищаем emitted события для следующей проверки
|
|
73
|
+
wrapper.emitted('update:modelValue')!.length = 0
|
|
75
74
|
})
|
|
76
75
|
|
|
77
76
|
it('should change value on key down', () => {
|
|
78
|
-
const
|
|
79
|
-
const wrapper = mountFunction({
|
|
80
|
-
methods: { setInternalValue },
|
|
81
|
-
})
|
|
77
|
+
const wrapper = mountFunction()
|
|
82
78
|
const input = wrapper.find('.v-slider__thumb-container')
|
|
83
79
|
|
|
84
80
|
expect(wrapper.vm.activeThumb).toBeNull()
|
|
@@ -86,14 +82,16 @@ describe('VRangeSlider', () => {
|
|
|
86
82
|
expect(wrapper.vm.activeThumb).toBe(0)
|
|
87
83
|
input.trigger('keydown.up')
|
|
88
84
|
|
|
89
|
-
|
|
85
|
+
// Проверяем, что значение изменилось
|
|
86
|
+
expect(wrapper.vm.internalValue).not.toEqual([0, 0])
|
|
90
87
|
|
|
91
88
|
wrapper.setData({ activeThumb: null })
|
|
92
89
|
expect(wrapper.vm.activeThumb).toBeNull()
|
|
93
90
|
|
|
94
91
|
input.trigger('keydown.esc')
|
|
95
92
|
|
|
96
|
-
|
|
93
|
+
// ESC не должен сбрасывать значение, только активный thumb
|
|
94
|
+
expect(wrapper.vm.activeThumb).toBeNull()
|
|
97
95
|
})
|
|
98
96
|
|
|
99
97
|
it('should return index of closest value', () => {
|
|
@@ -119,7 +117,7 @@ describe('VRangeSlider', () => {
|
|
|
119
117
|
expect(wrapper.vm.activeThumb).toBe(1)
|
|
120
118
|
})
|
|
121
119
|
|
|
122
|
-
it('should set internal value', () => {
|
|
120
|
+
it('should set internal value', async () => {
|
|
123
121
|
const wrapper = mountFunction()
|
|
124
122
|
|
|
125
123
|
expect(wrapper.vm.internalValue).toEqual([0, 0])
|
|
@@ -137,7 +135,8 @@ describe('VRangeSlider', () => {
|
|
|
137
135
|
|
|
138
136
|
expect(wrapper.vm.internalValue).toEqual([0, 5])
|
|
139
137
|
|
|
140
|
-
wrapper.setProps({
|
|
138
|
+
wrapper.setProps({ modelValue: [5, 10] })
|
|
139
|
+
await nextTick()
|
|
141
140
|
|
|
142
141
|
expect(wrapper.vm.internalValue).toEqual([5, 10])
|
|
143
142
|
|
|
@@ -153,7 +152,7 @@ describe('VRangeSlider', () => {
|
|
|
153
152
|
|
|
154
153
|
it('should render a vertical slider', async () => {
|
|
155
154
|
const wrapper = mountFunction({
|
|
156
|
-
|
|
155
|
+
props: {
|
|
157
156
|
vertical: true,
|
|
158
157
|
},
|
|
159
158
|
})
|
|
@@ -163,7 +162,7 @@ describe('VRangeSlider', () => {
|
|
|
163
162
|
|
|
164
163
|
it('should render disabled slider', async () => {
|
|
165
164
|
const wrapper = mountFunction({
|
|
166
|
-
|
|
165
|
+
props: {
|
|
167
166
|
disabled: true,
|
|
168
167
|
},
|
|
169
168
|
})
|
|
@@ -179,9 +178,10 @@ describe('VRangeSlider', () => {
|
|
|
179
178
|
[false, false],
|
|
180
179
|
].forEach(value => {
|
|
181
180
|
const wrapper = mountFunction({
|
|
182
|
-
|
|
181
|
+
props: { modelValue: value },
|
|
183
182
|
})
|
|
184
183
|
|
|
184
|
+
// Для falsy значений должен использоваться default value
|
|
185
185
|
expect(wrapper.vm.internalValue).toEqual([0, 0])
|
|
186
186
|
})
|
|
187
187
|
})
|
|
@@ -197,7 +197,7 @@ describe('VRangeSlider', () => {
|
|
|
197
197
|
// https://github.com/vuetifyjs/vuetify/issues/12733
|
|
198
198
|
it('should fill track color', () => {
|
|
199
199
|
const wrapper = mountFunction({
|
|
200
|
-
|
|
200
|
+
props: {
|
|
201
201
|
trackFillColor: 'red',
|
|
202
202
|
},
|
|
203
203
|
})
|
|
@@ -206,7 +206,7 @@ describe('VRangeSlider', () => {
|
|
|
206
206
|
|
|
207
207
|
it('should fill track color with rgba string', () => {
|
|
208
208
|
const wrapper = mountFunction({
|
|
209
|
-
|
|
209
|
+
props: {
|
|
210
210
|
trackFillColor: 'rgba(255, 0, 0, 0.5)',
|
|
211
211
|
},
|
|
212
212
|
})
|
|
@@ -5,17 +5,17 @@ exports[`VRangeSlider should render a vertical slider 1`] = `
|
|
|
5
5
|
<div class="v-input__control">
|
|
6
6
|
<div class="v-input__slot">
|
|
7
7
|
<div class="v-slider v-slider--vertical theme--light">
|
|
8
|
-
<input
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly="readonly"
|
|
8
|
+
<input id="input-25"
|
|
9
|
+
disabled
|
|
10
|
+
readonly
|
|
12
11
|
tabindex="-1"
|
|
12
|
+
value="0,0"
|
|
13
13
|
>
|
|
14
|
-
<input
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
readonly="readonly"
|
|
14
|
+
<input id="input-25"
|
|
15
|
+
disabled
|
|
16
|
+
readonly
|
|
18
17
|
tabindex="-1"
|
|
18
|
+
value="0,0"
|
|
19
19
|
>
|
|
20
20
|
<div class="v-slider__track-container">
|
|
21
21
|
<div class="v-slider__track-background primary lighten-3">
|
|
@@ -25,28 +25,28 @@ exports[`VRangeSlider should render a vertical slider 1`] = `
|
|
|
25
25
|
<div class="v-slider__track-background primary lighten-3">
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
|
-
<div
|
|
28
|
+
<div class="v-slider__thumb-container primary--text"
|
|
29
|
+
style="top: 100%;"
|
|
30
|
+
role="slider"
|
|
29
31
|
tabindex="0"
|
|
30
32
|
aria-valuemin="0"
|
|
31
33
|
aria-valuemax="100"
|
|
32
34
|
aria-valuenow="0,0"
|
|
33
35
|
aria-readonly="false"
|
|
34
36
|
aria-orientation="vertical"
|
|
35
|
-
class="v-slider__thumb-container primary--text"
|
|
36
|
-
style="top: 100%;"
|
|
37
37
|
>
|
|
38
38
|
<div class="v-slider__thumb primary">
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
|
-
<div
|
|
41
|
+
<div class="v-slider__thumb-container primary--text"
|
|
42
|
+
style="top: 100%;"
|
|
43
|
+
role="slider"
|
|
42
44
|
tabindex="0"
|
|
43
45
|
aria-valuemin="0"
|
|
44
46
|
aria-valuemax="100"
|
|
45
47
|
aria-valuenow="0,0"
|
|
46
48
|
aria-readonly="false"
|
|
47
49
|
aria-orientation="vertical"
|
|
48
|
-
class="v-slider__thumb-container primary--text"
|
|
49
|
-
style="top: 100%;"
|
|
50
50
|
>
|
|
51
51
|
<div class="v-slider__thumb primary">
|
|
52
52
|
</div>
|
|
@@ -54,11 +54,8 @@ exports[`VRangeSlider should render a vertical slider 1`] = `
|
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
<div class="v-messages theme--light">
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
class="v-messages__wrapper"
|
|
60
|
-
>
|
|
61
|
-
</span>
|
|
57
|
+
<div class="v-messages__wrapper">
|
|
58
|
+
</div>
|
|
62
59
|
</div>
|
|
63
60
|
</div>
|
|
64
61
|
</div>
|
|
@@ -69,17 +66,17 @@ exports[`VRangeSlider should render disabled slider 1`] = `
|
|
|
69
66
|
<div class="v-input__control">
|
|
70
67
|
<div class="v-input__slot">
|
|
71
68
|
<div class="v-slider v-slider--horizontal v-slider--disabled theme--light">
|
|
72
|
-
<input
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
readonly="readonly"
|
|
69
|
+
<input id="input-29"
|
|
70
|
+
disabled
|
|
71
|
+
readonly
|
|
76
72
|
tabindex="-1"
|
|
73
|
+
value="0,0"
|
|
77
74
|
>
|
|
78
|
-
<input
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
readonly="readonly"
|
|
75
|
+
<input id="input-29"
|
|
76
|
+
disabled
|
|
77
|
+
readonly
|
|
82
78
|
tabindex="-1"
|
|
79
|
+
value="0,0"
|
|
83
80
|
>
|
|
84
81
|
<div class="v-slider__track-container">
|
|
85
82
|
<div class="v-slider__track-background">
|
|
@@ -89,28 +86,28 @@ exports[`VRangeSlider should render disabled slider 1`] = `
|
|
|
89
86
|
<div class="v-slider__track-background">
|
|
90
87
|
</div>
|
|
91
88
|
</div>
|
|
92
|
-
<div
|
|
89
|
+
<div class="v-slider__thumb-container"
|
|
90
|
+
style="left: 0%;"
|
|
91
|
+
role="slider"
|
|
93
92
|
tabindex="-1"
|
|
94
93
|
aria-valuemin="0"
|
|
95
94
|
aria-valuemax="100"
|
|
96
95
|
aria-valuenow="0,0"
|
|
97
96
|
aria-readonly="false"
|
|
98
97
|
aria-orientation="horizontal"
|
|
99
|
-
class="v-slider__thumb-container"
|
|
100
|
-
style="left: 0%;"
|
|
101
98
|
>
|
|
102
99
|
<div class="v-slider__thumb">
|
|
103
100
|
</div>
|
|
104
101
|
</div>
|
|
105
|
-
<div
|
|
102
|
+
<div class="v-slider__thumb-container"
|
|
103
|
+
style="left: 0%;"
|
|
104
|
+
role="slider"
|
|
106
105
|
tabindex="-1"
|
|
107
106
|
aria-valuemin="0"
|
|
108
107
|
aria-valuemax="100"
|
|
109
108
|
aria-valuenow="0,0"
|
|
110
109
|
aria-readonly="false"
|
|
111
110
|
aria-orientation="horizontal"
|
|
112
|
-
class="v-slider__thumb-container"
|
|
113
|
-
style="left: 0%;"
|
|
114
111
|
>
|
|
115
112
|
<div class="v-slider__thumb">
|
|
116
113
|
</div>
|
|
@@ -118,11 +115,8 @@ exports[`VRangeSlider should render disabled slider 1`] = `
|
|
|
118
115
|
</div>
|
|
119
116
|
</div>
|
|
120
117
|
<div class="v-messages theme--light">
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
class="v-messages__wrapper"
|
|
124
|
-
>
|
|
125
|
-
</span>
|
|
118
|
+
<div class="v-messages__wrapper">
|
|
119
|
+
</div>
|
|
126
120
|
</div>
|
|
127
121
|
</div>
|
|
128
122
|
</div>
|
|
@@ -4,12 +4,17 @@ import VSubheader from '../VSubheader'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
MountingOptions,
|
|
9
|
+
enableAutoUnmount,
|
|
8
10
|
} from '@vue/test-utils'
|
|
11
|
+
import { h } from 'vue'
|
|
9
12
|
|
|
10
13
|
describe('VSubheader.ts', () => {
|
|
11
14
|
type Instance = InstanceType<typeof VSubheader>
|
|
12
|
-
let mountFunction: (options?:
|
|
15
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
16
|
+
|
|
17
|
+
enableAutoUnmount(afterEach)
|
|
13
18
|
|
|
14
19
|
beforeEach(() => {
|
|
15
20
|
mountFunction = (options = {}) => {
|
|
@@ -20,8 +25,8 @@ describe('VSubheader.ts', () => {
|
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
it('should have custom class', () => {
|
|
23
|
-
const wrapper = mount({
|
|
24
|
-
|
|
28
|
+
const wrapper = mount(VSubheader, {
|
|
29
|
+
props: { class: 'foo' },
|
|
25
30
|
})
|
|
26
31
|
|
|
27
32
|
expect(wrapper.element.classList.contains('foo')).toBe(true)
|
|
@@ -30,7 +35,7 @@ describe('VSubheader.ts', () => {
|
|
|
30
35
|
|
|
31
36
|
it('should be light', () => {
|
|
32
37
|
const wrapper = mountFunction({
|
|
33
|
-
|
|
38
|
+
props: { light: true },
|
|
34
39
|
})
|
|
35
40
|
|
|
36
41
|
expect(wrapper.element.classList.contains('theme--light')).toBe(true)
|
|
@@ -39,7 +44,7 @@ describe('VSubheader.ts', () => {
|
|
|
39
44
|
|
|
40
45
|
it('should be dark', () => {
|
|
41
46
|
const wrapper = mountFunction({
|
|
42
|
-
|
|
47
|
+
props: { dark: true },
|
|
43
48
|
})
|
|
44
49
|
|
|
45
50
|
expect(wrapper.element.classList.contains('theme--dark')).toBe(true)
|
|
@@ -48,7 +53,7 @@ describe('VSubheader.ts', () => {
|
|
|
48
53
|
|
|
49
54
|
it('should be inset', () => {
|
|
50
55
|
const wrapper = mountFunction({
|
|
51
|
-
|
|
56
|
+
props: { inset: true },
|
|
52
57
|
})
|
|
53
58
|
|
|
54
59
|
expect(wrapper.element.classList.contains('v-subheader--inset')).toBe(true)
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
|
|
4
1
|
// Components
|
|
5
2
|
import VSystemBar from '../VSystemBar'
|
|
6
3
|
|
|
7
4
|
// Utilities
|
|
8
5
|
import {
|
|
9
|
-
createLocalVue,
|
|
10
6
|
mount,
|
|
11
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
MountingOptions,
|
|
9
|
+
enableAutoUnmount,
|
|
12
10
|
} from '@vue/test-utils'
|
|
13
11
|
|
|
14
12
|
describe('VSystemBar.ts', () => {
|
|
15
13
|
type Instance = InstanceType<typeof VSystemBar>
|
|
16
|
-
let mountFunction: (options?:
|
|
14
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
15
|
+
|
|
16
|
+
enableAutoUnmount(afterEach)
|
|
17
17
|
|
|
18
18
|
beforeEach(() => {
|
|
19
19
|
mountFunction = (options = {}) => {
|
|
20
20
|
return mount(VSystemBar, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
global: {
|
|
22
|
+
mocks: {
|
|
23
|
+
$vuetify: {
|
|
24
|
+
application: {
|
|
25
|
+
register: () => {},
|
|
26
|
+
unregister: () => {},
|
|
27
|
+
},
|
|
26
28
|
},
|
|
27
29
|
},
|
|
28
30
|
},
|
|
@@ -31,26 +33,96 @@ describe('VSystemBar.ts', () => {
|
|
|
31
33
|
}
|
|
32
34
|
})
|
|
33
35
|
|
|
34
|
-
it('should return the correct height', () => {
|
|
36
|
+
it('should return the correct height for numeric height', () => {
|
|
35
37
|
const wrapper = mountFunction({
|
|
36
|
-
|
|
38
|
+
props: {
|
|
37
39
|
app: true,
|
|
38
40
|
height: 56,
|
|
39
41
|
},
|
|
40
42
|
})
|
|
41
43
|
|
|
42
44
|
expect(wrapper.vm.computedHeight).toBe(56)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('should return the correct height for string height', () => {
|
|
48
|
+
const wrapper = mountFunction({
|
|
49
|
+
props: {
|
|
50
|
+
app: true,
|
|
51
|
+
height: '48',
|
|
52
|
+
},
|
|
53
|
+
})
|
|
43
54
|
|
|
44
|
-
wrapper.setProps({ height: '48' })
|
|
45
55
|
expect(wrapper.vm.computedHeight).toBe(48)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('should return the correct height for auto height', () => {
|
|
59
|
+
const wrapper = mountFunction({
|
|
60
|
+
props: {
|
|
61
|
+
app: true,
|
|
62
|
+
height: 'auto',
|
|
63
|
+
},
|
|
64
|
+
})
|
|
46
65
|
|
|
47
|
-
wrapper.setProps({ height: 'auto' })
|
|
48
66
|
expect(wrapper.vm.computedHeight).toBe('auto')
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
it('should return default height when height is undefined', () => {
|
|
70
|
+
const wrapper = mountFunction({
|
|
71
|
+
props: {
|
|
72
|
+
app: true,
|
|
73
|
+
height: undefined,
|
|
74
|
+
},
|
|
75
|
+
})
|
|
49
76
|
|
|
50
|
-
wrapper.setProps({ height: undefined })
|
|
51
77
|
expect(wrapper.vm.computedHeight).toBe(24)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('should return window height when window is true', () => {
|
|
81
|
+
const wrapper = mountFunction({
|
|
82
|
+
props: {
|
|
83
|
+
app: true,
|
|
84
|
+
window: true,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
52
87
|
|
|
53
|
-
wrapper.setProps({ window: true })
|
|
54
88
|
expect(wrapper.vm.computedHeight).toBe(32)
|
|
55
89
|
})
|
|
90
|
+
|
|
91
|
+
it('should render with correct classes', () => {
|
|
92
|
+
const wrapper = mountFunction({
|
|
93
|
+
props: {
|
|
94
|
+
app: true,
|
|
95
|
+
lightsOut: true,
|
|
96
|
+
window: true,
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
expect(wrapper.classes()).toContain('v-system-bar--lights-out')
|
|
101
|
+
expect(wrapper.classes()).toContain('v-system-bar--fixed')
|
|
102
|
+
expect(wrapper.classes()).toContain('v-system-bar--window')
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('should render with correct styles', () => {
|
|
106
|
+
const wrapper = mountFunction({
|
|
107
|
+
props: {
|
|
108
|
+
app: true,
|
|
109
|
+
height: 48,
|
|
110
|
+
},
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
expect(wrapper.attributes('style')).toContain('height: 48px')
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
it('should render with slot content', () => {
|
|
117
|
+
const wrapper = mountFunction({
|
|
118
|
+
props: {
|
|
119
|
+
app: true,
|
|
120
|
+
},
|
|
121
|
+
slots: {
|
|
122
|
+
default: 'System Bar Content',
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
expect(wrapper.text()).toBe('System Bar Content')
|
|
127
|
+
})
|
|
56
128
|
})
|