File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ if (_.inBrowser) {
571571 }
572572 } )
573573
574- it ( 'warn duplicate objects' , function ( ) {
574+ it ( 'warn duplicate objects on initial render ' , function ( ) {
575575 var obj = { }
576576 new Vue ( {
577577 el : el ,
@@ -583,6 +583,23 @@ if (_.inBrowser) {
583583 expect ( hasWarned ( _ , 'Duplicate objects' ) ) . toBe ( true )
584584 } )
585585
586+ it ( 'warn duplicate objects on diff' , function ( done ) {
587+ var obj = { }
588+ var vm = new Vue ( {
589+ el : el ,
590+ template : '<div v-repeat="items"></div>' ,
591+ data : {
592+ items : [ obj ]
593+ }
594+ } )
595+ expect ( _ . warn ) . not . toHaveBeenCalled ( )
596+ vm . items . push ( obj )
597+ _ . nextTick ( function ( ) {
598+ expect ( hasWarned ( _ , 'Duplicate objects' ) ) . toBe ( true )
599+ done ( )
600+ } )
601+ } )
602+
586603 it ( 'warn duplicate trackby id' , function ( ) {
587604 new Vue ( {
588605 el : el ,
You can’t perform that action at this time.
0 commit comments