@@ -202,6 +202,16 @@ describe('compiler: v-for', () => {
202
202
expect ( forNode . valueAlias ) . toBeUndefined ( )
203
203
expect ( ( forNode . source as SimpleExpressionNode ) . content ) . toBe ( 'items' )
204
204
} )
205
+
206
+ test ( 'source containing string expression with spaces' , ( ) => {
207
+ const { node : forNode } = parseWithForTransform (
208
+ `<span v-for="item in state ['my items']" />`
209
+ )
210
+ expect ( forNode . keyAlias ) . toBeUndefined ( )
211
+ expect ( forNode . objectIndexAlias ) . toBeUndefined ( )
212
+ expect ( ( forNode . valueAlias as SimpleExpressionNode ) . content ) . toBe ( 'item' )
213
+ expect ( ( forNode . source as SimpleExpressionNode ) . content ) . toBe ( "state ['my items']" )
214
+ } )
205
215
} )
206
216
207
217
describe ( 'errors' , ( ) => {
@@ -265,16 +275,6 @@ describe('compiler: v-for', () => {
265
275
)
266
276
} )
267
277
268
- test ( 'source containing string expression with spaces' , ( ) => {
269
- const { node : forNode } = parseWithForTransform (
270
- `<span v-for="item in state ['my items']" />`
271
- )
272
- expect ( forNode . keyAlias ) . toBeUndefined ( )
273
- expect ( forNode . objectIndexAlias ) . toBeUndefined ( )
274
- expect ( ( forNode . valueAlias as SimpleExpressionNode ) . content ) . toBe ( 'item' )
275
- expect ( ( forNode . source as SimpleExpressionNode ) . content ) . toBe ( "state ['my items']" )
276
- } )
277
-
278
278
test ( 'missing value' , ( ) => {
279
279
const onError = vi . fn ( )
280
280
parseWithForTransform ( '<span v-for="in items" />' , { onError } )
0 commit comments