test: fix dts tests for Teleport renaming
This commit is contained in:
parent
835789532c
commit
10c0ba507a
@ -5,7 +5,7 @@ import {
|
|||||||
defineComponent,
|
defineComponent,
|
||||||
ref,
|
ref,
|
||||||
Fragment,
|
Fragment,
|
||||||
Portal,
|
Teleport,
|
||||||
Suspense
|
Suspense
|
||||||
} from './index'
|
} from './index'
|
||||||
|
|
||||||
@ -32,11 +32,11 @@ describe('h inference w/ Fragment', () => {
|
|||||||
expectError(h(Fragment, { key: 123 }, 'bar'))
|
expectError(h(Fragment, { key: 123 }, 'bar'))
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('h inference w/ Portal', () => {
|
describe('h inference w/ Teleport', () => {
|
||||||
h(Portal, { target: '#foo' }, 'hello')
|
h(Teleport, { to: '#foo' }, 'hello')
|
||||||
expectError(h(Portal))
|
expectError(h(Teleport))
|
||||||
expectError(h(Portal, {}))
|
expectError(h(Teleport, {}))
|
||||||
expectError(h(Portal, { target: '#foo' }))
|
expectError(h(Teleport, { to: '#foo' }))
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('h inference w/ Suspense', () => {
|
describe('h inference w/ Suspense', () => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// TSX w/ defineComponent is tested in defineComponent.test-d.tsx
|
// TSX w/ defineComponent is tested in defineComponent.test-d.tsx
|
||||||
|
|
||||||
import { expectError, expectType } from 'tsd'
|
import { expectError, expectType } from 'tsd'
|
||||||
import { KeepAlive, Suspense, Fragment, Portal } from '@vue/runtime-dom'
|
import { KeepAlive, Suspense, Fragment, Teleport } from '@vue/runtime-dom'
|
||||||
|
|
||||||
expectType<JSX.Element>(<div />)
|
expectType<JSX.Element>(<div />)
|
||||||
expectType<JSX.Element>(<div id="foo" />)
|
expectType<JSX.Element>(<div id="foo" />)
|
||||||
@ -27,10 +27,10 @@ expectType<JSX.Element>(
|
|||||||
expectType<JSX.Element>(<Fragment />)
|
expectType<JSX.Element>(<Fragment />)
|
||||||
expectType<JSX.Element>(<Fragment key="1" />)
|
expectType<JSX.Element>(<Fragment key="1" />)
|
||||||
|
|
||||||
expectType<JSX.Element>(<Portal target="#foo" />)
|
expectType<JSX.Element>(<Teleport to="#foo" />)
|
||||||
expectType<JSX.Element>(<Portal target="#foo" key="1" />)
|
expectType<JSX.Element>(<Teleport to="#foo" key="1" />)
|
||||||
expectError(<Portal />)
|
expectError(<Teleport />)
|
||||||
expectError(<Portal target={1} />)
|
expectError(<Teleport to={1} />)
|
||||||
|
|
||||||
// KeepAlive
|
// KeepAlive
|
||||||
expectType<JSX.Element>(<KeepAlive include="foo" exclude={['a']} />)
|
expectType<JSX.Element>(<KeepAlive include="foo" exclude={['a']} />)
|
||||||
|
Loading…
Reference in New Issue
Block a user