@@ -67,7 +67,10 @@ test.describe('Neo.component.Base', () => {
6767 expect ( containerId ) . toBe ( 'neo-container-1' ) ;
6868
6969 await page . waitForSelector ( '.neo-container' ) ;
70- // t.diag('Container got rendered.');
70+
71+ const initialContainerBgColor = await page . locator ( `#${ containerId } ` ) . evaluate ( el => el . style . backgroundColor ) ;
72+
73+ expect ( initialContainerBgColor ) . toBe ( 'red' ) ;
7174
7275 const componentResult = await page . evaluate ( async ( containerId ) => {
7376 return Neo . worker . App . createNeoInstance ( {
@@ -86,15 +89,16 @@ test.describe('Neo.component.Base', () => {
8689 componentId = componentResult . id ;
8790
8891 expect ( componentId ) . toBe ( 'neo-component-1' ) ;
89- // t.diag('Component got rendered.');
92+
93+ const initialComponentBgColor = await page . locator ( `#${ componentId } ` ) . evaluate ( el => el . style . backgroundColor ) ;
94+
95+ expect ( initialComponentBgColor ) . toBe ( 'blue' ) ;
9096
9197 // t.diag('Child update before parent update');
92- await page . evaluate ( async ( id ) => {
93- await Neo . worker . App . setConfigs ( { id, style : { backgroundColor : 'green' } } ) ;
94- } , componentId ) ;
95- await page . evaluate ( async ( id ) => {
96- await Neo . worker . App . setConfigs ( { id, style : { backgroundColor : 'orange' } } ) ;
97- } , containerId ) ;
98+ await page . evaluate ( async ( { componentId, containerId} ) => {
99+ Neo . worker . App . setConfigs ( { id : componentId , style : { backgroundColor : 'green' } } ) ;
100+ Neo . worker . App . setConfigs ( { id : containerId , style : { backgroundColor : 'orange' } } ) ;
101+ } , { componentId, containerId} ) ;
98102
99103 await page . waitForTimeout ( 100 ) ;
100104
0 commit comments