@@ -1144,6 +1144,102 @@ describe("TabContainer keyboard handling", () => {
1144
1144
cy . get ( "@tabContainer" ) . shadow ( ) . find ( "ui5-responsive-popover" ) . as ( "popover" ) ;
1145
1145
cy . get ( "@popover" ) . should ( "be.visible" , "Popover is opened" ) ;
1146
1146
} ) ;
1147
+
1148
+ it ( "tests handling of the focus navigation with End overflow mode" , ( ) => {
1149
+ cy . mount (
1150
+ < >
1151
+ < Button id = "btn1" />
1152
+ < TabContainer id = "tabContainerStartAndEndOverflow" overflowMode = "End" >
1153
+ < Tab text = "One" > Tab 1</ Tab >
1154
+ < Tab text = "Two" > Tab 2</ Tab >
1155
+ < Tab id = "activeTab" text = "Three" selected > Tab 3</ Tab >
1156
+ < Tab text = "Four" > Tab 4</ Tab >
1157
+ < Tab text = "Five" > Tab 4</ Tab >
1158
+ </ TabContainer >
1159
+ < Button id = "btn2" />
1160
+ </ >
1161
+ ) ;
1162
+
1163
+ cy . viewport ( 300 , 1080 ) ;
1164
+
1165
+ cy . get ( "#tabContainerStartAndEndOverflow" ) . shadow ( ) . find ( ".ui5-tc__overflow--end" ) . as ( "endOverflow" ) ;
1166
+
1167
+ cy . get ( "#btn1" ) . realClick ( ) ;
1168
+
1169
+ cy . realPress ( "Tab" ) ;
1170
+
1171
+ cy . realPress ( "ArrowRight" ) ;
1172
+
1173
+ cy . get ( "@endOverflow" )
1174
+ . find ( "[ui5-button]" )
1175
+ . shadow ( )
1176
+ . find ( ".ui5-button-root" )
1177
+ . should ( "be.focus" ) ;
1178
+
1179
+ cy . realPress ( "Tab" ) ;
1180
+
1181
+ cy . get ( "#btn2" ) . should ( "be.focused" ) ;
1182
+
1183
+ cy . realPress ( [ "Shift" , "Tab" ] ) ;
1184
+
1185
+ cy . get ( "@endOverflow" )
1186
+ . find ( "[ui5-button]" )
1187
+ . shadow ( )
1188
+ . find ( ".ui5-button-root" )
1189
+ . should ( "be.focus" ) ;
1190
+
1191
+ cy . realPress ( [ "Shift" , "Tab" ] ) ;
1192
+
1193
+ cy . get ( "#btn1" ) . should ( "be.focused" ) ;
1194
+ } ) ;
1195
+
1196
+ it ( "tests handling of the focus navigation with Start overflow mode" , ( ) => {
1197
+ cy . mount (
1198
+ < >
1199
+ < Button id = "btn1" />
1200
+ < TabContainer id = "tabContainerStartAndEndOverflow" overflowMode = "StartAndEnd" >
1201
+ < Tab text = "One" > Tab 1</ Tab >
1202
+ < Tab text = "Two" > Tab 2</ Tab >
1203
+ < Tab id = "activeTab" text = "Three" selected > Tab 3</ Tab >
1204
+ < Tab text = "Four" > Tab 4</ Tab >
1205
+ < Tab text = "Five" > Tab 4</ Tab >
1206
+ </ TabContainer >
1207
+ < Button id = "btn2" />
1208
+ </ >
1209
+ ) ;
1210
+
1211
+ cy . viewport ( 300 , 1080 ) ;
1212
+
1213
+ cy . get ( "#tabContainerStartAndEndOverflow" ) . shadow ( ) . find ( ".ui5-tc__overflow--start" ) . as ( "startOverflow" ) ;
1214
+
1215
+ cy . get ( "#btn1" ) . realClick ( ) ;
1216
+
1217
+ cy . realPress ( "Tab" ) ;
1218
+
1219
+ cy . realPress ( "ArrowLeft" ) ;
1220
+
1221
+ cy . get ( "@startOverflow" )
1222
+ . find ( "[ui5-button]" )
1223
+ . shadow ( )
1224
+ . find ( ".ui5-button-root" )
1225
+ . should ( "be.focus" ) ;
1226
+
1227
+ cy . realPress ( "Tab" ) ;
1228
+
1229
+ cy . get ( "#btn2" ) . should ( "be.focused" ) ;
1230
+
1231
+ cy . realPress ( [ "Shift" , "Tab" ] ) ;
1232
+
1233
+ cy . get ( "@startOverflow" )
1234
+ . find ( "[ui5-button]" )
1235
+ . shadow ( )
1236
+ . find ( ".ui5-button-root" )
1237
+ . should ( "be.focus" ) ;
1238
+
1239
+ cy . realPress ( [ "Shift" , "Tab" ] ) ;
1240
+
1241
+ cy . get ( "#btn1" ) . should ( "be.focused" ) ;
1242
+ } ) ;
1147
1243
} ) ;
1148
1244
1149
1245
describe ( "TabContainer popover" , ( ) => {
0 commit comments