Skip to content

Commit d71aff9

Browse files
committed
test(layout): cover the exact default-size capacity boundary
Mutation testing found a survivor: flipping fitRows' <= to < at the default-size/shrink boundary still passed the suite because no test exercised rowCount exactly equal to the default-size capacity.
1 parent fde39a4 commit d71aff9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/layout.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ describe("fitRows", () => {
7070
});
7171
});
7272

73+
it("still uses the default size when row count exactly fills the default-size capacity", () => {
74+
// availableHeight 200 / DEFAULT_LINE_HEIGHT 24 = 8 rows exactly - the
75+
// boundary between "fits at default size" and "needs shrinking".
76+
const result = fitRows(8, 200);
77+
expect(result).toEqual({
78+
fontSize: 16,
79+
lineHeight: 24,
80+
visibleRowCount: 8,
81+
truncatedCount: 0,
82+
});
83+
});
84+
7385
it("shrinks proportionally when a modest reduction makes it fit", () => {
7486
const result = fitRows(14, 250);
7587
expect(result.truncatedCount).toBe(0);

0 commit comments

Comments
 (0)