Skip to content

Commit

Permalink
improve scoped slot test case (#5640)
Browse files Browse the repository at this point in the history
  • Loading branch information
defcc authored and yyx990803 committed May 9, 2017
1 parent e70f191 commit aaad733
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/unit/features/component/component-scoped-slot.spec.js
Expand Up @@ -392,6 +392,9 @@ describe('Component scoped slot', () => {
<template v-for="n in names" :slot="n" scope="props">
<span>{{ props.msg }}</span>
</template>
<template slot="abc" scope="props">
<span>{{ props.msg }}</span>
</template>
</test>
`,
components: {
Expand All @@ -401,16 +404,17 @@ describe('Component scoped slot', () => {
<div>
<slot name="foo" :msg="msg + ' foo'"></slot>
<slot name="bar" :msg="msg + ' bar'"></slot>
<slot name="abc" :msg="msg + ' abc'"></slot>
</div>
`
}
}
}).$mount()

expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span>')
expect(vm.$el.innerHTML).toBe('<span>hello foo</span> <span>hello bar</span> <span>hello abc</span>')
vm.$refs.test.msg = 'world'
waitForUpdate(() => {
expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span>')
expect(vm.$el.innerHTML).toBe('<span>world foo</span> <span>world bar</span> <span>world abc</span>')
}).then(done)
})
})

0 comments on commit aaad733

Please sign in to comment.