@@ -105,7 +105,7 @@ describe('renderToString', () => {
105105 fullDocument : false ,
106106 } ,
107107 ) ;
108- expect ( html ) . toContain ( '<section c-id="4.0.0.0"><!--t.4.1.1.0--> </section>' ) ;
108+ expect ( html ) . toContain ( '<section class="sc-another-car-detail" c-id="4.0.0.0"><!--t.4.1.1.0--> </section>' ) ;
109109 } ) ;
110110
111111 it ( 'supports styles for DSD' , async ( ) => {
@@ -145,10 +145,10 @@ describe('renderToString', () => {
145145 } ) ;
146146 expect ( html ) . toMatchSnapshot ( ) ;
147147 expect ( html ) . toContain (
148- `<car-detail custom-hydrate-flag=\"\" c-id=\"9.2.2.0\" s-id=\"10\"><!--r.10--><section c-id=\"10.0.0.0\"><!--t.10.1.1.0-->2024 VW Vento</section></car-detail>` ,
148+ `<car-detail class=\"sc-car-list\" custom-hydrate-flag=\"\" c-id=\"9.2.2.0\" s-id=\"10\"><!--r.10--><section c-id=\"10.0.0.0\"><!--t.10.1.1.0-->2024 VW Vento</section></car-detail>` ,
149149 ) ;
150150 expect ( html ) . toContain (
151- `<car-detail custom-hydrate-flag=\"\" c-id=\"9.4.2.0\" s-id=\"11\"><!--r.11--><section c-id=\"11.0.0.0\"><!--t.11.1.1.0-->2023 VW Beetle</section></car-detail>` ,
151+ `<car-detail class=\"sc-car-list\" custom-hydrate-flag=\"\" c-id=\"9.4.2.0\" s-id=\"11\"><!--r.11--><section c-id=\"11.0.0.0\"><!--t.11.1.1.0-->2023 VW Beetle</section></car-detail>` ,
152152 ) ;
153153 } ) ;
154154
@@ -161,18 +161,18 @@ describe('renderToString', () => {
161161
162162 const resultRenderToString = await readableToString ( renderToString ( input , opts , true ) ) ;
163163 expect ( resultRenderToString ) . toContain (
164- '<car-detail custom-hydrate-flag="" c-id="12.2.2.0" s-id="13"><!--r.13--><section c-id="13.0.0.0"><!--t.13.1.1.0-->2024 VW Vento</section></car-detail>' ,
164+ '<car-detail class="sc-car-list" custom-hydrate-flag="" c-id="12.2.2.0" s-id="13"><!--r.13--><section c-id="13.0.0.0"><!--t.13.1.1.0-->2024 VW Vento</section></car-detail>' ,
165165 ) ;
166166 expect ( resultRenderToString ) . toContain (
167- '<car-detail custom-hydrate-flag="" c-id="12.4.2.0" s-id="14"><!--r.14--><section c-id="14.0.0.0"><!--t.14.1.1.0-->2023 VW Beetle</section></car-detail>' ,
167+ '<car-detail class="sc-car-list" custom-hydrate-flag="" c-id="12.4.2.0" s-id="14"><!--r.14--><section c-id="14.0.0.0"><!--t.14.1.1.0-->2023 VW Beetle</section></car-detail>' ,
168168 ) ;
169169
170170 const resultStreamToString = await readableToString ( streamToString ( input , opts ) ) ;
171171 expect ( resultStreamToString ) . toContain (
172- '<car-detail custom-hydrate-flag="" c-id="15.2.2.0" s-id="16"><!--r.16--><section c-id="16.0.0.0"><!--t.16.1.1.0-->2024 VW Vento</section></car-detail>' ,
172+ '<car-detail class="sc-car-list" custom-hydrate-flag="" c-id="15.2.2.0" s-id="16"><!--r.16--><section c-id="16.0.0.0"><!--t.16.1.1.0-->2024 VW Vento</section></car-detail>' ,
173173 ) ;
174174 expect ( resultStreamToString ) . toContain (
175- '<car-detail custom-hydrate-flag="" c-id="15.4.2.0" s-id="17"><!--r.17--><section c-id="17.0.0.0"><!--t.17.1.1.0-->2023 VW Beetle</section></car-detail>' ,
175+ '<car-detail class="sc-car-list" custom-hydrate-flag="" c-id="15.4.2.0" s-id="17"><!--r.17--><section c-id="17.0.0.0"><!--t.17.1.1.0-->2023 VW Beetle</section></car-detail>' ,
176176 ) ;
177177 } ) ;
178178
@@ -242,7 +242,7 @@ describe('renderToString', () => {
242242 * ```
243243 */
244244 expect ( html ) . toContain (
245- `<dsd-listen-cmp custom-hydrate-flag=\"\" s-id=\"21\"><template shadowrootmode=\"open\"><style>:host{display:block}</style><slot c-id=\"21.0.0.0\"></slot></template><!--r.21-->Hello World</dsd-listen-cmp>` ,
245+ `<dsd-listen-cmp class=\"sc-dsd-listen-cmp-h\" custom-hydrate-flag=\"\" s-id=\"21\"><template shadowrootmode=\"open\"><style>:host{display:block}</style><slot class=\"sc-dsd-listen-cmp\" c-id=\"21.0.0.0\"></slot></template><!--r.21-->Hello World</dsd-listen-cmp>` ,
246246 ) ;
247247
248248 /**
@@ -257,7 +257,7 @@ describe('renderToString', () => {
257257 * </car-detail>
258258 */
259259 expect ( html ) . toContain (
260- `<car-detail custom-hydrate-flag=\"\" c-id=\"22.4.2.0\" s-id=\"24\"><!--r.24--><section c-id=\"24.0.0.0\"><!--t.24.1.1.0-->2023 VW Beetle</section></car-detail>` ,
260+ `<car-detail class=\"sc-car-list\" custom-hydrate-flag=\"\" c-id=\"22.4.2.0\" s-id=\"24\"><!--r.24--><section c-id=\"24.0.0.0\"><!--t.24.1.1.0-->2023 VW Beetle</section></car-detail>` ,
261261 ) ;
262262
263263 const page = await newE2EPage ( { html, url : 'https://stencil.com' } ) ;
@@ -284,15 +284,19 @@ describe('renderToString', () => {
284284 serializeShadowRoot : false ,
285285 fullDocument : false ,
286286 } ) ;
287- expect ( html ) . toBe ( '<another-car-detail custom-hydrate-flag="" s-id="25"><!--r.25--></another-car-detail>' ) ;
287+ expect ( html ) . toBe (
288+ '<another-car-detail class="sc-another-car-detail-h" custom-hydrate-flag="" s-id="25"><!--r.25--></another-car-detail>' ,
289+ ) ;
288290 } ) ;
289291
290292 it ( 'does not render a shadow component but its light dom' , async ( ) => {
291293 const { html } = await renderToString ( '<cmp-with-slot>Hello World</cmp-with-slot>' , {
292294 serializeShadowRoot : false ,
293295 fullDocument : false ,
294296 } ) ;
295- expect ( html ) . toBe ( '<cmp-with-slot custom-hydrate-flag="" s-id="26"><!--r.26-->Hello World</cmp-with-slot>' ) ;
297+ expect ( html ) . toBe (
298+ '<cmp-with-slot class="sc-cmp-with-slot-h" custom-hydrate-flag="" s-id="26"><!--r.26-->Hello World</cmp-with-slot>' ,
299+ ) ;
296300 } ) ;
297301
298302 describe ( 'modes in declarative shadow dom' , ( ) => {
@@ -344,30 +348,30 @@ describe('renderToString', () => {
344348 prettyHtml : true ,
345349 } ,
346350 ) ;
347- expect ( html ) . toBe ( `<nested-cmp-parent custom-hydrate-flag="" s-id="29">
351+ expect ( html ) . toBe ( `<nested-cmp-parent class="sc-nested-cmp-parent-h" custom-hydrate-flag="" s-id="29">
348352 <template shadowrootmode="open">
349353 <style>
350354 .sc-nested-scope-cmp-h{color:green}:host{display:inline-block}
351355 </style>
352- <div c-id="29.0.0.0" class="some-class">
353- <nested-scope-cmp c-id="29.1.1.0" class="sc-nested-scope-cmp-h" custom-hydrate-flag="" s-id="31">
356+ <div c-id="29.0.0.0" class="sc-nested-cmp-parent some-class">
357+ <nested-scope-cmp c-id="29.1.1.0" class="sc-nested-cmp-parent sc-nested- scope-cmp-h" custom-hydrate-flag="" s-id="31">
354358 <!--r.31-->
355359 <!--o.29.2.c-->
356360 <div c-id="31.0.0.0" class="sc-nested-scope-cmp sc-nested-scope-cmp-s some-scope-class">
357361 <!--s.31.1.1.0.-->
358- <slot c-id="29.2.2.0" s-sn=""></slot>
362+ <slot c-id="29.2.2.0" class="sc-nested-cmp-parent" s-sn=""></slot>
359363 </div>
360364 </nested-scope-cmp>
361365 </div>
362366 </template>
363367 <!--r.29-->
364- <nested-cmp-child custom-hydrate-flag="" s-id="30">
368+ <nested-cmp-child class="sc-nested-cmp-child-h" custom-hydrate-flag="" s-id="30">
365369 <template shadowrootmode="open">
366370 <style>
367371 :host{display:block}
368372 </style>
369- <div c-id="30.0.0.0" class="some-other-class">
370- <slot c-id="30.1.1.0"></slot>
373+ <div c-id="30.0.0.0" class="sc-nested-cmp-child some-other-class">
374+ <slot c-id="30.1.1.0" class="sc-nested-cmp-child" ></slot>
371375 </div>
372376 </template>
373377 <!--r.30-->
0 commit comments