(tree, text)
| 98 | } |
| 99 | // I'd use tree.getByRole(role, {name: text}) here, but it's unbearably slow. |
| 100 | let 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 | |
| 110 | describe('useTable', () => { |
| 111 | let user; |