MCPcopy Create free account
hub / github.com/adobe/react-spectrum / findCell

Method findCell

packages/@react-aria/test-utils/src/table.ts:501–516  ·  view source on GitHub ↗

* Returns a cell matching the specified text content.

(opts: {text: string})

Source from the content-addressed store, hash-verified

499 * Returns a cell matching the specified text content.
500 */
501 findCell(opts: {text: string}): HTMLElement {
502 let {text} = opts;
503
504 let cell = within(this.getTable()).getByText(text);
505 if (cell) {
506 while (cell && !/gridcell|rowheader|columnheader/.test(cell.getAttribute('role') || '')) {
507 if (cell.parentElement) {
508 cell = cell.parentElement;
509 } else {
510 break;
511 }
512 }
513 }
514
515 return cell;
516 }
517
518 /**
519 * Returns the table.

Callers 2

TableTests.jsFile · 0.80

Calls 1

getTableMethod · 0.95

Tested by

no test coverage detected