MCPcopy Index your code
hub / github.com/adobe/react-spectrum / getCell

Function getCell

packages/react-aria/test/table/useTable.test.tsx:100–108  ·  view source on GitHub ↗
(tree, text)

Source from the content-addressed store, hash-verified

98}
99// I'd use tree.getByRole(role, {name: text}) here, but it's unbearably slow.
100let getCell = (tree, text) => {
101 // Find by text, then go up to the element with the cell role.
102 let el = tree.getByText(text);
103 while (el && !/gridcell|rowheader|columnheader/.test(el.getAttribute('role'))) {
104 el = el.parentElement;
105 }
106
107 return el;
108};
109
110describe('useTable', () => {
111 let user;

Callers 1

useTable.test.tsxFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected