@@ -3,17 +3,19 @@ import TestIDs from '../playground/src/testIDs';
33
44const { elementByLabel, elementById, expectImagesToBeEqual} = Utils ;
55
6- describe . each ( [ 'aboveContent' , 'pushContent' ] ) ( ' SideMenu', ( openMode ) => {
6+ describe ( ' SideMenu', ( ) => {
77 beforeEach ( async ( ) => {
88 await device . launchApp ( { newInstance : true } ) ;
99 await elementById ( TestIDs . SIDE_MENU_BTN ) . tap ( ) ;
10-
11- if ( openMode === 'aboveContent' ) {
12- await elementById ( TestIDs . TOGGLE_SIDE_MENU_OPEN_MODE_BTN ) . tap ( ) ;
13- }
1410 } ) ;
1511
16- describe ( `Open mode '${ openMode } '` , ( ) => {
12+ describe . each ( [ 'aboveContent' , 'pushContent' ] ) ( 'Open mode %s' , ( openMode ) => {
13+ beforeEach ( async ( ) => {
14+ if ( openMode === 'pushContent' ) {
15+ await elementById ( TestIDs . TOGGLE_SIDE_MENU_OPEN_MODE_BTN ) . tap ( ) ;
16+ }
17+ } ) ;
18+
1719 it ( 'close SideMenu and push to stack with static id' , async ( ) => {
1820 await elementById ( TestIDs . OPEN_LEFT_SIDE_MENU_BTN ) . tap ( ) ;
1921 await elementById ( TestIDs . LEFT_SIDE_MENU_PUSH_BTN ) . tap ( ) ;
@@ -89,4 +91,17 @@ describe.each([ 'aboveContent', 'pushContent' ])('SideMenu', (openMode) => {
8991 expectImagesToBeEqual ( actual , snapshottedImagePath ) ;
9092 } ) ;
9193 } ) ;
94+
95+ it . e2e ( ':ios: should open above-content by default' , async ( ) => {
96+ await elementById ( TestIDs . TOGGLE_SIDE_MENU_OPEN_MODE_BTN ) . tap ( ) ; // aboveContent --> pushContent
97+ await elementById ( TestIDs . TOGGLE_SIDE_MENU_OPEN_MODE_BTN ) . tap ( ) ; // pushContent --> undefined
98+ await expect ( elementByLabel ( 'Open mode: undefined' ) ) . toBeVisible ( ) ;
99+
100+ await elementById ( TestIDs . OPEN_LEFT_SIDE_MENU_BTN ) . tap ( ) ;
101+
102+ const snapshottedImagePath = `./e2e/assets/side_menu.undefined.png` ;
103+ const actual =
104+ await elementById ( 'SideMenuContainer' ) . takeScreenshot ( `side_menu_undefined` ) ;
105+ expectImagesToBeEqual ( actual , snapshottedImagePath ) ;
106+ } ) ;
92107} ) ;
0 commit comments