Skip to content

Commit 74c2005

Browse files
committedJul 3, 2020
fix: add test for fix#11483
fix#11483
1 parent 0288b5b commit 74c2005

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

Diff for: ‎test/unit/features/component/component.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,18 @@ describe('Component', () => {
426426
vm.$destroy()
427427
}).then(done)
428428
})
429+
430+
it('render vnode with <script> tag as root element', () => {
431+
const vm = new Vue({
432+
template: '<scriptTest></scriptTest>',
433+
components: {
434+
scriptTest: {
435+
template: '<script>console.log(1)</script>'
436+
}
437+
}
438+
}).$mount()
439+
expect(vm.$el.tagName).toBe('SCRIPT')
440+
expect(vm.$el.innerHTML).toBe('')
441+
expect('Templates should only be responsible for mapping the state').toHaveBeenWarned()
442+
})
429443
})

0 commit comments

Comments
 (0)