File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,8 @@ describe('setData', () => {
218218 it ( 'should retain prototype methods for constructed objects when calling setData' , async ( ) => {
219219 const expectedResult = 'success!'
220220 class TestClass {
221- getResult ( ) {
221+ constructor ( readonly name : string ) { }
222+ getResult ( ) : string {
222223 return expectedResult
223224 }
224225 }
@@ -227,22 +228,22 @@ describe('setData', () => {
227228 defineComponent ( {
228229 template : '<div/>' ,
229230 data ( ) {
230- return { value : new TestClass ( ) }
231+ return { value : new TestClass ( 'test1' ) }
231232 } ,
232233 methods : {
233234 getResult ( ) {
234- return this . value . getResult ( )
235+ return ` ${ this . value . name } : ${ this . value . getResult ( ) } `
235236 }
236237 }
237238 } )
238239 )
239240
240- expect ( wrapper . vm . getResult ( ) ) . toStrictEqual ( expectedResult )
241+ expect ( wrapper . vm . getResult ( ) ) . toStrictEqual ( `test1: ${ expectedResult } ` )
241242
242243 await wrapper . setData ( {
243- value : new TestClass ( )
244+ value : new TestClass ( 'test2' )
244245 } )
245246
246- expect ( wrapper . vm . getResult ( ) ) . toStrictEqual ( expectedResult )
247+ expect ( wrapper . vm . getResult ( ) ) . toStrictEqual ( `test2: ${ expectedResult } ` )
247248 } )
248249} )
You can’t perform that action at this time.
0 commit comments