Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions apps/mission-control/e2e/p5-connectors-slice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ test("@core @p5-connectors connectors/setup room identity, pin-to-office, and th

await completeQuickstartLocalOnboarding(page);

// Neither room lamp exists until the Connectors page is enabled.
// Setup is the recovery authority and remains available independently;
// only the optional Connectors room waits for its feature switch.
await expect(page.locator('button[title="BF · Connectors"]')).toHaveCount(0);
await expect(page.locator('button[title="BF · Setup"]')).toHaveCount(0);
await expect(page.locator('button[title="BF · Setup"]')).toHaveCount(1);
await setConnectorsPage(page, true);
await expect(page.locator('button[title="BF · Connectors"]')).toHaveCount(1);
await expect(page.locator('button[title="BF · Setup"]')).toHaveCount(1);
Expand All @@ -76,26 +77,46 @@ test("@core @p5-connectors connectors/setup room identity, pin-to-office, and th
"Installed registry",
);

// The Setup room is its own stable identity and lands on Setup.
// The Setup room is its own stable identity and lands on its distinct
// product surface, not the connector tabs; it offers no Connectors pin —
// one door must not ambiguously open both rooms.
await page.locator('button[title="BF · Setup"]').click();
await expect(activeRooms).toHaveCount(1);
await expect(activeRooms).toHaveAttribute("title", "BF · Setup");
await expect(page.getByTestId("setup-room-page")).toBeVisible();
await expect(page.getByTestId("setup-room-page")).toContainText(
"Gateway connection",
);
await expect(page.locator(".mc-connectors-tab-bar")).toHaveCount(0);
await expect(
page.getByRole("button", { name: "Pin Connectors to Office" }),
).toHaveCount(0);

// Connector quick setup stays reachable inside the Connectors room, and
// internal tab clicks never move the lamp.
await page.locator('button[title="BF · Connectors"]').click();
await expect(activeRooms).toHaveAttribute("title", "BF · Connectors");
await expect(activeConnectorsTab(page)).toHaveText(/^Registry/);
await page
.locator(".mc-connectors-tab-bar")
.getByRole("button", { name: "Setup", exact: true })
.click();
await expect(activeConnectorsTab(page)).toHaveText("Setup");
await expect(page.getByTestId("connectors-page")).toContainText(
"Quick Setup",
);

// Internal tab clicks never move the lamp, and the Setup room offers no
// Connectors pin — one door must not ambiguously open both rooms.
await page.getByRole("button", { name: /^Catalog/ }).click();
await expect(activeRooms).toHaveAttribute("title", "BF · Connectors");
await page
.locator(".mc-connectors-tab-bar")
.getByRole("button", { name: /^Catalog/ })
.click();
await expect(activeConnectorsTab(page)).toHaveText(/^Catalog/);
await expect(activeRooms).toHaveAttribute("title", "BF · Setup");
await expect(
page.getByRole("button", { name: "Pin Connectors to Office" }),
).toHaveCount(0);
await expect(activeRooms).toHaveAttribute("title", "BF · Connectors");

// Returning to the Connectors room is a real room change: it relands on
// Registry and offers the pin.
// Returning after visiting the Setup room is a real room change: it
// relands on Registry and offers the pin.
await page.locator('button[title="BF · Setup"]').click();
await expect(page.getByTestId("setup-room-page")).toBeVisible();
await page.locator('button[title="BF · Connectors"]').click();
await expect(activeRooms).toHaveAttribute("title", "BF · Connectors");
await expect(activeConnectorsTab(page)).toHaveText(/^Registry/);
Expand Down Expand Up @@ -233,12 +254,12 @@ test("@core @p5-connectors connectors/setup room identity, pin-to-office, and th
await expect(activeRooms).toHaveAttribute("title", "BF · Connectors");
await expect(activeConnectorsTab(page)).toHaveText(/^Registry/);

// Turning the Connectors page off removes both room lamps; the persisted
// door stays visible but refuses honestly instead of dying silently.
// Turning the Connectors page off removes only its lamp; Setup remains
// available to restore it, while the persisted Connectors door refuses.
await setConnectorsPage(page, false);
await page.locator('[data-tour-id="nav-assistant"]').click();
await expect(page.locator('button[title="BF · Connectors"]')).toHaveCount(0);
await expect(page.locator('button[title="BF · Setup"]')).toHaveCount(0);
await expect(page.locator('button[title="BF · Setup"]')).toHaveCount(1);
await page
.getByTestId("office-block-connectors")
.getByRole("button", { name: "Open Connectors" })
Expand Down
32 changes: 17 additions & 15 deletions apps/mission-control/e2e/p5-directory-slice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ test("@core @p5-directory directory room identity, Front Desk authority, Mail/Fi
// Acknowledge drives the real seam; reopening the thread shows the new
// authoritative ack state.
await mailPage.getByRole("button", { name: "Acknowledge" }).click();
await expect(page.locator(".mc-toast").first()).toContainText(
"Message acknowledged.",
);
await expect(
page.locator(".mc-toast").filter({ hasText: "Message acknowledged." }),
).toBeVisible();
await threadItems.filter({ hasText: "Front desk handoff 2" }).click();
await threadItems.filter({ hasText: "Front desk handoff 1" }).click();
await expect(mailPage).toContainText("1/1 acknowledged");
Expand All @@ -291,9 +291,9 @@ test("@core @p5-directory directory room identity, Front Desk authority, Mail/Fi
await composeBody.fill("Fresh handoff note from the front desk");
const mutationsBeforeSend = sensitiveMutations.length;
await mailPage.getByRole("button", { name: "Send", exact: true }).click();
await expect(page.locator(".mc-toast").first()).toContainText(
"Message sent.",
);
await expect(
page.locator(".mc-toast").filter({ hasText: "Message sent." }),
).toBeVisible();
await expect(composeBody).toHaveValue("");
await expect(
threadItems.filter({ hasText: "Front desk handoff 1" }),
Expand All @@ -317,9 +317,11 @@ test("@core @p5-directory directory room identity, Front Desk authority, Mail/Fi
// request that could pretend success.
await dismissVisibleToasts(page);
await mailPage.getByRole("button", { name: "Send", exact: true }).click();
await expect(page.locator(".mc-toast").first()).toContainText(
"Message body cannot be empty.",
);
await expect(
page
.locator(".mc-toast")
.filter({ hasText: "Message body cannot be empty." }),
).toBeVisible();
await dismissVisibleToasts(page);

// Search filters the authoritative list; the filtered empty state offers a
Expand Down Expand Up @@ -391,9 +393,9 @@ test("@core @p5-directory directory room identity, Front Desk authority, Mail/Fi
await expect(releaseDialog).toContainText("src/area-7/**");
const mutationsBeforeRelease = sensitiveMutations.length;
await releaseDialog.getByRole("button", { name: "Release" }).click();
await expect(page.locator(".mc-toast").first()).toContainText(
"Lease released.",
);
await expect(
page.locator(".mc-toast").filter({ hasText: "Lease released." }),
).toBeVisible();
// Live shrink to one page: the stored page clamps instead of lingering.
await expect(mailPage).toContainText("6 active file lock(s)");
await expect(leasePagination).toHaveCount(0);
Expand Down Expand Up @@ -421,9 +423,9 @@ test("@core @p5-directory directory room identity, Front Desk authority, Mail/Fi
await leaseDialog
.getByRole("button", { name: "Reserve file lock" })
.click();
await expect(page.locator(".mc-toast").first()).toContainText(
"Lease created: docs/**/*",
);
await expect(
page.locator(".mc-toast").filter({ hasText: "Lease created: docs/**/*" }),
).toBeVisible();
await expect(mailPage).toContainText("7 active file lock(s)");
await expect(leasePagination.locator(".mc-pagination-info")).toHaveText(
"1 / 2",
Expand Down
Loading
Loading