@@ -100,3 +100,69 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ config, title }) =>
100
100
} ) ;
101
101
} ) ;
102
102
} ) ;
103
+
104
+ /**
105
+ * This behavior needs to be tested in both modes but does not vary
106
+ * across directions due to the component only applying safe area
107
+ * to the top and bottom
108
+ */
109
+ configs ( { directions : [ 'ltr' ] } ) . forEach ( ( { title, screenshot, config } ) => {
110
+ test . describe ( title ( 'action-sheet: basic' ) , ( ) => {
111
+ test . describe ( 'safe area' , ( ) => {
112
+ test ( 'should have padding added by the safe area' , async ( { page } , testInfo ) => {
113
+ testInfo . annotations . push ( {
114
+ type : 'issue' ,
115
+ description : 'https://github.com/ionic-team/ionic-framework/issues/27777' ,
116
+ } ) ;
117
+ await page . setContent (
118
+ `
119
+ <style>
120
+ :root {
121
+ --ion-safe-area-top: 60px;
122
+ --ion-safe-area-bottom: 40px;
123
+ }
124
+ </style>
125
+
126
+ <ion-action-sheet></ion-action-sheet>
127
+
128
+ <script>
129
+ const actionSheet = document.querySelector('ion-action-sheet');
130
+ actionSheet.header = 'Header';
131
+ actionSheet.subHeader = 'Sub Header';
132
+ actionSheet.buttons = [
133
+ 'Add Reaction',
134
+ 'Copy Text',
135
+ 'Share Text',
136
+ 'Copy Link to Message',
137
+ 'Remind Me',
138
+ 'Pin File',
139
+ 'Star File',
140
+ 'Mark Unread',
141
+ 'Mark Read',
142
+ 'Edit Title',
143
+ 'Erase Title',
144
+ 'Save Image',
145
+ 'Copy Image',
146
+ 'Erase Image',
147
+ 'Delete File',
148
+ {
149
+ text: 'Cancel',
150
+ role: 'cancel'
151
+ },
152
+ ];
153
+ </script>
154
+ ` ,
155
+ config
156
+ ) ;
157
+
158
+ const ionActionSheetDidPresent = await page . spyOnEvent ( 'ionActionSheetDidPresent' ) ;
159
+ const actionSheet = page . locator ( 'ion-action-sheet' ) ;
160
+
161
+ await actionSheet . evaluate ( ( el : HTMLIonActionSheetElement ) => el . present ( ) ) ;
162
+ await ionActionSheetDidPresent . next ( ) ;
163
+
164
+ await expect ( actionSheet ) . toHaveScreenshot ( screenshot ( `action-sheet-safe-area` ) ) ;
165
+ } ) ;
166
+ } ) ;
167
+ } ) ;
168
+ } ) ;
0 commit comments