@@ -236,8 +236,12 @@ describe('EuiDataGrid', () => {
236236 // starts with body in focus
237237 cy . focused ( ) . should ( 'not.exist' ) ;
238238
239- cy . get ( '[data-gridcell-id="1,1"]' ) . click ( ) ;
240- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '1,1' ) ;
239+ cy . get (
240+ '[data-gridcell-column-index="1"][data-gridcell-visible-row-index="1"]'
241+ ) . click ( ) ;
242+ cy . focused ( )
243+ . should ( 'have.attr' , 'data-gridcell-column-index' , '1' )
244+ . should ( 'have.attr' , 'data-gridcell-row-index' , '1' ) ;
241245 } ) ;
242246
243247 describe ( 'cell keyboard interactions' , ( ) => {
@@ -269,7 +273,9 @@ describe('EuiDataGrid', () => {
269273
270274 // tab into the grid, should focus first cell after a short delay
271275 cy . focused ( ) . tab ( ) ;
272- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '0,0' ) ;
276+ cy . focused ( )
277+ . should ( 'have.attr' , 'data-gridcell-column-index' , '0' )
278+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
273279
274280 cy . focused ( ) . tab ( ) . should ( 'have.id' , 'final-tabbable' ) ;
275281 } ) ;
@@ -282,27 +288,37 @@ describe('EuiDataGrid', () => {
282288 cy . get ( '[data-test-subj=euiDataGridBody]' ) . focus ( ) ;
283289
284290 // first cell is non-interactive and non-expandable = focus cell
285- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '0,0' ) ;
291+ cy . focused ( )
292+ . should ( 'have.attr' , 'data-gridcell-column-index' , '0' )
293+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
286294
287295 // already left-most, should be no-op
288296 cy . focused ( ) . type ( '{leftarrow}' ) ;
289- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '0,0' ) ;
297+ cy . focused ( )
298+ . should ( 'have.attr' , 'data-gridcell-column-index' , '0' )
299+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
290300
291301 // arrow right, expandable cell with no interactive = focus cell
292302 cy . focused ( ) . type ( '{rightarrow}' ) ;
293- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '1,0' ) ;
303+ cy . focused ( )
304+ . should ( 'have.attr' , 'data-gridcell-column-index' , '1' )
305+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
294306
295307 // arrow right, non-expandable cell with one interactive = focus interactive
296308 cy . focused ( ) . type ( '{rightarrow}' ) ;
297309 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'focusOnMe' ) ;
298310
299311 // arrow right, non-expandable cell with two interactives = focus cell
300312 cy . focused ( ) . type ( '{rightarrow}' ) ;
301- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '3,0' ) ;
313+ cy . focused ( )
314+ . should ( 'have.attr' , 'data-gridcell-column-index' , '3' )
315+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
302316
303317 // arrow right, expandable cell with two interactives = focus cell
304318 cy . focused ( ) . type ( '{rightarrow}' ) ;
305- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '4,0' ) ;
319+ cy . focused ( )
320+ . should ( 'have.attr' , 'data-gridcell-column-index' , '4' )
321+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
306322 } ) ;
307323
308324 it ( 'cell expansion/interaction' , ( ) => {
@@ -314,34 +330,50 @@ describe('EuiDataGrid', () => {
314330
315331 // first cell is non-interactive and non-expandable, enter should have no effect
316332 cy . focused ( ) . type ( '{enter}' ) ;
317- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '0,0' ) ;
333+ cy . focused ( )
334+ . should ( 'have.attr' , 'data-gridcell-column-index' , '0' )
335+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
318336
319337 // second cell is expandable
320- cy . get ( '[data-gridcell-id="1,0"]' ) . click ( ) ;
338+ cy . get (
339+ '[data-gridcell-column-index="1"][data-gridcell-row-index="0"]'
340+ ) . click ( ) ;
321341 cy . focused ( ) . type ( '{enter}' ) ;
322342 cy . focused ( ) . should (
323343 'have.attr' ,
324344 'data-test-subj' ,
325345 'euiDataGridExpansionPopover'
326346 ) ;
327347 cy . focused ( ) . type ( '{esc}' ) ;
328- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '1,0' ) ;
348+ cy . focused ( )
349+ . should ( 'have.attr' , 'data-gridcell-column-index' , '1' )
350+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
329351
330352 // third cell is non-expandable & interactive, click should focus on the link
331- cy . get ( '[data-gridcell-id="2,0"]' ) . click ( ) ;
353+ cy . get (
354+ '[data-gridcell-column-index="2"][data-gridcell-row-index="0"]'
355+ ) . click ( ) ;
332356 cy . focused ( ) . type ( '{enter}' ) ;
333357 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'focusOnMe' ) ;
334358
335359 // fourth cell is non-expandable with multiple interactives, click should focus on the cell
336- cy . get ( '[data-gridcell-id="3,0"]' ) . click ( ) ;
360+ cy . get (
361+ '[data-gridcell-column-index="3"][data-gridcell-row-index="0"]'
362+ ) . click ( ) ;
337363 cy . focused ( ) . type ( '{enter}' ) ;
338364 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'focusOnMe' ) ; // focus trap focuses the link
339365 cy . focused ( ) . type ( '{esc}' ) ;
340- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '3,0' ) ;
366+ cy . focused ( )
367+ . should ( 'have.attr' , 'data-gridcell-column-index' , '3' )
368+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
341369
342370 // fifth cell is non-expandable & no-actions with multiple interactives, click should focus cell
343- cy . get ( '[data-gridcell-id="4,0"]' ) . click ( 'topLeft' ) ; // top left to avoid clicking a button
344- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '4,0' ) ;
371+ cy . get (
372+ '[data-gridcell-column-index="4"][data-gridcell-row-index="0"]'
373+ ) . click ( 'topLeft' ) ; // top left to avoid clicking a button
374+ cy . focused ( )
375+ . should ( 'have.attr' , 'data-gridcell-column-index' , '4' )
376+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
345377 // enable interactives & focus trap
346378 cy . focused ( ) . type ( '{enter}' ) ;
347379 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'btn-yes' ) ;
@@ -350,11 +382,17 @@ describe('EuiDataGrid', () => {
350382 cy . focused ( ) . tab ( ) ;
351383 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'btn-yes' ) ;
352384 cy . focused ( ) . type ( '{esc}' ) ;
353- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '4,0' ) ;
385+ cy . focused ( )
386+ . should ( 'have.attr' , 'data-gridcell-column-index' , '4' )
387+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
354388
355389 // sixth cell is expandable cell with two interactives, click should focus on the cell
356- cy . get ( '[data-gridcell-id="5,0"]' ) . click ( 'topLeft' , { force : true } ) ; // top left to avoid clicking a button
357- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '5,0' ) ;
390+ cy . get (
391+ '[data-gridcell-column-index="5"][data-gridcell-row-index="0"]'
392+ ) . click ( 'topLeft' , { force : true } ) ; // top left to avoid clicking a button
393+ cy . focused ( )
394+ . should ( 'have.attr' , 'data-gridcell-column-index' , '5' )
395+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
358396 cy . focused ( ) . type ( '{enter}' ) ; // trigger expansion popover
359397 cy . focused ( ) . should ( 'have.attr' , 'data-test-subj' , 'btn-yes' ) ; // focus trap should move focus to the first button
360398 cy . focused ( ) . parentsUntil (
@@ -369,15 +407,17 @@ describe('EuiDataGrid', () => {
369407 'euiDataGridExpansionPopover'
370408 ) ;
371409 cy . focused ( ) . type ( '{esc}' ) ;
372- cy . focused ( ) . should ( 'have.attr' , 'data-gridcell-id' , '5,0' ) ;
410+ cy . focused ( )
411+ . should ( 'have.attr' , 'data-gridcell-column-index' , '5' )
412+ . should ( 'have.attr' , 'data-gridcell-row-index' , '0' ) ;
373413 } ) ;
374414 } ) ;
375415 } ) ;
376416} ) ;
377417
378418function getGridData ( ) {
379419 // wait for the virtualized cells to render
380- cy . get ( '[data-gridcell-id ="0, 1"]' ) ;
420+ cy . get ( '[data-gridcell-column-index ="0"][data-gridcell-row-index=" 1"]' ) ;
381421 const rows = cy . get ( '[role=row]' ) ;
382422 return rows . then ( ( rows ) => {
383423 const headers : string [ ] = [ ] ;
0 commit comments