File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
packages/runtime-dom/__tests__/helpers Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 8
8
nextTick ,
9
9
ComponentOptions ,
10
10
Suspense ,
11
+ Teleport ,
11
12
FunctionalComponent
12
13
} from '@vue/runtime-dom'
13
14
@@ -196,4 +197,23 @@ describe('useCssVars', () => {
196
197
expect ( ( c as HTMLElement ) . style . getPropertyValue ( `--color` ) ) . toBe ( 'red' )
197
198
}
198
199
} )
200
+
201
+ test ( 'with teleport' , async ( ) => {
202
+ const state = reactive ( { color : 'red' } )
203
+ const root = document . createElement ( 'div' )
204
+ const target = document . createElement ( 'div' )
205
+
206
+ const App = {
207
+ setup ( ) {
208
+ useCssVars ( ( ) => state )
209
+ return ( ) => [ h ( Teleport , { to : target } , [ h ( 'div' ) ] ) ]
210
+ }
211
+ }
212
+
213
+ render ( h ( App ) , root )
214
+ await nextTick ( )
215
+ for ( const c of [ ] . slice . call ( target . children as any ) ) {
216
+ expect ( ( c as HTMLElement ) . style . getPropertyValue ( `--color` ) ) . toBe ( 'red' )
217
+ }
218
+ } )
199
219
} )
You can’t perform that action at this time.
0 commit comments