|
@@ -12,6 +12,7 @@ import {
|
|
|
createApp,
|
|
createApp,
|
|
|
computed
|
|
computed
|
|
|
} from '@vue/runtime-test'
|
|
} from '@vue/runtime-test'
|
|
|
|
|
+import { render as domRender } from 'vue'
|
|
|
|
|
|
|
|
describe('api: options', () => {
|
|
describe('api: options', () => {
|
|
|
test('data', async () => {
|
|
test('data', async () => {
|
|
@@ -1035,6 +1036,19 @@ describe('api: options', () => {
|
|
|
expect(renderToString(h(Comp))).toBe('base,base')
|
|
expect(renderToString(h(Comp))).toBe('base,base')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ test('extends template', () => {
|
|
|
|
|
+ const Comp = {
|
|
|
|
|
+ extends: {
|
|
|
|
|
+ template: `<h1>Foo</h1>`
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const root = document.createElement('div') as any
|
|
|
|
|
+ domRender(h(Comp), root)
|
|
|
|
|
+ expect(root.innerHTML).toBe(`<h1>Foo</h1>`)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
test('options defined in component have higher priority', async () => {
|
|
test('options defined in component have higher priority', async () => {
|
|
|
const Mixin = {
|
|
const Mixin = {
|
|
|
msg1: 'base'
|
|
msg1: 'base'
|