@@ -1089,7 +1089,7 @@ describe("Events", () => {
10891089 . find ( ".ui5-shellbar-overflow-popover" )
10901090 . should ( "to.exist" )
10911091 . invoke ( "prop" , "open" , true ) ;
1092-
1092+
10931093 } ) ;
10941094 } ) ;
10951095} ) ;
@@ -1199,6 +1199,60 @@ describe("ButtonBadge in ShellBar", () => {
11991199 } ) ;
12001200} ) ;
12011201
1202+ describe ( "Search Controllers" , ( ) => {
1203+ it ( "Test search doesn't collapse in full-screen mode during resize" , ( ) => {
1204+ cy . mount (
1205+ < ShellBar id = "shellbar" showSearchField = { true } showNotifications = { true } showProductSwitch = { true } >
1206+ < img slot = "logo" src = "https://upload.wikimedia.org/wikipedia/commons/5/59/SAP_2011_logo.svg" />
1207+ < ShellBarSearch id = "search" slot = "searchField" > </ ShellBarSearch >
1208+ < ShellBarItem icon = { activities } text = "Action" > </ ShellBarItem >
1209+ < Button slot = "content" > Button</ Button >
1210+ </ ShellBar >
1211+ ) ;
1212+
1213+ // search not focused
1214+ cy . get ( "#search" ) . should ( "not.be.focused" ) ;
1215+ // search field is empty
1216+ cy . get ( "#search" ) . should ( "have.value" , "" ) ;
1217+
1218+ cy . viewport ( 400 , 800 ) ;
1219+ cy . wait ( RESIZE_THROTTLE_RATE ) ;
1220+
1221+ cy . get ( "#shellbar" ) . should ( "have.prop" , "showSearchField" , true ) ;
1222+
1223+ cy . viewport ( 360 , 800 ) ;
1224+ cy . wait ( RESIZE_THROTTLE_RATE ) ;
1225+
1226+ cy . get ( "#shellbar" ) . should ( "have.prop" , "showSearchField" , true ) ;
1227+ } ) ;
1228+
1229+ it ( "Test legacy search doesn't collapse in full-screen mode during resize" , ( ) => {
1230+ cy . mount (
1231+ < ShellBar id = "shellbar" showSearchField = { true } showNotifications = { true } showProductSwitch = { true } >
1232+ < img slot = "logo" src = "https://upload.wikimedia.org/wikipedia/commons/5/59/SAP_2011_logo.svg" />
1233+ < Input id = "search" slot = "searchField" > </ Input >
1234+ < ShellBarItem icon = { activities } text = "Action" > </ ShellBarItem >
1235+ < Button slot = "content" > Button</ Button >
1236+ </ ShellBar >
1237+ ) ;
1238+
1239+ // search not focused
1240+ cy . get ( "#search" ) . should ( "not.be.focused" ) ;
1241+ // search field is empty
1242+ cy . get ( "#search" ) . should ( "have.value" , "" ) ;
1243+
1244+ cy . viewport ( 400 , 800 ) ;
1245+ cy . wait ( RESIZE_THROTTLE_RATE ) ;
1246+
1247+ cy . get ( "#shellbar" ) . should ( "have.prop" , "showSearchField" , true ) ;
1248+
1249+ cy . viewport ( 360 , 800 ) ;
1250+ cy . wait ( RESIZE_THROTTLE_RATE ) ;
1251+
1252+ cy . get ( "#shellbar" ) . should ( "have.prop" , "showSearchField" , true ) ;
1253+ } ) ;
1254+ } ) ;
1255+
12021256describe ( "Keyboard Navigation" , ( ) => {
12031257 it ( "Test logo area elements are not rendered when no logo and primaryTitle are provided" , ( ) => {
12041258 cy . mount ( < ShellBar > </ ShellBar > ) ;
0 commit comments