Skip to content

Commit d22d596

Browse files
committed
test(once): failing test for vuejs#6826
1 parent 9caed00 commit d22d596

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/unit/features/directives/once.spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,28 @@ describe('Directive v-once', () => {
335335
vm.ok = false // teardown component with v-once
336336
}).then(done) // should not throw
337337
})
338+
339+
// #6826
340+
it('should render different component instances properly', done => {
341+
const vm = new Vue({
342+
components: {
343+
foo: {
344+
props: ['name'],
345+
template: '<div v-once>{{ name }}</div>'
346+
}
347+
},
348+
template: `
349+
<div>
350+
<foo name="a" v-once></foo>
351+
<foo name="b" v-once></foo>
352+
</div>
353+
`
354+
}).$mount()
355+
waitForUpdate(() => {
356+
expect(vm.$el.children[0].innerHTML).toBe('a')
357+
expect(vm.$el.children[1].innerHTML).toBe('b')
358+
}).then(done)
359+
})
338360
})
339361

340362
function expectTextContent (vm, text) {

0 commit comments

Comments
 (0)