Standardize create-flow option steps on one question-and-options layout and Selection sizes.
Method cards, chips, and the right rail now share the two-column shell; last options clear the footer fade, See all stays under the stack, and the left heading no longer jumps when the list expands. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2fc7fbf818
commit
24a9615c0c
26 files changed
+354
-245
No files matched your search
@@ -54,6 +54,33 @@ describe("Selection Component", () => {
|
||||
|
||||
const card = screen.getByRole("button");
|
||||
expect(card).toHaveClass("flex-row");
|
||||
expect(card).toHaveAttribute("data-selection-size", "l");
|
||||
});
|
||||
|
||||
it("maps size s to a chip with accessible selected state", () => {
|
||||
render(
|
||||
<Selection
|
||||
label="Open membership"
|
||||
supportText="Anyone can join"
|
||||
size="s"
|
||||
selected
|
||||
/>,
|
||||
);
|
||||
|
||||
const chip = screen.getByRole("button", {
|
||||
name: "Open membership: Anyone can join",
|
||||
});
|
||||
expect(chip).toHaveAttribute("aria-pressed", "true");
|
||||
expect(chip).toHaveTextContent("Open membership");
|
||||
expect(screen.queryByText("Anyone can join")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("uses size m for compact tiles and exposes aria-pressed", () => {
|
||||
render(<Selection {...defaultProps} size="m" selected />);
|
||||
|
||||
const card = screen.getByRole("button");
|
||||
expect(card).toHaveAttribute("data-selection-size", "m");
|
||||
expect(card).toHaveAttribute("aria-pressed", "true");
|
||||
});
|
||||
|
||||
it("does not render a helper icon by default", () => {
|
||||
|
||||
Reference in new issue
Block a user