File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,28 @@ test.describe('$Window Component', () => {
652
652
} ) ;
653
653
} ) ;
654
654
655
+ test . describe ( '$Button()' , ( ) => {
656
+ test ( 'should add a button to the window' , async ( { page } ) => {
657
+ const hTestState = await page . evaluateHandle ( ( ) => {
658
+ const testState = { buttonClicks : 0 , buttonText : '' } ;
659
+ const $window = $Window ( {
660
+ title : 'Test Window'
661
+ } ) ;
662
+ const $button = $window . $Button ( 'Click me' , ( ) => {
663
+ testState . buttonClicks ++ ;
664
+ } ) ;
665
+ testState . buttonText = $button . text ( ) ;
666
+ return testState ;
667
+ } ) ;
668
+ await expect ( page . getByText ( 'Click me' ) ) . toBeVisible ( ) ;
669
+ await page . getByText ( 'Click me' ) . click ( ) ;
670
+ await expect ( await hTestState . evaluate ( ( testState ) => testState ) ) . toStrictEqual ( {
671
+ buttonClicks : 1 ,
672
+ buttonText : 'Click me' ,
673
+ } ) ;
674
+ } ) ;
675
+ } ) ;
676
+
655
677
test . describe ( "focus management" , ( ) => {
656
678
// Test cases where it should refocus the last focused control in the window:
657
679
// - Click in the blank space of the window
You can’t perform that action at this time.
0 commit comments