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
456 changes: 456 additions & 0 deletions apps/mission-control/e2e/p5-models-slice.spec.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions apps/mission-control/src/app/AppContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ export function AppContent(props: AppContentProps) {
settings={props.settings}
strategyController={props.strategyController}
onRefresh={props.onRefreshBaseline}
activeRoomId={props.activeRoomId}
authProfiles={props.missionControl.authProfiles}
/>
</TabBoundaryPane>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,19 @@ describe("PinRoomToOffice", () => {
});

it("renders nothing for rooms that cannot be pinned yet", async () => {
await render("models");
await render("reef");
expect(container.querySelector("button")).toBeNull();
});

it("offers the Models & Providers pin under its room label", async () => {
await render("models");
const button = pinButton();
expect(button).toBeTruthy();
expect(button?.getAttribute("aria-label")).toBe(
"Pin Models & Providers to Office",
);
});

it("offers the Connectors pin under its room label", async () => {
await render("connectors");
const button = pinButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,12 @@ export const OFFICE_BLOCK_REGISTRY: readonly OfficeBlockDef[] = [
defaultSize: "s",
defaultVisible: false,
},
{
id: "models",
rendererKey: "room-shortcut",
roomId: "models",
title: "Models & Providers",
defaultSize: "s",
defaultVisible: false,
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ describe("OFFICE_BLOCK_REGISTRY room shortcuts", () => {
expect(connectors?.roomId).toBe("connectors");
expect(connectors?.defaultVisible).toBe(false);
});

test("registers the Models & Providers room shortcut hidden by default", () => {
const models = OFFICE_BLOCK_REGISTRY.find((def) => def.id === "models");
expect(models).toBeDefined();
expect(models?.rendererKey).toBe("room-shortcut");
expect(models?.roomId).toBe("models");
expect(models?.defaultVisible).toBe(false);
});
});

describe("pinRoomBlocksToOffice", () => {
Expand Down Expand Up @@ -272,8 +280,16 @@ describe("pinRoomBlocksToOffice", () => {
).toHaveLength(1);
});

test("fails honestly for rooms with no registered Office block yet", () => {
test("pins the Models room through its models block", () => {
const result = pinRoomBlocksToOffice("models");
expect(result.ok).toBe(true);
expect(result.pinned).toEqual(["models"]);
const layout = loadGlassConfig().layout ?? [];
expect(layout.find((entry) => entry.id === "models")?.visible).toBe(true);
});

test("fails honestly for rooms with no registered Office block yet", () => {
const result = pinRoomBlocksToOffice("reef");
expect(result.ok).toBe(false);
expect(result.error).toMatch(/pin/i);
expect(loadGlassConfig().layout).toBeUndefined();
Expand Down
Loading
Loading