1616 */
1717
1818import { expect , test } from '@playwright/test' ;
19- import { getPropOrAttr , weight } from './util' ;
19+ import { getPropOrAttr , weight } from './util' ;
2020
2121
2222test . beforeEach ( async ( { page} ) => {
@@ -28,36 +28,37 @@ test.describe("basic support", weight(3), () => {
2828 test ( "can display a Custom Element with no children" , async ( { page} ) => {
2929 await expect ( page . locator ( '#ce-without-children' ) ) . toBeAttached ( ) ;
3030 } ) ;
31+ } )
3132
32- test . describe ( 'with children' , ( ) => {
33- const expectHasChildren = async ( wc ) => {
34- await expect ( wc . locator ( 'h1' ) ) . toHaveText ( 'Test h1' ) ;
35- await expect ( wc . locator ( 'p' ) ) . toHaveText ( 'Test p' ) ;
36- }
33+ test . describe ( 'with children' , ( ) => {
34+ const expectHasChildren = async ( wc ) => {
35+ await expect ( wc . locator ( 'h1' ) ) . toHaveText ( 'Test h1' ) ;
36+ await expect ( wc . locator ( 'p' ) ) . toHaveText ( 'Test p' ) ;
37+ }
3738
38- test ( "can display a Custom Element with children in a Shadow Root" , async ( { page} ) => {
39- await expectHasChildren ( page . locator ( '#ce-with-children' ) )
40- } )
39+ test ( "can display a Custom Element with children in a Shadow Root" , async ( { page} ) => {
40+ await expectHasChildren ( page . locator ( '#ce-with-children' ) )
41+ } )
4142
42- test ( "can display a Custom Element with children in a Shadow Root and pass in Light DOM children" , async ( { page} ) => {
43- const ce = page . locator ( '#ce-with-children-renderer ' ) ;
44- await expectHasChildren ( ce ) ;
45- await expect ( ce ) . toHaveText ( / 2 / ) ;
46- } )
43+ test ( "can display a Custom Element with children in a Shadow Root and pass in Light DOM children" , async ( { page} ) => {
44+ const ce = page . locator ( '#ce-with-children-rerender ' ) ;
45+ await expectHasChildren ( ce ) ;
46+ await expect ( ce ) . toHaveText ( / 2 / ) ;
47+ } )
4748
48- test ( 'can display a Custom Element with children in the Shadow DOM and handle hiding and showing the element' , async ( { page} ) => {
49- const ce = page . locator ( '#ce-with-different-views' )
50- const toggle = page . getByRole ( 'button' , { name : / t o g g l e v i e w s / i} ) ;
49+ test ( 'can display a Custom Element with children in the Shadow DOM and handle hiding and showing the element' , async ( { page} ) => {
50+ const ce = page . locator ( '#ce-with-different-views' )
51+ const toggle = page . getByRole ( 'button' , { name : / t o g g l e v i e w s / i} ) ;
5152
52- await expectHasChildren ( ce ) ;
53+ await expectHasChildren ( ce ) ;
5354
54- await toggle . click ( ) ;
55- await expect ( ce ) . toHaveText ( / d u m m y v i e w / i) ;
55+ await toggle . click ( ) ;
56+ await expect ( ce ) . toHaveText ( / d u m m y v i e w / i) ;
5657
57- await toggle . click ( ) ;
58- await expectHasChildren ( ce ) ;
59- } )
58+ await toggle . click ( ) ;
59+ await expectHasChildren ( ce ) ;
6060 } )
61+
6162 } ) ;
6263
6364 test . describe ( 'attributes and properties' , ( ) => {
0 commit comments