]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: fix dts tests for Teleport renaming
authorEvan You <yyx990803@gmail.com>
Thu, 2 Apr 2020 02:04:55 +0000 (22:04 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 2 Apr 2020 02:04:55 +0000 (22:04 -0400)
test-dts/h.test-d.ts
test-dts/tsx.test-d.tsx

index 99af6ba5fd209f4a93f19e0b72574f0b1059f5c1..e85bee45bcafae22039bba84abf1495f73b3a70c 100644 (file)
@@ -5,7 +5,7 @@ import {
   defineComponent,
   ref,
   Fragment,
-  Portal,
+  Teleport,
   Suspense
 } from './index'
 
@@ -32,11 +32,11 @@ describe('h inference w/ Fragment', () => {
   expectError(h(Fragment, { key: 123 }, 'bar'))
 })
 
-describe('h inference w/ Portal', () => {
-  h(Portal, { target: '#foo' }, 'hello')
-  expectError(h(Portal))
-  expectError(h(Portal, {}))
-  expectError(h(Portal, { target: '#foo' }))
+describe('h inference w/ Teleport', () => {
+  h(Teleport, { to: '#foo' }, 'hello')
+  expectError(h(Teleport))
+  expectError(h(Teleport, {}))
+  expectError(h(Teleport, { to: '#foo' }))
 })
 
 describe('h inference w/ Suspense', () => {
index 8c63070e6b48530d1d3ca48997dae3a5baf6b0f6..c79c1fd42c76a1e70723087914dab4e78894b5c6 100644 (file)
@@ -1,7 +1,7 @@
 // TSX w/ defineComponent is tested in defineComponent.test-d.tsx
 
 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 id="foo" />)
@@ -27,10 +27,10 @@ expectType<JSX.Element>(
 expectType<JSX.Element>(<Fragment />)
 expectType<JSX.Element>(<Fragment key="1" />)
 
-expectType<JSX.Element>(<Portal target="#foo" />)
-expectType<JSX.Element>(<Portal target="#foo" key="1" />)
-expectError(<Portal />)
-expectError(<Portal target={1} />)
+expectType<JSX.Element>(<Teleport to="#foo" />)
+expectType<JSX.Element>(<Teleport to="#foo" key="1" />)
+expectError(<Teleport />)
+expectError(<Teleport to={1} />)
 
 // KeepAlive
 expectType<JSX.Element>(<KeepAlive include="foo" exclude={['a']} />)