@@ -151,7 +151,7 @@ describe("TableGrowing - Button", () => {
151151 . should ( "have.been.calledTwice" ) ;
152152 } ) ;
153153
154- it ( "tests focus is set to first newly added row" , ( ) => {
154+ it ( "tests focus is set to first newly added row - click " , ( ) => {
155155 cy . mount ( < TableSample > </ TableSample > ) ;
156156
157157 cy . get < TableGrowing > ( "[ui5-table-growing]" )
@@ -175,6 +175,30 @@ describe("TableGrowing - Button", () => {
175175 . should ( "have.focus" ) ;
176176 } ) ;
177177
178+ it ( "tests focus is set to first newly added row - ENTER" , ( ) => {
179+ cy . mount ( < TableSample > </ TableSample > ) ;
180+
181+ cy . get < TableGrowing > ( "[ui5-table-growing]" )
182+ . then ( tableGrowing => {
183+ tableGrowing . get ( 0 ) . addEventListener ( "load-more" , ( ) => {
184+ const table = document . getElementById ( "table" ) ;
185+ const row = document . createElement ( "ui5-table-row" ) ;
186+ row . id = "new-row" ;
187+ row . innerHTML = "<ui5-table-cell><ui5-label>Cell B</ui5-label></ui5-table-cell>" ;
188+ table ! . appendChild ( row ) ;
189+ } ) ;
190+ } )
191+ . trigger ( "keydown" , { key : "Enter" , code : "Enter" , which : 13 } ) ;
192+
193+ cy . get ( "[ui5-table]" )
194+ . children ( "ui5-table-row" )
195+ . should ( "have.length" , 2 ) ;
196+
197+ cy . get ( "#new-row" )
198+ . should ( "exist" )
199+ . should ( "have.focus" ) ;
200+ } ) ;
201+
178202 it ( "tests focus is set to growing button when no new rows are added" , ( ) => {
179203 cy . mount ( < TableSample > </ TableSample > ) ;
180204
0 commit comments