Import the remade decks on stable ids and recommend one card per job, so a saved draft still loads after a chip is renamed.

The real-group profiles stay as a test, so a change that moves a pick fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilalloandCursor committed 2026-11-04 14:22:54 -07:00
1 parent 96ca15d8e3
commit bcbc6f30d9
89 files changed
+36555 -2828

No files matched your search

@@ -35,7 +35,7 @@ async function declineDiscardCustomizeEdits() {
/**
* Mounts the screen with optional starting state and exposes the latest
* `state` to the test harness so we can assert the persistence side of
* the Add Platform flow without driving the wizard's Next chain.
* the Add card flow without driving the wizard's Next chain.
*/
const EMPTY_STATE: CreateFlowState = {};
@@ -62,7 +62,7 @@ function ScreenWithStateProbe({
* snapping back to preset copy. See {@link CommunicationMethodEditFields}
* and `buildPublishPayload` for the read side.
*/
describe("CommunicationMethodsScreen — Add Platform persistence", () => {
describe("CommunicationMethodsScreen — Add card persistence", () => {
it("starts empty and Generate draft inserts the catalog preset", async () => {
let latest: CreateFlowState = {};
render(
@@ -74,7 +74,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
@@ -96,7 +96,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
fireEvent.change(corePrincipleField, { target: { value: "Custom principle" } });
fireEvent.click(
within(dialog).getByRole("button", {
name: "Add Platform",
name: "Add card",
}),
);
@@ -122,7 +122,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
void dialog;
@@ -157,7 +157,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
void latest;
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textareas = within(dialog).getAllByRole(
@@ -190,7 +190,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textareas = within(dialog).getAllByRole(
@@ -259,7 +259,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textareas = within(dialog).getAllByRole(
@@ -283,7 +283,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
fireEvent.click(within(dialog).getByRole("button", { name: "More options" }));
@@ -312,7 +312,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
fireEvent.click(within(dialog).getByRole("button", { name: "More options" }));
@@ -344,7 +344,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textboxes = within(dialog).getAllByRole(
@@ -387,7 +387,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textboxes = within(dialog).getAllByRole(
@@ -448,7 +448,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
await screen.findByText("Custom policy details"),
).toBeInTheDocument();
expect(
screen.getByRole("button", { name: "Core Principle & Scope" }),
screen.getByRole("button", { name: "Core principle and scope" }),
).toBeInTheDocument();
fireEvent.click(screen.getByRole("button", { name: "Finalize policy" }));
@@ -470,7 +470,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
for (const button of within(dialog).getAllByRole("button", {
@@ -490,11 +490,11 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
await screen.findByText("Custom policy details"),
).toBeInTheDocument();
fireEvent.click(
screen.getByRole("button", { name: "Core Principle & Scope" }),
screen.getByRole("button", { name: "Core principle and scope" }),
);
expect(await screen.findByText("Add text block")).toBeInTheDocument();
expect(
screen.getByDisplayValue(/We prioritize privacy and security/i),
screen.getByDisplayValue(/Signal encrypts every message/i),
).toBeInTheDocument();
fireEvent.click(screen.getByRole("button", { name: "Back" }));
fireEvent.click(screen.getByRole("button", { name: "Back" }));
@@ -526,7 +526,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const cardDialog = await screen.findByRole("dialog");
fireEvent.click(
@@ -585,9 +585,9 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
? (document.getElementById(labelledby)?.textContent ?? "").trim()
: "";
});
expect(labels[0]).toMatch(/Logistics, Admin/);
expect(labels[1]).toMatch(/Code of Conduct/);
expect(labels[2]).toMatch(/Core Principle/);
expect(labels[0]).toMatch(/How it works/);
expect(labels[1]).toMatch(/Norms/);
expect(labels[2]).toMatch(/Core principle/);
});
it("does not block tab close when the create modal is unchanged", async () => {
@@ -600,7 +600,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
await screen.findByRole("dialog");
expect(dispatchBeforeUnload()).toBe(false);
@@ -616,7 +616,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
const textboxes = within(dialog).getAllByRole(
@@ -636,7 +636,7 @@ describe("CommunicationMethodsScreen — Add Platform persistence", () => {
);
fireEvent.click(
screen.getAllByRole("button", { name: /Signal: Encrypted messaging/ })[0],
screen.getAllByRole("button", { name: /Signal: We coordinate in encrypted Signal groups/ })[0],
);
const dialog = await screen.findByRole("dialog");
fireEvent.click(within(dialog).getByRole("button", { name: "More options" }));