File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 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 '
22import { describeWithShallowAndMount } from '~resources/utils'
33
44describeWithShallowAndMount ( 'WrapperArray' , mountingMethod => {
55 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 )
1114 }
1215
1316 [ 'wrappers' , 'length' ] . forEach ( property => {
@@ -60,10 +63,13 @@ describeWithShallowAndMount('WrapperArray', mountingMethod => {
6063 'isVueInstance' ,
6164 'name' ,
6265 'props' ,
66+ 'setChecked' ,
6367 'setComputed' ,
6468 'setMethods' ,
6569 'setData' ,
6670 'setProps' ,
71+ 'setSelected' ,
72+ 'setValue' ,
6773 'trigger' ,
6874 'update' ,
6975 'destroy'
@@ -93,10 +99,12 @@ describeWithShallowAndMount('WrapperArray', mountingMethod => {
9399 'isEmpty' ,
94100 'isVisible' ,
95101 'isVueInstance' ,
102+ 'setChecked' ,
96103 'setComputed' ,
97104 'setMethods' ,
98105 'setData' ,
99106 'setProps' ,
107+ 'setValue' ,
100108 'trigger' ,
101109 'update' ,
102110 'destroy'
You can’t perform that action at this time.
0 commit comments