@@ -314,7 +314,7 @@ if (_.inBrowser) {
314314 expect ( el . innerHTML ) . toBe ( '<div>AAA</div><div>BBB</div><div>CCC</div><!--v-repeat-->' )
315315 } )
316316
317- it ( 'block repeat' , function ( ) {
317+ it ( 'block repeat' , function ( done ) {
318318 var vm = new Vue ( {
319319 el : el ,
320320 template : '<template v-repeat="list"><p>{{a}}</p><p>{{a + 1}}</p></template>' ,
@@ -326,10 +326,52 @@ if (_.inBrowser) {
326326 ]
327327 }
328328 } )
329- var markup = vm . list . map ( function ( item ) {
330- return '<!--v-start--><p>' + item . a + '</p><p>' + ( item . a + 1 ) + '</p><!--v-end-->'
331- } ) . join ( '' )
332- expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
329+ assertMarkup ( )
330+ vm . list . reverse ( )
331+ _ . nextTick ( function ( ) {
332+ assertMarkup ( )
333+ done ( )
334+ } )
335+
336+ function assertMarkup ( ) {
337+ var markup = vm . list . map ( function ( item ) {
338+ return '<!--v-start--><p>' + item . a + '</p><p>' + ( item . a + 1 ) + '</p><!--v-end-->'
339+ } ) . join ( '' )
340+ expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
341+ }
342+ } )
343+
344+ // added for #799
345+ it ( 'block repeat with diff' , function ( done ) {
346+ var vm = new Vue ( {
347+ el : el ,
348+ template : '<template v-repeat="list" v-component="test"></template>' ,
349+ data : {
350+ list : [
351+ { a : 1 } ,
352+ { a : 2 } ,
353+ { a : 3 }
354+ ]
355+ } ,
356+ components : {
357+ test : {
358+ template : '<p>{{a}}</p><p>{{a + 1}}</p>'
359+ }
360+ }
361+ } )
362+ assertMarkup ( )
363+ vm . list . reverse ( )
364+ _ . nextTick ( function ( ) {
365+ assertMarkup ( )
366+ done ( )
367+ } )
368+
369+ function assertMarkup ( ) {
370+ var markup = vm . list . map ( function ( item ) {
371+ return '<!--v-start--><p>' + item . a + '</p><p>' + ( item . a + 1 ) + '</p><!--v-end-->'
372+ } ) . join ( '' )
373+ expect ( el . innerHTML ) . toBe ( markup + '<!--v-repeat-->' )
374+ }
333375 } )
334376
335377 it ( 'component + parent directive + transclusion' , function ( done ) {
0 commit comments