QA pass: layout, create-flow, and About books #68
@@ -422,7 +422,7 @@ export function FinalReviewChipEditModal({
|
|||||||
true,
|
true,
|
||||||
coreCustomizeSnapshotRef.current,
|
coreCustomizeSnapshotRef.current,
|
||||||
draft?.groupKey === "coreValues" ? draft.value : null,
|
draft?.groupKey === "coreValues" ? draft.value : null,
|
||||||
null,
|
draftFieldBlocks,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
@@ -605,7 +605,7 @@ export function FinalReviewChipEditModal({
|
|||||||
true,
|
true,
|
||||||
coreCustomizeSnapshotRef.current,
|
coreCustomizeSnapshotRef.current,
|
||||||
draft?.groupKey === "coreValues" ? draft.value : null,
|
draft?.groupKey === "coreValues" ? draft.value : null,
|
||||||
null,
|
draftFieldBlocks,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
@@ -622,6 +622,7 @@ export function FinalReviewChipEditModal({
|
|||||||
confirmDiscard,
|
confirmDiscard,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
draft,
|
draft,
|
||||||
|
draftFieldBlocks,
|
||||||
finalizeModalClose,
|
finalizeModalClose,
|
||||||
onInteract,
|
onInteract,
|
||||||
replaceState,
|
replaceState,
|
||||||
@@ -647,7 +648,7 @@ export function FinalReviewChipEditModal({
|
|||||||
true,
|
true,
|
||||||
coreCustomizeSnapshotRef.current,
|
coreCustomizeSnapshotRef.current,
|
||||||
draft.value,
|
draft.value,
|
||||||
null,
|
draftFieldBlocks,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
@@ -696,6 +697,7 @@ export function FinalReviewChipEditModal({
|
|||||||
confirmDiscard,
|
confirmDiscard,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
draft,
|
draft,
|
||||||
|
draftFieldBlocks,
|
||||||
modalKebabMenu.duplicateTitleSuffix,
|
modalKebabMenu.duplicateTitleSuffix,
|
||||||
onEditTargetChange,
|
onEditTargetChange,
|
||||||
onInteract,
|
onInteract,
|
||||||
@@ -790,7 +792,7 @@ export function FinalReviewChipEditModal({
|
|||||||
});
|
});
|
||||||
coreCustomizeSnapshotRef.current = captureMethodCardCustomizeSnapshot(
|
coreCustomizeSnapshotRef.current = captureMethodCardCustomizeSnapshot(
|
||||||
draft.value,
|
draft.value,
|
||||||
null,
|
draftFieldBlocks,
|
||||||
customizeHeaderDraft ?? {
|
customizeHeaderDraft ?? {
|
||||||
title: target.chipLabel,
|
title: target.chipLabel,
|
||||||
description: "",
|
description: "",
|
||||||
@@ -802,6 +804,7 @@ export function FinalReviewChipEditModal({
|
|||||||
coreCustomizeSaveDisabled,
|
coreCustomizeSaveDisabled,
|
||||||
customizeHeaderDraft,
|
customizeHeaderDraft,
|
||||||
draft,
|
draft,
|
||||||
|
draftFieldBlocks,
|
||||||
onInteract,
|
onInteract,
|
||||||
onSave,
|
onSave,
|
||||||
state.customMethodCardFieldBlocksById,
|
state.customMethodCardFieldBlocksById,
|
||||||
|
|||||||
@@ -438,6 +438,86 @@ describe("FinalReviewScreen — chip detail modal", () => {
|
|||||||
).toBeInTheDocument();
|
).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();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user