QA pass: layout, create-flow, and About books #68

Merged
an.di merged 38 commits from adilallo/fix/CR-129-create-rule-button into main 2026-08-26 15:46:56 +00:00
2 changed files with 87 additions and 4 deletions
Showing only changes of commit e416f37940 - Show all commits
@@ -422,7 +422,7 @@ export function FinalReviewChipEditModal({
true,
coreCustomizeSnapshotRef.current,
draft?.groupKey === "coreValues" ? draft.value : null,
null,
draftFieldBlocks,
customizeHeaderDraft,
))
) {
@@ -605,7 +605,7 @@ export function FinalReviewChipEditModal({
true,
coreCustomizeSnapshotRef.current,
draft?.groupKey === "coreValues" ? draft.value : null,
null,
draftFieldBlocks,
customizeHeaderDraft,
))
) {
@@ -622,6 +622,7 @@ export function FinalReviewChipEditModal({
confirmDiscard,
customizeHeaderDraft,
draft,
draftFieldBlocks,
finalizeModalClose,
onInteract,
replaceState,
@@ -647,7 +648,7 @@ export function FinalReviewChipEditModal({
true,
coreCustomizeSnapshotRef.current,
draft.value,
null,
draftFieldBlocks,
customizeHeaderDraft,
))
) {
@@ -696,6 +697,7 @@ export function FinalReviewChipEditModal({
confirmDiscard,
customizeHeaderDraft,
draft,
draftFieldBlocks,
modalKebabMenu.duplicateTitleSuffix,
onEditTargetChange,
onInteract,
@@ -790,7 +792,7 @@ export function FinalReviewChipEditModal({
});
coreCustomizeSnapshotRef.current = captureMethodCardCustomizeSnapshot(
draft.value,
null,
draftFieldBlocks,
customizeHeaderDraft ?? {
title: target.chipLabel,
description: "",
@@ -802,6 +804,7 @@ export function FinalReviewChipEditModal({
coreCustomizeSaveDisabled,
customizeHeaderDraft,
draft,
draftFieldBlocks,
onInteract,
onSave,
state.customMethodCardFieldBlocksById,
+80
View File
@@ -438,6 +438,86 @@ describe("FinalReviewScreen — chip detail modal", () => {
).toBeInTheDocument();
});
it("closes a values chip without discard when nothing changed", async () => {
render(
<FinalReviewWithStateProbe
onState={() => {
/* noop */
}}
initial={{
selectedCoreValueIds: ["1"],
coreValuesChipsSnapshot: [
{ id: "1", label: "Accessibility", state: "selected" },
],
coreValueDetailsByChipId: {
"1": {
meaning: "Everyone can participate.",
signals: "Captions and ramps.",
},
},
customMethodCardFieldBlocksById: {
"1": [
{
kind: "text",
id: "facet-meaning",
blockTitle: "What this value means",
placeholderText: "Everyone can participate.",
},
{
kind: "text",
id: "facet-signals",
blockTitle: "Signals",
placeholderText: "Captions and ramps.",
},
],
},
}}
/>,
);
fireEvent.click(
await screen.findByRole("button", { name: "Accessibility" }),
);
const valuesDialog = await screen.findByRole("dialog");
expect(within(valuesDialog).getAllByRole("textbox").length).toBeGreaterThan(
0,
);
fireEvent.keyDown(document, { key: "Escape" });
await waitFor(() => {
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
});
expect(
screen.queryByRole("button", { name: "Keep editing" }),
).not.toBeInTheDocument();
});
it("closes a method chip without discard when nothing changed", async () => {
render(
<FinalReviewWithStateProbe
onState={() => {
/* noop */
}}
initial={{
title: "Oak Park Commons",
selectedCommunicationMethodIds: ["signal"],
}}
/>,
);
fireEvent.click(await screen.findByRole("button", { name: "Signal" }));
const methodDialog = await screen.findByRole("dialog");
expect(within(methodDialog).getAllByRole("textbox").length).toBeGreaterThan(
0,
);
fireEvent.keyDown(document, { key: "Escape" });
await waitFor(() => {
expect(screen.queryByRole("dialog")).not.toBeInTheDocument();
});
expect(
screen.queryByRole("button", { name: "Keep editing" }),
).not.toBeInTheDocument();
});
});
/**