File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
packages/runtime-vapor/__tests__ Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 11import {
2+ createPlainElement ,
23 createVaporSSRApp ,
34 defineVaporAsyncComponent ,
45 delegateEvents ,
@@ -4031,8 +4032,26 @@ describe('Vapor Mode hydration', () => {
40314032 expect ( ( container . firstChild ! as any ) . foo ) . toBe ( true )
40324033 } )
40334034
4034- // vapor custom element not implemented yet
4035- test . todo ( 'force hydrate custom element with dynamic props' , ( ) => { } )
4035+ test ( 'force hydrate custom element with dynamic props' , ( ) => {
4036+ class MyElement extends HTMLElement {
4037+ foo = ''
4038+ constructor ( ) {
4039+ super ( )
4040+ }
4041+ }
4042+ customElements . define ( 'my-element-7203' , MyElement )
4043+
4044+ const msg = ref ( 'bar' )
4045+ const container = document . createElement ( 'div' )
4046+ container . innerHTML = '<my-element-7203></my-element-7203>'
4047+ const app = createVaporSSRApp ( {
4048+ setup ( ) {
4049+ return createPlainElement ( 'my-element-7203' , { foo : ( ) => msg . value } )
4050+ } ,
4051+ } )
4052+ app . mount ( container )
4053+ expect ( ( container . firstChild as any ) . foo ) . toBe ( msg . value )
4054+ } )
40364055 } )
40374056} )
40384057
You can’t perform that action at this time.
0 commit comments