File tree 1 file changed +20
-0
lines changed
test/unit/features/directives
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,26 @@ describe('Directive v-for', () => {
125
125
} )
126
126
127
127
if ( hasSymbol ) {
128
+ it ( 'should render native iterables (Map)' , ( ) => {
129
+ const vm = new Vue ( {
130
+ template : `<div><span v-for="[key, val] in list">{{key}},{{val}}</span></div>` ,
131
+ data : {
132
+ list : new Map ( [ [ 1 , 'foo' ] , [ 2 , 'bar' ] ] )
133
+ }
134
+ } ) . $mount ( )
135
+ expect ( vm . $el . innerHTML ) . toBe ( `<span>1,foo</span><span>2,bar</span>` )
136
+ } )
137
+
138
+ it ( 'should render native iterables (Set)' , ( ) => {
139
+ const vm = new Vue ( {
140
+ template : `<div><span v-for="val in list">{{val}}</span></div>` ,
141
+ data : {
142
+ list : new Set ( [ 1 , 2 , 3 ] )
143
+ }
144
+ } ) . $mount ( )
145
+ expect ( vm . $el . innerHTML ) . toBe ( `<span>1</span><span>2</span><span>3</span>` )
146
+ } )
147
+
128
148
it ( 'should render iterable of primitive values' , done => {
129
149
const iterable = {
130
150
models : [ 'a' , 'b' , 'c' ] ,
You can’t perform that action at this time.
0 commit comments