diff --git a/test/unit/specs/directives/public/for/for_spec.js b/test/unit/specs/directives/public/for/for_spec.js index c77f636dc..cbc963495 100644 --- a/test/unit/specs/directives/public/for/for_spec.js +++ b/test/unit/specs/directives/public/for/for_spec.js @@ -595,6 +595,39 @@ if (_.inBrowser) { expect(hasWarned(_, 'Duplicate value')).toBe(true) }) + it('key val syntax with object', function () { + new Vue({ + el: el, + template: '
{{key}} {{val}}
', + data: { + items: {'a': 'x'} + } + }) + expect(el.innerHTML).toBe('
a x
') + }) + + it('key val syntax with array', function () { + new Vue({ + el: el, + template: '
{{ind}} {{val}}
', + data: { + items: ['x', 'y'] + } + }) + expect(el.innerHTML).toBe('
0 x
1 y
') + }) + + it('key val syntax with nested v-for s', function () { + new Vue({ + el: el, + template: '
{{key}} {{subkey}} {{subval}}
', + data: { + items: {'a': {'b': 'c'}} + } + }) + expect(el.innerHTML).toBe('
a b c
') + }) + it('repeat number', function () { new Vue({ el: el,