Skip to content

Commit

Permalink
fix: add test for fix#11483
Browse files Browse the repository at this point in the history
fix#11483
  • Loading branch information
shadowings-zy committed Jul 3, 2020
1 parent 0288b5b commit 74c2005
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/unit/features/component/component.spec.js
Expand Up @@ -426,4 +426,18 @@ describe('Component', () => {
vm.$destroy()
}).then(done)
})

it('render vnode with <script> tag as root element', () => {
const vm = new Vue({
template: '<scriptTest></scriptTest>',
components: {
scriptTest: {
template: '<script>console.log(1)</script>'
}
}
}).$mount()
expect(vm.$el.tagName).toBe('SCRIPT')
expect(vm.$el.innerHTML).toBe('')
expect('Templates should only be responsible for mapping the state').toHaveBeenWarned()
})
})

0 comments on commit 74c2005

Please sign in to comment.