MCPcopy Index your code
hub / github.com/Comcast/react-data-grid / toggleSelection

Function toggleSelection

test/browser/rowSelection.test.tsx:61–66  ·  view source on GitHub ↗
(rowIdx: number, shift = false, force = false)

Source from the content-addressed store, hash-verified

59}
60
61async function toggleSelection(rowIdx: number, shift = false, force = false) {
62 const checkbox = getRowByText(rowIdx).getByRole('checkbox', { name: 'Select' });
63 if (shift) await userEvent.keyboard('{Shift>}');
64 await userEvent.click(checkbox, { force });
65 if (shift) await userEvent.keyboard('{/Shift}');
66}
67
68test('toggle selection when checkbox is clicked', async () => {
69 await setup();

Callers 1

Calls 1

getRowByTextFunction · 0.85

Tested by

no test coverage detected