mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:13:29 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Core manages chat authorization, AI connection defaults, navigation, and the plugin host. > - Core still writes old default rows and checks an Agent Chat flag that always reads true. > - It also carries a desktop rail that cannot open and private aliases with canonical equivalents. > - This pull request removes those paths and moves their tests onto the paths Core uses. > - The result is fewer Core database operations and less code to maintain. ## Linked Issues or Issue Description **What existing behavior does this improve?** Core AI default writes, Agent Chat execution and delivery, private plugin host and Runner setup, and board navigation. **Subsystem affected** Cross-cutting. Core server, board UI, private Runner helpers, and a repository guard script. **Current behavior** The server writes provider-scoped and per-method AI defaults, then reads only the provider-scoped rows. It reads settings to decide whether to block Agent Chat, although every settings view enables it. The desktop sidebar renders expanded while still tracking requests to open and close a retired icon rail. The agent client retries conflicts that the server already resolves when there is exactly one active match. **Proposed behavior** Write provider-scoped defaults directly. Use the existing Agent Chat authorization and retry checks without the redundant settings reads. Render the current sidebar directly and let the API report true agent reference conflicts. **Reason and benefit** A personal non-custom connection save or explicit default selection sends one fewer SQL statement. It also avoids the provider-default write that the legacy trigger performed when the old statement inserted or updated a row. A successful task-to-chat send or receipt replay avoids two transaction settings SELECTs when the singleton row already exists. Conversation comment, wake release, and retry paths also avoid a transaction settings read when they previously entered the gate. Savings in other settings paths depend on cache hits. Core-to-plugin RPC and plugin-to-Launcher HTTP traffic stay the same. **Breaking changes** The public plugin SDK, host navigation, and organization-switcher fields retain their existing interfaces and behavior. The settings API still accepts and reports the Agent Chat compatibility key. This change needs no schema migration or rollout ordering. **Additional context** Refs #10610 for prior reporting on the retired sidebar rail. Refs #21756 for adjacent Coordinator plugin slots, which remain a separate change. ## What Changed - Stop writing per-method AI defaults. Preserve the provider-scope upsert and first-account behavior. Keep the existing tables and migration trigger. - Remove Agent Chat checks that read a constant true value. Keep conversation ownership, task scope, session, and request-retry checks. - Remove unused lock-owner fields and private plugin lifecycle, secret extraction, Gmail connector, PRP setup, heartbeat resolver, and ACPX aliases. - Use a single API request for agent references. Remove retired sidebar rail state, hooks, and branches across the active and production snapshot layouts. Preserve desktop resizing, mobile drawer controls, contextual navigation, and public plugin slot inputs. - Remove unused FeedCard and AgentDetail inputs and the test-only Git push matcher alias. - Keep the cleanup that erases historical plaintext chat retries from browser storage. Production source in the touched files is 106,800 → 105,633 nonblank lines, down 1,167. The production Git diff adds 251 physical lines and removes 1,480, down 1,229. Those figures exclude tests, fixtures, docs, and Storybook. The entire Git diff adds 482 physical lines and removes 2,325, down 1,843. ## Verification - Merged master at `b56f240f45` into the PR branch as `f73fea4009`. The five sidebar files retain the expanded navigation cleanup and master’s explicit session-replay masking contract. The merge also preserves master’s account-repair recovery guard and GitHub star-prompt behavior. - Focused UI Vitest run passed 361 tests across 11 files. This covers analytics privacy and replay masking, sidebar and layout, GitHub star prompt, and agent detail. - Focused server Vitest run passed 45 tests across three files. This covers restored configuration handling, conversation recovery, and Agent Chat authority and receipt replay. - `pnpm --filter @paperclipai/ui typecheck`, the Git push guard and its 14 tests, and `git diff --check origin/master...HEAD` passed. - `pnpm verify --base origin/master` classified the Git-push guard as a global CI input and returned exit 2. GitHub CI supplied the broader coverage. - GitHub CI and Runner image checks passed on `f73fea4009`. Both required checks, `ci / verify` and `ci / e2e`, passed. [CI workflow](https://github.com/paperclipai/paperclip/actions/runs/44181261752) · [Runner image workflow](https://github.com/paperclipai/paperclip/actions/runs/44181261413) - Standard Greptile reported 5/5 with no actionable findings or open review threads. [Greptile review](https://github.com/paperclipai/paperclip/pull/22055#issuecomment-6959078925) - The optional Superagent Security Scan finished neutral with an inconclusive workflow result and zero annotations. The final rollup had 61 successes, five skips, and one neutral, with no failed or pending checks. [PR checks](https://github.com/paperclipai/paperclip/pull/22055/checks) ## Risks Agent Chat authorization and retry are sensitive to small query changes. The final diff keeps the conversation agent field and all existing authorization and idempotency checks. The tests cover revoked defaults, legacy migration reads, bound-listener authority, and mobile and desktop navigation. Installations that still run software old enough to read the per-method AI table will no longer see new defaults in that table. Current Core reads the provider-scoped table. ## Model Used OpenAI Codex, GPT-6.1 Sol (`gpt-6.1-sol`), with source inspection and shell-based tests. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
395 lines
16 KiB
TypeScript
395 lines
16 KiB
TypeScript
// @vitest-environment jsdom
|
|
|
|
import { act, useEffect, type ComponentProps, type ReactNode } from "react";
|
|
import { createRoot, type Root } from "react-dom/client";
|
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
import { BreadcrumbProvider, useBreadcrumbs } from "../context/BreadcrumbContext";
|
|
import { BreadcrumbBar } from "./BreadcrumbBar";
|
|
import { CoordinatorAgentSwitcher } from "./CoordinatorAgentSwitcher";
|
|
import type { Agent } from "@paperclipai/shared";
|
|
|
|
const viewport = vi.hoisted(() => ({ isMobile: false }));
|
|
const navigate = vi.hoisted(() => vi.fn());
|
|
const chatAgents = vi.hoisted(() => [
|
|
{ id: "first", name: "CodexCoder", role: "engineer", status: "idle" },
|
|
{ id: "second", name: "Designer", role: "designer", status: "idle" },
|
|
]);
|
|
|
|
vi.mock("@/hooks/useAgentChatNavigation", () => ({
|
|
useAgentChatNavigation: () => ({
|
|
agents: { data: chatAgents, isPending: false, error: null },
|
|
chats: { data: [] },
|
|
}),
|
|
}));
|
|
|
|
vi.mock("@/lib/router", () => ({
|
|
useNavigate: () => navigate,
|
|
Link: ({ children, to, ...props }: ComponentProps<"a"> & { to: string }) => (
|
|
<a {...props} href={to}>{children}</a>
|
|
),
|
|
}));
|
|
|
|
vi.mock("../context/SidebarContext", () => ({
|
|
useSidebar: () => ({
|
|
isMobile: viewport.isMobile,
|
|
toggleSidebar: vi.fn(),
|
|
}),
|
|
}));
|
|
|
|
vi.mock("../context/CompanyContext", () => ({
|
|
useCompany: () => ({ selectedCompanyId: "company-1", selectedCompany: { issuePrefix: "TES" } }),
|
|
}));
|
|
|
|
vi.mock("../context/PanelContext", () => ({
|
|
usePanel: () => ({ panelVisible: true, togglePanelVisible: vi.fn() }),
|
|
}));
|
|
|
|
vi.mock("@/plugins/slots", () => ({
|
|
usePluginSlots: () => ({ slots: [] }),
|
|
PluginSlotOutlet: () => null,
|
|
}));
|
|
|
|
vi.mock("@/plugins/launchers", () => ({
|
|
usePluginLaunchers: () => ({ launchers: [] }),
|
|
PluginLauncherOutlet: () => null,
|
|
}));
|
|
|
|
function TaskBreadcrumbs({
|
|
onOpen,
|
|
panelControl,
|
|
taskDetailLayout = false,
|
|
identifier = "PAP-16679",
|
|
sourceHref = "/issues",
|
|
parentTitle,
|
|
title = "Hire your first engineer and create a hiring plan",
|
|
}: {
|
|
onOpen?: () => void;
|
|
panelControl?: { open: boolean; onToggle: () => void };
|
|
taskDetailLayout?: boolean;
|
|
identifier?: string;
|
|
sourceHref?: string;
|
|
parentTitle?: string;
|
|
title?: string;
|
|
}) {
|
|
const {
|
|
setBreadcrumbs,
|
|
setBreadcrumbToolbar,
|
|
setBreadcrumbPanelControl,
|
|
} = useBreadcrumbs();
|
|
|
|
useEffect(() => {
|
|
setBreadcrumbs([
|
|
{ label: "Tasks", href: sourceHref },
|
|
...(parentTitle ? [{ label: parentTitle, href: "/issues/PAP-120" }] : []),
|
|
{
|
|
label: title,
|
|
identifier,
|
|
leading: "status",
|
|
},
|
|
]);
|
|
setBreadcrumbToolbar(
|
|
onOpen ? (
|
|
<button type="button" aria-label="Show task side panel" onClick={onOpen}>
|
|
Show panel
|
|
</button>
|
|
) : null,
|
|
);
|
|
setBreadcrumbPanelControl(panelControl ?? null);
|
|
return () => {
|
|
setBreadcrumbToolbar(null);
|
|
setBreadcrumbPanelControl(null);
|
|
};
|
|
}, [
|
|
identifier,
|
|
onOpen,
|
|
panelControl,
|
|
setBreadcrumbPanelControl,
|
|
setBreadcrumbToolbar,
|
|
setBreadcrumbs,
|
|
sourceHref,
|
|
parentTitle,
|
|
title,
|
|
]);
|
|
|
|
return <BreadcrumbBar taskDetailLayout={taskDetailLayout} />;
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
(globalThis as any).IS_REACT_ACT_ENVIRONMENT = true;
|
|
|
|
describe("BreadcrumbBar", () => {
|
|
let container: HTMLDivElement;
|
|
let root: Root;
|
|
|
|
beforeEach(() => {
|
|
viewport.isMobile = false;
|
|
navigate.mockClear();
|
|
vi.stubGlobal("ResizeObserver", class { observe() {} unobserve() {} disconnect() {} });
|
|
container = document.createElement("div");
|
|
document.body.appendChild(container);
|
|
root = createRoot(container);
|
|
});
|
|
|
|
afterEach(() => {
|
|
act(() => root.unmount());
|
|
container.remove();
|
|
vi.unstubAllGlobals();
|
|
});
|
|
|
|
it("uses the standard section heading for Chat while retaining the properties toggle", async () => {
|
|
const toggle = vi.fn();
|
|
function ChatHeader() {
|
|
const { setBreadcrumbs, setBreadcrumbPanelControl } = useBreadcrumbs();
|
|
useEffect(() => {
|
|
setBreadcrumbs([{ label: "Chat" }]);
|
|
setBreadcrumbPanelControl({ open: false, onToggle: toggle });
|
|
}, [setBreadcrumbs, setBreadcrumbPanelControl]);
|
|
return <BreadcrumbBar showPropertiesToggle />;
|
|
}
|
|
await act(async () => root.render(<BreadcrumbProvider><ChatHeader /></BreadcrumbProvider>));
|
|
expect(container.querySelector("h1")?.textContent).toBe("Chat");
|
|
expect(container.querySelector("h1")?.className).toContain("uppercase");
|
|
expect(container.querySelector('[aria-label^="Switch agent"]')).toBeNull();
|
|
expect(container.querySelector('[aria-label^="Pin "]')).toBeNull();
|
|
await act(async () => container.querySelector<HTMLButtonElement>('[aria-label="Show properties"]')!.click());
|
|
expect(toggle).toHaveBeenCalledOnce();
|
|
});
|
|
|
|
it.each([
|
|
{ mobile: false, taskDetailLayout: true },
|
|
{ mobile: true, taskDetailLayout: true },
|
|
{ mobile: false, taskDetailLayout: false },
|
|
{ mobile: true, taskDetailLayout: false },
|
|
])("opens the agent picker from the avatar, name and caret (mobile=$mobile, task=$taskDetailLayout)", async ({ mobile, taskDetailLayout }) => {
|
|
viewport.isMobile = mobile;
|
|
const agent = chatAgents[0] as Agent;
|
|
function AgentBreadcrumb() {
|
|
const { setBreadcrumbs } = useBreadcrumbs();
|
|
useEffect(() => {
|
|
setBreadcrumbs([{
|
|
label: agent.name,
|
|
control: <CoordinatorAgentSwitcher agent={agent} />,
|
|
controlKey: agent.id,
|
|
}]);
|
|
}, [setBreadcrumbs]);
|
|
return <BreadcrumbBar taskDetailLayout={taskDetailLayout} />;
|
|
}
|
|
await act(async () => root.render(<BreadcrumbProvider><AgentBreadcrumb /></BreadcrumbProvider>));
|
|
const button = container.querySelector<HTMLButtonElement>('button[aria-label="Switch agent. Currently CodexCoder"]')!;
|
|
expect(button).not.toBeNull();
|
|
expect(button.getAttribute("aria-current")).toBe("page");
|
|
expect(button.closest('[aria-disabled="true"]')).toBeNull();
|
|
expect(button.querySelector("button, a")).toBeNull();
|
|
expect(document.title).toBe("CodexCoder • Paperclip");
|
|
for (const selector of ['[data-slot="agent-avatar"]', "[data-agent-name]", "svg"]) {
|
|
const target = button.querySelector<HTMLElement>(selector);
|
|
expect(target).not.toBeNull();
|
|
await act(async () => { button.focus(); target!.dispatchEvent(new MouseEvent("click", { bubbles: true })); });
|
|
expect(document.querySelector('[role="dialog"]')?.textContent).toContain("Chat with an agent");
|
|
expect(button.getAttribute("aria-expanded")).toBe("true");
|
|
await act(async () => document.dispatchEvent(new KeyboardEvent("keydown", { key: "Escape", bubbles: true })));
|
|
expect(document.querySelector('[role="dialog"]')).toBeNull();
|
|
await vi.waitFor(() => expect(document.activeElement).toBe(button));
|
|
}
|
|
await act(async () => button.click());
|
|
const next = [...document.querySelectorAll<HTMLElement>('[role="option"]')].find(option => option.textContent?.includes("Designer"))!;
|
|
await act(async () => next.click());
|
|
expect(navigate).toHaveBeenCalledWith("/chats/designer");
|
|
expect(document.querySelector('[role="dialog"]')).toBeNull();
|
|
});
|
|
|
|
it("keeps a single task breadcrumb compact with adjacent identity and settings action", async () => {
|
|
const configure = vi.fn();
|
|
function AgentBreadcrumb() {
|
|
const { setBreadcrumbs } = useBreadcrumbs();
|
|
useEffect(() => {
|
|
setBreadcrumbs([{
|
|
label: "CodexCoder",
|
|
leading: <span aria-label="Agent avatar">CC</span>,
|
|
leadingKey: "codex-avatar",
|
|
trailing: <button aria-label="Configure CodexCoder" onClick={configure}>Settings</button>,
|
|
trailingKey: "codex-settings",
|
|
}]);
|
|
}, [setBreadcrumbs]);
|
|
return <BreadcrumbBar taskDetailLayout />;
|
|
}
|
|
await act(async () => root.render(<BreadcrumbProvider><AgentBreadcrumb /></BreadcrumbProvider>));
|
|
const label = container.querySelector('[data-slot="breadcrumb-page"]');
|
|
expect(label?.textContent).toBe("CCCodexCoder");
|
|
expect(label?.classList.contains("items-center")).toBe(true);
|
|
expect(label?.classList.contains("items-baseline")).toBe(false);
|
|
expect(container.querySelector("h1")).toBeNull();
|
|
const settings = container.querySelector<HTMLButtonElement>('button[aria-label="Configure CodexCoder"]');
|
|
expect(settings?.closest('[data-slot="breadcrumb-item"]')).toBe(label?.closest('[data-slot="breadcrumb-item"]'));
|
|
expect(settings?.closest('[aria-disabled="true"]')).toBeNull();
|
|
act(() => settings?.click());
|
|
expect(configure).toHaveBeenCalledOnce();
|
|
expect(container.querySelector('button[aria-label="Hide properties"]')).not.toBeNull();
|
|
});
|
|
|
|
it("shows only the title followed by its identifier for a company-scoped mobile task header", async () => {
|
|
viewport.isMobile = true;
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs identifier="TES-3" sourceHref="/TES/issues" />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
expect(container.querySelector('a[href="/TES/issues"]')).toBeNull();
|
|
const identifier = container.querySelector('[data-slot="task-title-identifier"]');
|
|
expect(identifier?.textContent).toBe("TES-3");
|
|
expect(identifier?.previousElementSibling?.textContent).toBe("Hire your first engineer and create a hiring pl…");
|
|
expect(identifier?.previousElementSibling?.getAttribute("title")).toBe("Hire your first engineer and create a hiring plan");
|
|
expect(identifier?.previousElementSibling?.className).toContain("truncate");
|
|
expect(container.querySelector('button[aria-label="Open sidebar"]')).not.toBeNull();
|
|
});
|
|
|
|
it("renders a page toolbar in the same persistent row as the task breadcrumb", async () => {
|
|
const onOpen = vi.fn();
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs onOpen={onOpen} />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
|
|
const launcher = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Show task side panel"]',
|
|
);
|
|
expect(launcher).not.toBeNull();
|
|
expect(launcher?.closest(".h-\\(--sz-60px\\)")?.textContent).toContain("PAP-16679");
|
|
|
|
act(() => launcher?.click());
|
|
expect(onOpen).toHaveBeenCalledOnce();
|
|
});
|
|
|
|
it.each([false, true])("keeps the parent linked beside the current task (mobile=%s)", async (mobile) => {
|
|
viewport.isMobile = mobile;
|
|
await act(async () => root.render(
|
|
<BreadcrumbProvider><TaskBreadcrumbs taskDetailLayout parentTitle="Prepare the engineering team" /></BreadcrumbProvider>,
|
|
));
|
|
const parent = container.querySelector<HTMLAnchorElement>('a[href="/issues/PAP-120"]');
|
|
expect(parent?.textContent).toBe("Prepare the engineering team");
|
|
expect(parent?.querySelector('[data-slot="task-title-identifier"]')).toBeNull();
|
|
expect(parent?.getAttribute("aria-label")).toBe("Prepare the engineering team");
|
|
expect(container.querySelector('[aria-current="page"]')?.textContent).toContain("PAP-16679");
|
|
if (mobile) {
|
|
expect(container.querySelector('a[href="/issues"]')).toBeNull();
|
|
expect(parent?.textContent).not.toContain("PAP-120");
|
|
}
|
|
});
|
|
|
|
it.each([false, true])("caps each task breadcrumb at 48 characters and preserves full names (mobile=%s)", async (mobile) => {
|
|
viewport.isMobile = mobile;
|
|
const parentTitle = "Plan the engineering team and hiring process for the next product launch";
|
|
const title = "🚀".repeat(60);
|
|
await act(async () => root.render(
|
|
<BreadcrumbProvider><TaskBreadcrumbs taskDetailLayout parentTitle={parentTitle} title={title} /></BreadcrumbProvider>,
|
|
));
|
|
const parent = container.querySelector<HTMLAnchorElement>('a[href="/issues/PAP-120"]');
|
|
const page = container.querySelector('[aria-current="page"]');
|
|
expect(parent?.textContent).toContain(`${Array.from(parentTitle).slice(0, 47).join("")}…`);
|
|
expect(parent?.title).toBe(parentTitle);
|
|
const label = page?.querySelector('[title]');
|
|
expect(label?.textContent).toBe(`${"🚀".repeat(47)}…`);
|
|
expect(label?.getAttribute("title")).toBe(title);
|
|
expect(page?.getAttribute("aria-label")).toContain(title);
|
|
});
|
|
|
|
it("appends the task identifier to the task title in the task-detail header", async () => {
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs taskDetailLayout identifier="TES-1" />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
|
|
const identifier = container.querySelector('[data-slot="task-title-identifier"]');
|
|
expect(identifier).toBeTruthy();
|
|
expect(identifier?.className).not.toContain("absolute");
|
|
expect(identifier?.closest(".relative")?.className).toContain("border-b");
|
|
expect(identifier?.closest(".relative")?.className).toContain("border-border");
|
|
expect(identifier?.closest(".relative")?.className).toContain("h-(--sz-60px)");
|
|
|
|
const title = Array.from(container.querySelectorAll("span"))
|
|
.find((element) => element.getAttribute("title") === "Hire your first engineer and create a hiring plan");
|
|
const tasksLink = container.querySelector<HTMLAnchorElement>('a[href="/issues"]');
|
|
const header = tasksLink?.closest(".relative");
|
|
expect(header?.classList).toContain("px-4");
|
|
expect(header?.classList).toContain("md:px-6");
|
|
expect(header?.classList).not.toContain("px-3");
|
|
expect(tasksLink?.classList).toContain("font-semibold");
|
|
expect(tasksLink?.classList).toContain("tracking-wider");
|
|
expect(tasksLink?.classList).toContain("text-muted-foreground");
|
|
expect(tasksLink?.classList).toContain("hover:text-foreground");
|
|
expect(tasksLink?.classList).not.toContain("font-bold");
|
|
expect(title?.className).toContain("truncate");
|
|
expect(title?.nextElementSibling).toBe(identifier);
|
|
expect(identifier?.textContent).toBe("TES-1");
|
|
});
|
|
|
|
it("styles the root crumb as an uppercase muted header on every detail view", async () => {
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
|
|
const rootCrumb = container.querySelector<HTMLAnchorElement>('a[href="/issues"]');
|
|
expect(rootCrumb?.classList).toContain("font-semibold");
|
|
expect(rootCrumb?.classList).toContain("uppercase");
|
|
expect(rootCrumb?.classList).toContain("tracking-wider");
|
|
expect(rootCrumb?.classList).toContain("text-muted-foreground");
|
|
expect(rootCrumb?.classList).toContain("hover:text-foreground");
|
|
});
|
|
|
|
it("routes the single task-detail panel button through a page override", async () => {
|
|
const onToggle = vi.fn();
|
|
const panelControl = { open: false, onToggle };
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs taskDetailLayout panelControl={panelControl} />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
|
|
const launcher = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Show properties"]',
|
|
);
|
|
expect(launcher).not.toBeNull();
|
|
expect(container.querySelector('button[aria-label="Hide properties"]')).toBeNull();
|
|
|
|
act(() => launcher?.click());
|
|
expect(onToggle).toHaveBeenCalledOnce();
|
|
});
|
|
|
|
it("omits the retired sidebar control and keeps the properties control", async () => {
|
|
await act(async () => {
|
|
root.render(
|
|
<BreadcrumbProvider>
|
|
<TaskBreadcrumbs taskDetailLayout />
|
|
</BreadcrumbProvider>,
|
|
);
|
|
});
|
|
|
|
const leftControl = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Collapse sidebar"]',
|
|
);
|
|
const rightControl = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Hide properties"]',
|
|
);
|
|
|
|
expect(leftControl).toBeNull();
|
|
expect(container.querySelector('button[aria-label="Expand sidebar"]')).toBeNull();
|
|
expect(rightControl?.className).toContain("size-9");
|
|
expect(rightControl?.className).not.toContain("rounded-none");
|
|
expect(rightControl?.className).not.toContain("h-full");
|
|
});
|
|
});
|