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
+31 -2
View File
@@ -519,7 +519,7 @@ describe("FinalReviewScreen — chip detail modal", () => {
).not.toBeInTheDocument();
});
it("closes the chip edit modal when Back is pressed", async () => {
it("closes the chip edit modal when the close control is pressed", async () => {
render(
<FinalReviewWithStateProbe
onState={() => {}}
@@ -532,12 +532,41 @@ describe("FinalReviewScreen — chip detail modal", () => {
fireEvent.click(await screen.findByRole("button", { name: "Signal" }));
const dialog = await screen.findByRole("dialog");
fireEvent.click(within(dialog).getByRole("button", { name: "Back" }));
expect(
within(dialog).getByRole("button", { name: "Remove" }),
).toBeInTheDocument();
expect(
within(dialog).queryByRole("button", { name: "Back" }),
).not.toBeInTheDocument();
fireEvent.click(within(dialog).getByLabelText("Close dialog"));
await waitFor(() => {
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
});
});
it("deselects a method chip from the footer Remove", async () => {
let latest: CreateFlowState = {};
render(
<FinalReviewWithStateProbe
onState={(s) => {
latest = s;
}}
initial={{
title: "Oak Park Commons",
selectedCommunicationMethodIds: ["signal"],
}}
/>,
);
fireEvent.click(await screen.findByRole("button", { name: "Signal" }));
const dialog = await screen.findByRole("dialog");
fireEvent.click(within(dialog).getByRole("button", { name: "Remove" }));
await waitFor(() => {
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
});
expect(latest.selectedCommunicationMethodIds ?? []).not.toContain("signal");
});
});
/**