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) {
571
571
}
572
572
} )
573
573
574
- it ( 'warn duplicate objects' , function ( ) {
574
+ it ( 'warn duplicate objects on initial render ' , function ( ) {
575
575
var obj = { }
576
576
new Vue ( {
577
577
el : el ,
@@ -583,6 +583,23 @@ if (_.inBrowser) {
583
583
expect ( hasWarned ( _ , 'Duplicate objects' ) ) . toBe ( true )
584
584
} )
585
585
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
+
586
603
it ( 'warn duplicate trackby id' , function ( ) {
587
604
new Vue ( {
588
605
el : el ,
You can’t perform that action at this time.
0 commit comments