Show a footer Remove on selected create-flow modules so removal is not kebab-only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-09-02 14:45:56 -06:00
co-authored by Cursor
parent df7051f33a
commit 84ef943df4
23 changed files with 251 additions and 16 deletions
+35
View File
@@ -169,6 +169,41 @@ describe("Create", () => {
expect(screen.getByText("Custom Footer")).toBeInTheDocument();
});
it("renders a danger Remove in the left footer when showRemoveButton is true", () => {
const onRemove = vi.fn();
renderWithProviders(
<Create
{...defaultProps}
showBackButton={false}
showRemoveButton
onRemove={onRemove}
showNextButton
nextButtonText="Save"
/>,
);
const removeButton = screen.getByRole("button", { name: "Remove" });
expect(removeButton).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Back" })).not.toBeInTheDocument();
fireEvent.click(removeButton);
expect(onRemove).toHaveBeenCalledTimes(1);
});
it("prefers Remove over Back when both would occupy the left slot", () => {
renderWithProviders(
<Create
{...defaultProps}
showBackButton
showRemoveButton
onBack={vi.fn()}
onRemove={vi.fn()}
showNextButton
nextButtonText="Save"
/>,
);
expect(screen.getByRole("button", { name: "Remove" })).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Back" })).not.toBeInTheDocument();
});
it("uses responsive width at baseline (matches Login modal)", () => {
renderWithProviders(
<Create {...defaultProps}>Create dialog content</Create>,