Keep See-all method cards at the compact 142px tile height so expanded rows do not stretch with badges and wrapping copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-21 16:14:27 -06:00
co-authored by Cursor
parent 75ba0a214f
commit ef60175805
6 changed files with 75 additions and 32 deletions
+17 -3
View File
@@ -60,9 +60,23 @@ describe("CardStack Component", () => {
test("renders all cards in expanded (list) mode", () => {
render(<CardStack cards={SAMPLE_CARDS} expanded={true} />);
expect(screen.getByText("Option A")).toBeInTheDocument();
expect(screen.getByText("Option B")).toBeInTheDocument();
expect(screen.getByText("Option C")).toBeInTheDocument();
expect(screen.getAllByText("Option A").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("Option B").length).toBeGreaterThanOrEqual(1);
expect(screen.getAllByText("Option C").length).toBeGreaterThanOrEqual(1);
});
test("expanded tiles use the compact 142px CardSelection height", () => {
render(<CardStack cards={SAMPLE_CARDS} expanded={true} />);
const tiles = screen.getAllByRole("button", {
name: "Option A: Description A",
});
expect(tiles.length).toBeGreaterThan(0);
for (const tile of tiles) {
expect(tile.className).toMatch(/142px/);
expect(tile).toHaveClass("flex-col");
expect(tile).not.toHaveClass("flex-row");
}
});
test("shows See all toggle when hasMore is true", () => {