Skip to content

Commit 81683b8

Browse files
committed
test(plugin-detail): call framelessSectionColumns with the count alone, and pin its two-column cap
The section-columns helper took a second argument (the cap beside a 320 px right column), so passing it straight to Array.map handed it the index as a cap: a type error in the test project, and a cap nobody meant at runtime. Claude-Session: https://claude.ai/code/session_01Utp6CaA9ZdTcj97mzGtHYt Co-authored-by: Claude <noreply@anthropic.com>
1 parent 30a9e15 commit 81683b8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎ui/packages/plugin-detail/src/__tests__/recordPageV3Face-27055.test.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ const gridOf = (container: HTMLElement) =>
5353

5454
describe('framelessSectionColumns — 1–3 columns by the fields a section shows', () => {
5555
it('one field one column, two to five two, six and more three', () => {
56-
expect([0, 1, 2, 5, 6, 12].map(framelessSectionColumns)).toEqual([1, 1, 2, 2, 3, 3]);
56+
expect([0, 1, 2, 5, 6, 12].map((n) => framelessSectionColumns(n))).toEqual([1, 1, 2, 2, 3, 3]);
57+
});
58+
59+
it('never more than the cap: two beside a 320 px right column (objectstack#27524)', () => {
60+
expect([0, 1, 2, 6, 12].map((n) => framelessSectionColumns(n, 2))).toEqual([1, 1, 2, 2, 2]);
5761
});
5862
});
5963

0 commit comments

Comments
 (0)