(tree, text)
| 234 | }; |
| 235 | // I'd use tree.getByRole(role, {name: text}) here, but it's unbearably slow. |
| 236 | let getCell = (tree, text) => { |
| 237 | // Find by text, then go up to the element with the cell role. |
| 238 | let el = tree.getByText(text); |
| 239 | while (el && !/gridcell|rowheader|columnheader/.test(el.getAttribute('role'))) { |
| 240 | el = el.parentElement; |
| 241 | } |
| 242 | |
| 243 | return el; |
| 244 | }; |
| 245 | |
| 246 | let focusCell = (tree, text) => act(() => getCell(tree, text).focus()); |
| 247 | let moveFocus = (key, opts = {}) => { |
no outgoing calls
no test coverage detected