Skip to content

Commit 852a7b5

Browse files
committed
Fix tests
1 parent a4672d6 commit 852a7b5

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/hooks/useColumnWidths.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ export function useColumnWidths<R, SR>(
110110

111111
if (onColumnResize) {
112112
const previousWidth = resizedColumnWidths.get(resizingKey);
113-
const newWidth =
114-
typeof nextWidth === 'number' ? nextWidth : measureColumnWidth(gridRef, resizingKey);
113+
const newWidth = measureColumnWidth(gridRef, resizingKey);
115114
if (newWidth !== undefined && newWidth !== previousWidth) {
116115
onColumnResize(column, newWidth);
117116
}

test/browser/column/resizable.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ test('should resize column when dragging the handle', async () => {
7272
const [, col2] = getHeaderCells();
7373
await resize({ column: col2, resizeBy: -50 });
7474
await expect.element(grid).toHaveStyle({ gridTemplateColumns: '100px 150px' });
75-
expect(onColumnResize).toHaveBeenCalledWith(expect.objectContaining(columns[1]), 150);
75+
expect(onColumnResize).toHaveBeenCalledExactlyOnceWith(expect.objectContaining(columns[1]), 150);
7676
});
7777

7878
test('should use the maxWidth if specified', async () => {

website/routes/CommonFeatures.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function getColumns(
9696
{
9797
key: 'title',
9898
name: 'Task',
99-
maxWidth: 200,
10099
frozen: true,
101100
renderEditCell: textEditor,
102101
renderSummaryCell({ row }) {

0 commit comments

Comments
 (0)