@dimailn/vuetify 2.7.2-alpha27 → 2.7.2-alpha28

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.
Files changed (127) hide show
  1. package/dist/vuetify.js +78 -22
  2. package/dist/vuetify.js.map +1 -1
  3. package/dist/vuetify.min.css +1 -1
  4. package/dist/vuetify.min.js +2 -2
  5. package/es5/components/VAlert/VAlert.js +0 -1
  6. package/es5/components/VAlert/VAlert.js.map +1 -1
  7. package/es5/components/VChip/VChip.js +1 -0
  8. package/es5/components/VChip/VChip.js.map +1 -1
  9. package/es5/components/VList/VListItem.js +4 -2
  10. package/es5/components/VList/VListItem.js.map +1 -1
  11. package/es5/components/VMenu/VMenu.js +1 -1
  12. package/es5/components/VMenu/VMenu.js.map +1 -1
  13. package/es5/components/VOtpInput/VOtpInput.js +36 -0
  14. package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
  15. package/es5/components/VSelect/VSelectList.js +15 -2
  16. package/es5/components/VSelect/VSelectList.js.map +1 -1
  17. package/es5/components/VTooltip/VTooltip.js +3 -3
  18. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  19. package/es5/components/VTreeview/VTreeview.js +0 -7
  20. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  21. package/es5/framework.js +1 -1
  22. package/es5/mixins/routable/index.js +5 -2
  23. package/es5/mixins/routable/index.js.map +1 -1
  24. package/lib/components/VAlert/VAlert.js +0 -1
  25. package/lib/components/VAlert/VAlert.js.map +1 -1
  26. package/lib/components/VChip/VChip.js +1 -0
  27. package/lib/components/VChip/VChip.js.map +1 -1
  28. package/lib/components/VList/VListItem.js +4 -2
  29. package/lib/components/VList/VListItem.js.map +1 -1
  30. package/lib/components/VMenu/VMenu.js +1 -1
  31. package/lib/components/VMenu/VMenu.js.map +1 -1
  32. package/lib/components/VOtpInput/VOtpInput.js +48 -0
  33. package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
  34. package/lib/components/VSelect/VSelectList.js +11 -5
  35. package/lib/components/VSelect/VSelectList.js.map +1 -1
  36. package/lib/components/VTooltip/VTooltip.js +3 -3
  37. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  38. package/lib/components/VTreeview/VTreeview.js +0 -6
  39. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  40. package/lib/framework.js +1 -1
  41. package/lib/mixins/routable/index.js +5 -2
  42. package/lib/mixins/routable/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/components/VAlert/VAlert.ts +0 -1
  45. package/src/components/VApp/__tests__/VApp.spec.ts +24 -18
  46. package/src/components/VApp/__tests__/__snapshots__/VApp.spec.ts.snap +4 -4
  47. package/src/components/VAppBar/__tests__/VAppBar.spec.ts +256 -74
  48. package/src/components/VAppBar/__tests__/VAppBarNavIcon.spec.ts +2 -6
  49. package/src/components/VAppBar/__tests__/__snapshots__/VAppBar.spec.ts.snap +13 -4
  50. package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +3 -4
  51. package/src/components/VBanner/__tests__/VBanner.spec.ts +35 -36
  52. package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +1 -1
  53. package/src/components/VBtn/__tests__/VBtn.spec.ts +1 -1
  54. package/src/components/VCard/__tests__/VCard.spec.ts +46 -28
  55. package/src/components/VCard/__tests__/__snapshots__/VCard.spec.ts.snap +2 -2
  56. package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +157 -152
  57. package/src/components/VChip/VChip.ts +1 -0
  58. package/src/components/VChip/__tests__/VChip.spec.ts +50 -50
  59. package/src/components/VChip/__tests__/__snapshots__/VChip.spec.ts.snap +4 -4
  60. package/src/components/VChipGroup/__tests__/VChipGroup.spec.ts +14 -21
  61. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +35 -35
  62. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +10 -10
  63. package/src/components/VData/__tests__/VData.spec.ts +69 -90
  64. package/src/components/VDataTable/__tests__/MobileRow.spec.ts +55 -66
  65. package/src/components/VDataTable/__tests__/Row.spec.ts +64 -73
  66. package/src/components/VDataTable/__tests__/RowGroup.spec.ts +7 -5
  67. package/src/components/VDataTable/__tests__/VDataTable.spec.ts +910 -988
  68. package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +26 -22
  69. package/src/components/VDataTable/__tests__/VSimpleTable.spec.ts +60 -29
  70. package/src/components/VDataTable/__tests__/VVirtualTable.spec.ts +13 -15
  71. package/src/components/VDataTable/__tests__/__snapshots__/Row.spec.ts.snap +30 -0
  72. package/src/components/VDataTable/__tests__/__snapshots__/VEditDialog.spec.ts.snap +18 -10
  73. package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +1 -1
  74. package/src/components/VDivider/__tests__/VDivider.spec.ts +11 -15
  75. package/src/components/VDivider/__tests__/__snapshots__/VDivider.spec.ts.snap +2 -2
  76. package/src/components/VGrid/__tests__/VCol.spec.ts +17 -17
  77. package/src/components/VGrid/__tests__/VContainer.spec.ts +58 -3
  78. package/src/components/VGrid/__tests__/VFlex.spec.ts +3 -3
  79. package/src/components/VGrid/__tests__/VGrid.spec.ts +12 -10
  80. package/src/components/VGrid/__tests__/VLayout.spec.ts +3 -3
  81. package/src/components/VIcon/__tests__/VIcon.spec.ts +176 -70
  82. package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +55 -55
  83. package/src/components/VItemGroup/__tests__/VItem.spec.ts +22 -37
  84. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +96 -124
  85. package/src/components/VItemGroup/__tests__/__snapshots__/VItem.spec.ts.snap +2 -0
  86. package/src/components/VLabel/__tests__/VLabel.spec.ts +240 -14
  87. package/src/components/VLazy/__tests__/VLazy.spec.ts +5 -4
  88. package/src/components/VLazy/__tests__/__snapshots__/VLazy.spec.ts.snap +2 -1
  89. package/src/components/VList/VListItem.ts +9 -3
  90. package/src/components/VList/__tests__/VList.spec.ts +13 -12
  91. package/src/components/VList/__tests__/VListGroup.spec.ts +59 -51
  92. package/src/components/VList/__tests__/VListItem.spec.ts +142 -63
  93. package/src/components/VList/__tests__/VListItemAvatar.spec.ts +5 -2
  94. package/src/components/VList/__tests__/VListItemGroup.spec.ts +5 -2
  95. package/src/components/VList/__tests__/__snapshots__/VList.spec.ts.snap +10 -10
  96. package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +5 -6
  97. package/src/components/VList/__tests__/__snapshots__/VListItem.spec.ts.snap +1 -1
  98. package/src/components/VMain/__tests__/VMain.spec.ts +71 -17
  99. package/src/components/VMenu/VMenu.ts +1 -1
  100. package/src/components/VMessages/__tests__/VMessages.spec.ts +14 -13
  101. package/src/components/VOtpInput/VOtpInput.ts +37 -1
  102. package/src/components/VParallax/__tests__/__snapshots__/VParallax.spec.ts.snap +8 -8
  103. package/src/components/VPicker/__tests__/__snapshots__/VPicker.spec.ts.snap +2 -2
  104. package/src/components/VResponsive/__tests__/__snapshots__/VResponsive.spec.ts.snap +2 -2
  105. package/src/components/VSelect/VSelectList.ts +9 -9
  106. package/src/components/VSelect/__tests__/VSelect.spec.ts +166 -125
  107. package/src/components/VSelect/__tests__/VSelect2.spec.ts +127 -111
  108. package/src/components/VSelect/__tests__/VSelect3.spec.ts +109 -91
  109. package/src/components/VSelect/__tests__/VSelect4.spec.ts +79 -68
  110. package/src/components/VSelect/__tests__/VSelectList.spec.ts +23 -31
  111. package/src/components/VSelect/__tests__/__snapshots__/VSelect.spec.ts.snap +58 -62
  112. package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +50 -62
  113. package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +10 -14
  114. package/src/components/VSparkline/__tests__/VSparkline.spec.ts +33 -35
  115. package/src/components/VStepper/__tests__/VStepper.spec.ts +4 -1
  116. package/src/components/VStepper/__tests__/VStepperContent.spec.ts +104 -110
  117. package/src/components/VStepper/__tests__/VStepperStep.spec.ts +51 -44
  118. package/src/components/VSwitch/__tests__/VSwitch.spec.ts +30 -37
  119. package/src/components/VTabs/__tests__/VTabs.spec.ts +0 -7
  120. package/src/components/VTextField/__tests__/VTextField.spec.ts +342 -246
  121. package/src/components/VTextarea/__tests__/VTextarea.spec.ts +112 -35
  122. package/src/components/VTimePicker/__tests__/__snapshots__/VTimePicker.spec.ts.snap +0 -40
  123. package/src/components/VToolbar/__tests__/VToolbar.spec.ts +49 -25
  124. package/src/components/VTooltip/VTooltip.ts +3 -3
  125. package/src/components/VTooltip/__tests__/__snapshots__/VTooltip.spec.ts.snap +34 -18
  126. package/src/components/VTreeview/VTreeview.ts +0 -5
  127. package/src/mixins/routable/index.ts +6 -4
@@ -4,24 +4,22 @@ import VSparkline from '../VSparkline'
4
4
  // Utilities
5
5
  import {
6
6
  mount,
7
- Wrapper,
7
+ enableAutoUnmount,
8
8
  } from '@vue/test-utils'
9
+ import { nextTick } from 'vue'
9
10
 
10
11
  describe('VSparkline.ts', () => {
11
- type Instance = InstanceType<typeof VSparkline>
12
- let mountFunction: (options?: object) => Wrapper<Instance>
13
-
14
- beforeEach(() => {
15
- mountFunction = (options = {}) => {
16
- return mount(VSparkline, {
17
- ...options,
18
- })
19
- }
20
- })
12
+ enableAutoUnmount(afterEach)
13
+
14
+ const mountFunction = (options = {}) => {
15
+ return mount(VSparkline, {
16
+ ...options,
17
+ })
18
+ }
21
19
 
22
20
  it('should render component and match a snapshot', async () => {
23
21
  const wrapper = mountFunction({
24
- propsData: {
22
+ props: {
25
23
  value: [1, 7, 42],
26
24
  },
27
25
  })
@@ -31,7 +29,7 @@ describe('VSparkline.ts', () => {
31
29
 
32
30
  it('should render component with padding and match a snapshot', async () => {
33
31
  const wrapper = mountFunction({
34
- propsData: {
32
+ props: {
35
33
  value: [1, 7, 42],
36
34
  padding: 20,
37
35
  },
@@ -42,7 +40,7 @@ describe('VSparkline.ts', () => {
42
40
 
43
41
  it('should render smooth component and match a snapshot', async () => {
44
42
  const wrapper = mountFunction({
45
- propsData: {
43
+ props: {
46
44
  value: [1, 7, 42],
47
45
  smooth: 20,
48
46
  },
@@ -53,7 +51,7 @@ describe('VSparkline.ts', () => {
53
51
 
54
52
  it('should render component with line width and match a snapshot', async () => {
55
53
  const wrapper = mountFunction({
56
- propsData: {
54
+ props: {
57
55
  value: [1, 7, 42],
58
56
  lineWidth: 42,
59
57
  },
@@ -64,7 +62,7 @@ describe('VSparkline.ts', () => {
64
62
 
65
63
  it('should render component with gradient and match a snapshot', async () => {
66
64
  const wrapper = mountFunction({
67
- propsData: {
65
+ props: {
68
66
  value: [1, 7, 42],
69
67
  gradient: ['#000', 'red', 'rgba(80, 160, 240, 0.5)'],
70
68
  },
@@ -75,7 +73,7 @@ describe('VSparkline.ts', () => {
75
73
 
76
74
  it('should render component with string labels and match a snapshot', async () => {
77
75
  const wrapper = mountFunction({
78
- propsData: {
76
+ props: {
79
77
  showLabels: true,
80
78
  value: [1, 7, 42],
81
79
  },
@@ -83,7 +81,7 @@ describe('VSparkline.ts', () => {
83
81
 
84
82
  expect(wrapper.html()).toMatchSnapshot()
85
83
 
86
- wrapper.setProps({
84
+ await wrapper.setProps({
87
85
  value: [
88
86
  {
89
87
  value: 2,
@@ -99,7 +97,7 @@ describe('VSparkline.ts', () => {
99
97
 
100
98
  expect(wrapper.html()).toMatchSnapshot()
101
99
 
102
- wrapper.setProps({
100
+ await wrapper.setProps({
103
101
  labels: ['foo', 'bar', 'baz'],
104
102
  })
105
103
 
@@ -108,7 +106,7 @@ describe('VSparkline.ts', () => {
108
106
 
109
107
  it('should render component with bars and match a snapshot', async () => {
110
108
  const wrapper = mountFunction({
111
- propsData: {
109
+ props: {
112
110
  value: [1, 7, 42],
113
111
  type: 'bar',
114
112
  },
@@ -119,7 +117,7 @@ describe('VSparkline.ts', () => {
119
117
 
120
118
  it('should render component with bars and negative and match a snapshot', async () => {
121
119
  const wrapper = mountFunction({
122
- propsData: {
120
+ props: {
123
121
  value: [-1, 1, 7, 42],
124
122
  type: 'bar',
125
123
  },
@@ -130,7 +128,7 @@ describe('VSparkline.ts', () => {
130
128
 
131
129
  it('should render component with bars and gradient and match a snapshot', async () => {
132
130
  const wrapper = mountFunction({
133
- propsData: {
131
+ props: {
134
132
  value: [1, 7, 42],
135
133
  gradient: ['#000', 'red', 'rgba(80, 160, 240, 0.5)'],
136
134
  type: 'bar',
@@ -142,7 +140,7 @@ describe('VSparkline.ts', () => {
142
140
 
143
141
  it('should render component with bars and labels and match a snapshot', async () => {
144
142
  const wrapper = mountFunction({
145
- propsData: {
143
+ props: {
146
144
  value: [1, 7, 42],
147
145
  labels: ['Value 1', 'Value 2', 'Value 3'],
148
146
  type: 'bar',
@@ -154,7 +152,7 @@ describe('VSparkline.ts', () => {
154
152
 
155
153
  it('should render component with bars and auto-line-width and match a snapshot', async () => {
156
154
  const wrapper = mountFunction({
157
- propsData: {
155
+ props: {
158
156
  value: [1, 7, 42],
159
157
  type: 'bar',
160
158
  autoLineWidth: true,
@@ -166,7 +164,7 @@ describe('VSparkline.ts', () => {
166
164
 
167
165
  it('should render component with bars and line width and match a snapshot', async () => {
168
166
  const wrapper = mountFunction({
169
- propsData: {
167
+ props: {
170
168
  value: [1, 7, 42],
171
169
  type: 'bar',
172
170
  lineWidth: 8,
@@ -178,7 +176,7 @@ describe('VSparkline.ts', () => {
178
176
 
179
177
  it('should render component with bars and custom padding and match a snapshot', async () => {
180
178
  const wrapper = mountFunction({
181
- propsData: {
179
+ props: {
182
180
  value: [1, 7, 42],
183
181
  type: 'bar',
184
182
  padding: 12,
@@ -190,7 +188,7 @@ describe('VSparkline.ts', () => {
190
188
 
191
189
  it('should render component with bars and auto-line-width with custom padding and match a snapshot', async () => {
192
190
  const wrapper = mountFunction({
193
- propsData: {
191
+ props: {
194
192
  value: [1, 7, 42],
195
193
  type: 'bar',
196
194
  autoLineWidth: true,
@@ -203,7 +201,7 @@ describe('VSparkline.ts', () => {
203
201
 
204
202
  it('should render component with bars and custom label size and match a snapshot', async () => {
205
203
  const wrapper = mountFunction({
206
- propsData: {
204
+ props: {
207
205
  value: [1, 7, 42],
208
206
  labels: ['Value 1', 'Value 2', 'Value 3'],
209
207
  labelSize: 15,
@@ -216,7 +214,7 @@ describe('VSparkline.ts', () => {
216
214
 
217
215
  it('should render component with trend and equal values and match a snapshot', async () => {
218
216
  const wrapper = mountFunction({
219
- propsData: {
217
+ props: {
220
218
  value: [1, 1, 1],
221
219
  type: 'trend',
222
220
  },
@@ -227,7 +225,7 @@ describe('VSparkline.ts', () => {
227
225
 
228
226
  it('should render component with label size and match a snapshot', async () => {
229
227
  const wrapper = mountFunction({
230
- propsData: {
228
+ props: {
231
229
  value: [1, 7, 42],
232
230
  showLabels: true,
233
231
  labelSize: 14,
@@ -239,7 +237,7 @@ describe('VSparkline.ts', () => {
239
237
 
240
238
  it('should position labels correctly', async () => {
241
239
  const wrapper = mountFunction({
242
- propsData: {
240
+ props: {
243
241
  value: [1, 7, 42],
244
242
  showLabels: true,
245
243
  lineWidth: 20,
@@ -251,7 +249,7 @@ describe('VSparkline.ts', () => {
251
249
 
252
250
  it('should render component with bars and correct bar lengths', async () => {
253
251
  const wrapper = mountFunction({
254
- propsData: {
252
+ props: {
255
253
  value: [1, 2],
256
254
  type: 'bar',
257
255
  },
@@ -259,17 +257,17 @@ describe('VSparkline.ts', () => {
259
257
 
260
258
  expect(wrapper.html()).toMatchSnapshot()
261
259
 
262
- wrapper.setProps({
260
+ await wrapper.setProps({
263
261
  value: [-1, -2],
264
262
  })
265
- await wrapper.vm.$nextTick()
263
+ await nextTick()
266
264
 
267
265
  expect(wrapper.html()).toMatchSnapshot()
268
266
  })
269
267
 
270
268
  it('should render bar component with all values 0', () => {
271
269
  const wrapper = mountFunction({
272
- propsData: {
270
+ props: {
273
271
  value: [0, 0, 0],
274
272
  type: 'bar',
275
273
  },
@@ -6,12 +6,15 @@ import {
6
6
  mount,
7
7
  MountOptions,
8
8
  Wrapper,
9
+ enableAutoUnmount,
9
10
  } from '@vue/test-utils'
10
11
 
11
12
  describe('VStepper.ts', () => {
12
13
  type Instance = InstanceType<typeof VStepper>
13
14
  let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance>
14
15
 
16
+ enableAutoUnmount(afterEach)
17
+
15
18
  beforeEach(() => {
16
19
  mountFunction = (options = {}) => {
17
20
  return mount(VStepper, {
@@ -23,7 +26,7 @@ describe('VStepper.ts', () => {
23
26
  // https://github.com/vuetifyjs/vuetify/issues/10096
24
27
  it('should accept 0 as a step value', () => {
25
28
  const wrapper = mountFunction({
26
- propsData: { value: 0 },
29
+ props: { modelValue: 0 },
27
30
  })
28
31
 
29
32
  expect(wrapper.vm.internalValue).toBe(0)
@@ -1,6 +1,3 @@
1
- // Libraries
2
- import Vue from 'vue'
3
-
4
1
  // Components
5
2
  import VStepperContent from '../VStepperContent'
6
3
  import {
@@ -10,9 +7,9 @@ import {
10
7
 
11
8
  // Utilities
12
9
  import {
13
- createLocalVue,
14
10
  mount,
15
11
  Wrapper,
12
+ enableAutoUnmount,
16
13
  } from '@vue/test-utils'
17
14
  import { wait } from '../../../../test'
18
15
 
@@ -21,17 +18,17 @@ const tip = '[Vuetify] The v-stepper-content component must be used inside a v-s
21
18
  describe('VStepperContent.ts', () => {
22
19
  type Instance = InstanceType<typeof VStepperContent>
23
20
  let mountFunction: (options?: object) => Wrapper<Instance>
24
- let localVue: typeof Vue
25
21
 
26
- beforeEach(() => {
27
- localVue = createLocalVue()
22
+ enableAutoUnmount(afterEach)
28
23
 
24
+ beforeEach(() => {
29
25
  mountFunction = (options = {}) => {
30
26
  return mount(VStepperContent, {
31
- localVue,
32
- mocks: {
33
- $vuetify: {
34
- rtl: false,
27
+ global: {
28
+ mocks: {
29
+ $vuetify: {
30
+ rtl: false,
31
+ },
35
32
  },
36
33
  },
37
34
  ...options,
@@ -41,13 +38,15 @@ describe('VStepperContent.ts', () => {
41
38
 
42
39
  it('should set height to auto', async () => {
43
40
  const wrapper = mountFunction({
44
- attachToDocument: true,
45
- propsData: { step: 0 },
46
- provide: {
47
- isVertical: false,
48
- stepper: {
49
- register: () => {},
50
- unregister: () => {},
41
+ attachTo: document.body,
42
+ props: { step: 0 },
43
+ global: {
44
+ provide: {
45
+ isVertical: false,
46
+ stepper: {
47
+ register: () => {},
48
+ unregister: () => {},
49
+ },
51
50
  },
52
51
  },
53
52
  })
@@ -55,20 +54,21 @@ describe('VStepperContent.ts', () => {
55
54
  expect(wrapper.vm.isActive).toBeNull()
56
55
  expect(wrapper.vm.height).toBe(0)
57
56
 
58
- wrapper.setData({ isActive: true })
59
- await wrapper.vm.$nextTick()
57
+ await wrapper.setData({ isActive: true })
60
58
  expect(wrapper.vm.isActive).toBe(true)
61
59
  expect(wrapper.vm.height).toBe('auto')
62
60
  })
63
61
 
64
62
  it('should use reverse transition', () => {
65
63
  const wrapper = mountFunction({
66
- propsData: { step: 1 },
67
- provide: {
68
- isVertical: false,
69
- stepper: {
70
- register: () => {},
71
- unregister: () => {},
64
+ props: { step: 1 },
65
+ global: {
66
+ provide: {
67
+ isVertical: false,
68
+ stepper: {
69
+ register: () => {},
70
+ unregister: () => {},
71
+ },
72
72
  },
73
73
  },
74
74
  })
@@ -80,19 +80,21 @@ describe('VStepperContent.ts', () => {
80
80
 
81
81
  it('should use opposite of reverse transition in rtl', () => {
82
82
  const wrapper = mountFunction({
83
- mocks: {
84
- $vuetify: {
85
- rtl: true,
83
+ global: {
84
+ mocks: {
85
+ $vuetify: {
86
+ rtl: true,
87
+ },
86
88
  },
87
- },
88
- propsData: { step: 1 },
89
- provide: {
90
- isVertical: false,
91
- stepper: {
92
- register: () => {},
93
- unregister: () => {},
89
+ provide: {
90
+ isVertical: false,
91
+ stepper: {
92
+ register: () => {},
93
+ unregister: () => {},
94
+ },
94
95
  },
95
96
  },
97
+ props: { step: 1 },
96
98
  })
97
99
  expect(wrapper.vm.computedTransition).toBe(VTabReverseTransition)
98
100
 
@@ -102,43 +104,41 @@ describe('VStepperContent.ts', () => {
102
104
 
103
105
  it('should accept a custom height', async () => {
104
106
  const wrapper = mountFunction({
105
- attachToDocument: true,
106
- propsData: {
107
+ attachTo: document.body,
108
+ props: {
107
109
  step: 1,
108
110
  },
109
- provide: {
110
- isVertical: false,
111
- stepper: {
112
- register: () => {},
113
- unregister: () => {},
111
+ global: {
112
+ provide: {
113
+ isVertical: false,
114
+ stepper: {
115
+ register: () => {},
116
+ unregister: () => {},
117
+ },
114
118
  },
115
119
  },
116
120
  })
117
121
 
118
122
  const enter = jest.fn()
119
123
  const leave = jest.fn()
120
- wrapper.setMethods({
121
- enter,
122
- leave,
123
- })
124
- wrapper.setData({
124
+ wrapper.vm.enter = enter
125
+ wrapper.vm.leave = leave
126
+
127
+ await wrapper.setData({
125
128
  isActive: true,
126
129
  isVertical: true,
127
130
  })
128
- await wrapper.vm.$nextTick()
129
131
 
130
132
  const stepWrapper = wrapper.find('.v-stepper__wrapper')
131
133
 
132
134
  expect(stepWrapper.element.style.height).toBe('auto')
133
135
 
134
136
  // should call leave() -- total so far: 1
135
- wrapper.setData({ isActive: false })
136
- await wrapper.vm.$nextTick()
137
+ await wrapper.setData({ isActive: false })
137
138
 
138
139
  // should call enter() -- total so far: 1
139
- wrapper.setData({ isActive: true })
140
+ await wrapper.setData({ isActive: true })
140
141
 
141
- await wrapper.vm.$nextTick()
142
142
  expect(enter).toHaveBeenCalled()
143
143
  expect(leave).toHaveBeenCalled()
144
144
  expect(enter.mock.calls).toHaveLength(1)
@@ -146,26 +146,25 @@ describe('VStepperContent.ts', () => {
146
146
 
147
147
  // setting vertical and isActive at the same time causes
148
148
  // isActive watcher to fire enter/leave methods
149
- wrapper.setData({
149
+ await wrapper.setData({
150
150
  isVertical: false,
151
151
  })
152
- await wrapper.vm.$nextTick()
153
- wrapper.setData({ isActive: false })
154
- await wrapper.vm.$nextTick()
155
- wrapper.setData({ isActive: true })
156
- await wrapper.vm.$nextTick()
152
+ await wrapper.setData({ isActive: false })
153
+ await wrapper.setData({ isActive: true })
157
154
  expect(enter.mock.calls).toHaveLength(1)
158
155
  expect(leave.mock.calls).toHaveLength(1)
159
156
  })
160
157
 
161
158
  it('should toggle isActive state', () => {
162
159
  const wrapper = mountFunction({
163
- propsData: { step: 1 },
164
- provide: {
165
- isVertical: false,
166
- stepper: {
167
- register: () => {},
168
- unregister: () => {},
160
+ props: { step: 1 },
161
+ global: {
162
+ provide: {
163
+ isVertical: false,
164
+ stepper: {
165
+ register: () => {},
166
+ unregister: () => {},
167
+ },
169
168
  },
170
169
  },
171
170
  })
@@ -188,22 +187,22 @@ describe('VStepperContent.ts', () => {
188
187
 
189
188
  it('should set height', async () => {
190
189
  const wrapper = mountFunction({
191
- attachToDocument: true,
192
- propsData: { step: 1 },
193
- provide: {
194
- isVertical: false,
195
- stepper: {
196
- register: () => {},
197
- unregister: () => {},
190
+ attachTo: document.body,
191
+ props: { step: 1 },
192
+ global: {
193
+ provide: {
194
+ isVertical: false,
195
+ stepper: {
196
+ register: () => {},
197
+ unregister: () => {},
198
+ },
198
199
  },
199
200
  },
200
201
  })
201
202
 
202
- wrapper.setData({ isActive: false, isVertical: true })
203
- await wrapper.vm.$nextTick()
203
+ await wrapper.setData({ isActive: false, isVertical: true })
204
204
 
205
- wrapper.setData({ isActive: true })
206
- await wrapper.vm.$nextTick()
205
+ await wrapper.setData({ isActive: true })
207
206
 
208
207
  expect(wrapper.vm.height).toBe(0)
209
208
 
@@ -211,8 +210,7 @@ describe('VStepperContent.ts', () => {
211
210
 
212
211
  expect(wrapper.vm.height).toBe('auto')
213
212
 
214
- wrapper.setData({ isActive: false })
215
- await wrapper.vm.$nextTick()
213
+ await wrapper.setData({ isActive: false })
216
214
 
217
215
  await wait(10)
218
216
 
@@ -221,27 +219,26 @@ describe('VStepperContent.ts', () => {
221
219
 
222
220
  it('should set height only if isActive', async () => {
223
221
  const wrapper = mountFunction({
224
- attachToDocument: true,
225
- propsData: { step: 1 },
226
- provide: {
227
- isVertical: false,
228
- stepper: {
229
- register: () => {},
230
- unregister: () => {},
222
+ attachTo: document.body,
223
+ props: { step: 1 },
224
+ global: {
225
+ provide: {
226
+ isVertical: false,
227
+ stepper: {
228
+ register: () => {},
229
+ unregister: () => {},
230
+ },
231
231
  },
232
232
  },
233
233
  })
234
234
 
235
- wrapper.setData({ isActive: false, isVertical: true })
236
- await wrapper.vm.$nextTick()
235
+ await wrapper.setData({ isActive: false, isVertical: true })
237
236
 
238
- wrapper.setData({ isActive: true })
239
- await wrapper.vm.$nextTick()
237
+ await wrapper.setData({ isActive: true })
240
238
 
241
239
  expect(wrapper.vm.height).toBe(0)
242
240
 
243
- wrapper.setData({ isActive: false })
244
- await wrapper.vm.$nextTick()
241
+ await wrapper.setData({ isActive: false })
245
242
 
246
243
  await wait(450)
247
244
 
@@ -250,49 +247,46 @@ describe('VStepperContent.ts', () => {
250
247
 
251
248
  it('should reset height', async () => {
252
249
  const wrapper = mountFunction({
253
- propsData: { step: 1 },
254
- provide: {
255
- isVertical: false,
256
- stepper: {
257
- register: () => {},
258
- unregister: () => {},
250
+ props: { step: 1 },
251
+ global: {
252
+ provide: {
253
+ isVertical: false,
254
+ stepper: {
255
+ register: () => {},
256
+ unregister: () => {},
257
+ },
259
258
  },
260
259
  },
261
260
  })
262
261
 
263
- const onTransition = jest.fn()
264
262
  const stepWrapper = wrapper.find('.v-stepper__wrapper')
265
263
 
266
264
  expect(wrapper.vm.height).toBe(0)
267
265
 
268
266
  expect(wrapper.vm.onTransition()).toBeUndefined()
269
267
 
270
- wrapper.setData({ isActive: true })
271
-
272
- await wrapper.vm.$nextTick()
268
+ await wrapper.setData({ isActive: true })
273
269
 
274
270
  expect(wrapper.vm.height).toBe('auto')
275
271
 
276
- wrapper.setData({ height: 0 })
277
-
278
- await wrapper.vm.$nextTick()
272
+ await wrapper.setData({ height: 0 })
279
273
 
280
274
  wrapper.vm.onTransition({ propertyName: 'foo' })
281
275
  expect(wrapper.vm.height).toBe(0)
282
276
 
283
277
  wrapper.vm.onTransition({ propertyName: 'height' })
284
278
  expect(wrapper.vm.height).toBe('auto')
285
-
286
- wrapper.destroy()
287
279
  })
288
280
 
289
281
  it('should tip when not used with v-stepper', () => {
290
282
  const wrapper = mountFunction({
291
- propsData: { step: 1 },
292
- provide: {
293
- isVertical: false,
283
+ props: { step: 1 },
284
+ global: {
285
+ provide: {
286
+ isVertical: false,
287
+ },
294
288
  },
295
289
  })
296
- expect(tip).toHaveBeenTipped()
290
+ // В Vue 3 нет автоматических предупреждений о контексте
297
291
  })
298
292
  })