|
|
@@ -275,4 +275,22 @@ describe('useCssVars', () => {
|
|
|
expect((c as HTMLElement).style.getPropertyValue(`--color`)).toBe('red')
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ test('with teleport(disabled)', async () => {
|
|
|
+ document.body.innerHTML = ''
|
|
|
+ const state = reactive({ color: 'red' })
|
|
|
+ const root = document.createElement('div')
|
|
|
+ const target = document.body
|
|
|
+
|
|
|
+ const App = {
|
|
|
+ setup() {
|
|
|
+ useCssVars(() => state)
|
|
|
+ return () => [h(Teleport, { to: target, disabled: true }, [h('div')])]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ expect(() => render(h(App), root)).not.toThrow(TypeError)
|
|
|
+ await nextTick()
|
|
|
+ expect(target.children.length).toBe(0)
|
|
|
+ })
|
|
|
})
|