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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user