File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
- import { compileToFunctions } from 'vue-template-compiler '
1
+ import { Wrapper , WrapperArray } from '~ vue/test-utils '
2
2
import { describeWithShallowAndMount } from '~resources/utils'
3
3
4
4
describeWithShallowAndMount ( 'WrapperArray' , mountingMethod => {
5
5
function getWrapperArray ( wrappers ) {
6
- const compiled = compileToFunctions ( '<div><p>1</p><p>2</p><p>3</p></div>' )
7
- const wrapper = mountingMethod ( compiled )
8
- const wrapperArray = wrapper . findAll ( 'p' )
9
- expect ( wrapperArray . constructor . name ) . to . equal ( 'WrapperArray' )
10
- return wrappers ? new wrapperArray . constructor ( wrappers ) : wrapperArray
6
+ if ( ! wrappers ) {
7
+ wrappers = [ 1 , 2 , 3 ] . map ( ( v ) => {
8
+ const p = document . createElement ( 'p' )
9
+ p . textContent = v
10
+ return new Wrapper ( p )
11
+ } )
12
+ }
13
+ return new WrapperArray ( wrappers )
11
14
}
12
15
13
16
[ 'wrappers' , 'length' ] . forEach ( property => {
@@ -60,10 +63,13 @@ describeWithShallowAndMount('WrapperArray', mountingMethod => {
60
63
'isVueInstance' ,
61
64
'name' ,
62
65
'props' ,
66
+ 'setChecked' ,
63
67
'setComputed' ,
64
68
'setMethods' ,
65
69
'setData' ,
66
70
'setProps' ,
71
+ 'setSelected' ,
72
+ 'setValue' ,
67
73
'trigger' ,
68
74
'update' ,
69
75
'destroy'
@@ -93,10 +99,12 @@ describeWithShallowAndMount('WrapperArray', mountingMethod => {
93
99
'isEmpty' ,
94
100
'isVisible' ,
95
101
'isVueInstance' ,
102
+ 'setChecked' ,
96
103
'setComputed' ,
97
104
'setMethods' ,
98
105
'setData' ,
99
106
'setProps' ,
107
+ 'setValue' ,
100
108
'trigger' ,
101
109
'update' ,
102
110
'destroy'
You can’t perform that action at this time.
0 commit comments