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

Function resizeCol

packages/react-aria/test/table/ariaTableResizing.test.tsx:38–51  ·  view source on GitHub ↗
(tree, col, delta)

Source from the content-addressed store, hash-verified

36}
37
38function resizeCol(tree, col, delta) {
39 act(() => {
40 setInteractionModality('pointer');
41 });
42 let column = getColumn(tree, col);
43 let resizer = within(column).getByRole('slider');
44
45 fireEvent.pointerEnter(resizer);
46
47 // actual locations do not matter, the delta matters between events for the calculation of useMove
48 fireEvent.pointerDown(resizer, {pointerType: 'mouse', pointerId: 1, pageX: 0, pageY: 30});
49 fireEvent.pointerMove(resizer, {pointerType: 'mouse', pointerId: 1, pageX: delta, pageY: 25});
50 fireEvent.pointerUp(resizer, {pointerType: 'mouse', pointerId: 1});
51}
52
53function resizeTable(clientWidth, newValue) {
54 clientWidth.mockImplementation(() => newValue);

Callers 1

resizingTestsFunction · 0.70

Calls 3

setInteractionModalityFunction · 0.90
actFunction · 0.85
getColumnFunction · 0.70

Tested by

no test coverage detected