File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,8 @@ describe('setData', () => {
247
247
expect ( wrapper . vm . getResult ( ) ) . toStrictEqual ( `test2: ${ expectedResult } ` )
248
248
} )
249
249
250
- it ( 'should be possible to replace a primitive value with another' , async ( ) => {
250
+ // https://github.com/vuejs/test-utils/issues/2257
251
+ it ( 'should ignore prototype methods when using setData on objects' , async ( ) => {
251
252
const wrapper = mount (
252
253
defineComponent ( {
253
254
template : '<div />' ,
@@ -261,18 +262,13 @@ describe('setData', () => {
261
262
)
262
263
263
264
await wrapper . setData ( {
264
- firstArray : [ ] ,
265
- secondArray : [ ]
265
+ firstArray : [ 1 , 2 ] ,
266
+ secondArray : [ 3 , 4 ]
266
267
} )
267
268
268
269
expect ( wrapper . vm . $data ) . toStrictEqual ( {
269
- firstArray : [ ] ,
270
- secondArray : [ ]
270
+ firstArray : [ 1 , 2 ] ,
271
+ secondArray : [ 3 , 4 ]
271
272
} )
272
-
273
- expect ( Object . keys ( wrapper . vm . $data ) ) . toStrictEqual ( [
274
- 'firstArray' ,
275
- 'secondArray'
276
- ] )
277
273
} )
278
274
} )
You can’t perform that action at this time.
0 commit comments