Skip to content

Commit f736a3b

Browse files
committed
test onColumnResize
1 parent f60e759 commit f736a3b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/browser/column/resizable.test.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ test('should use the minWidth if specified on auto resize', async () => {
149149
});
150150

151151
test('should remeasure flex columns when resizing a column', async () => {
152+
const onColumnResize = vi.fn();
152153
setup<
153154
{
154155
readonly col1: string;
@@ -180,13 +181,18 @@ test('should remeasure flex columns when resizing a column', async () => {
180181
col2: 'a'.repeat(10),
181182
col3: 'a'.repeat(10)
182183
}
183-
]
184+
],
185+
onColumnResize
184186
});
185187
const grid = getGrid();
186188
await expect.element(grid).toHaveStyle({ gridTemplateColumns: '639.328px 639.328px 639.344px' });
187189
const [col1] = getHeaderCells();
188190
await autoResize(col1);
189191
await expect.element(grid).toHaveStyle({ gridTemplateColumns: '79.1406px 919.422px 919.438px' });
192+
expect(onColumnResize).toHaveBeenCalled();
193+
onColumnResize.mockClear();
194+
// if the width is the same, don't call onColumnResize
190195
await autoResize(col1);
191196
await expect.element(grid).toHaveStyle({ gridTemplateColumns: '79.1406px 919.422px 919.438px' });
197+
expect(onColumnResize).not.toHaveBeenCalled();
192198
});

0 commit comments

Comments
 (0)