Skip to content

Add tests for column widths and resizing - #4254

Merged
nstepien merged 10 commits into
mainfrom
column-width-tests
Nov 2, 2026
Merged

nstepien merged 10 commits into
mainfrom
column-width-tests

Conversation

@nstepien

Copy link
Copy Markdown
Collaborator

Adds the tests from #4005 that run on main, so that #4005's test changes are limited to the behavior that it changes.

17 tests that pass on main:

  • resizable.test.tsx:
    • a new columnWidths map discards the measured and resized widths;
    • without onColumnWidthsChange, the map only sets the initial widths;
    • the widths from the map are clamped;
    • resized widths are kept when the grid is resized, when the maxWidth is lowered temporarily, and when onColumnWidthsChange is removed;
    • auto-sizing that doesn't change a column's width doesn't mark it as resized.
  • width.test.tsx, a new file:
    • a new width is used;
    • a column whose width changes from a number to auto is measured;
    • a measured width is kept when the minWidth exceeds it temporarily;
    • opening the grid in a dialog doesn't cause a ResizeObserver loop error;
    • auto columns are at least as wide as their content.
  • virtualization.test.ts: columns outside the viewport keep their width, and disabled virtualization works with frozen columns wider than the grid.
  • crossWindow.test.tsx: the grid works in a window without ResizeObserver.
  • dragFill.test.tsx: the drag handle doesn't get the column's width constraints.
  • ssr.test.tsx: all the columns are rendered on the server when virtualization is disabled.

3 tests marked test.fails(), for behavior that #4005 changes. They failed in all three browsers in 5 local runs on main:

  • The measured width of a column that isn't rendered is kept in the widths passed to onColumnWidthsChange. Refactor column width and resizing handling #4005 drops it.
  • A measured width passed via columnWidths is used as is, e.g., a 1500px column in a 1000px grid. Refactor column width and resizing handling #4005 measures the column again.
  • An auto column next to a percentage column that is clamped to its maxWidth is measured as if the percentage column weren't clamped, so the columns leave a gap at the end of the grid.

Left in #4005:

vp run ci passes.

🤖 Generated with Claude Code

nstepien and others added 10 commits October 27, 2026 04:53
Tests from #4005 that run on main:
- 17 tests that pass.
- 3 tests marked test.fails(), for behavior that #4005 changes: the measured widths of columns that aren't rendered are kept, measured widths passed via columnWidths are used as is, and an auto column next to a percentage column clamped to its maxWidth leaves a gap at the end of the grid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nstepien
nstepien marked this pull request as ready for review November 2, 2026 04:30
@nstepien
nstepien merged commit 50e9885 into main Nov 2, 2026
6 checks passed
@nstepien
nstepien deleted the column-width-tests branch November 2, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant