mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-06 10:48:12 +02:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - The Apps UI manages app discovery and app connections. > - The managed worktree runtime starts agent work in repository worktrees. > - The Apps routes do not match the main discovery flow, and the connections view lacks a delete action. > - Legacy managed worktrees can also start before their pending seed operation runs. > - This pull request makes app discovery the main Apps route and makes connection management explicit. > - It also seeds legacy managed worktrees before runtime startup and makes the CLI read the repository-local config. > - The benefit is a clearer Apps workflow and a safer managed-worktree startup path. ## Linked Issues or Issue Description **What existing behavior does this improve?** This improves the Apps navigation, app connection management, managed git-worktree startup, and CLI worktree selection. **Subsystem affected** Cross-cutting. The change affects `ui/`, `server/`, `cli/`, and development documentation. **Current behavior** The `/apps` route opens the connections list while discovery uses a nested route. The connections list has no delete action. Some legacy managed worktrees can start runtime work before their pending seed operation runs. The CLI can also read an ambient Paperclip config instead of the repository-local config. **Proposed behavior** The `/apps` route opens Browse, and `/apps/connections` opens the connection list. Users can delete a connection after confirmation. Runtime startup seeds legacy managed worktrees when required. The CLI resolves the current worktree from the repository-local `.paperclip/config.json` file. **Reason and benefit** Users can discover apps from the canonical Apps route and can manage existing connections from a dedicated route. Legacy worktrees receive their required repository content before agent runtime starts. CLI worktree selection stays scoped to the current repository. **Breaking changes** The `/apps` and `/apps/browse` route behavior changes. Old Browse links redirect to `/apps`. The change does not modify an API schema or database schema. ## What Changed - Make Browse the canonical `/apps` page and move the connection list to `/apps/connections`. - Align Apps navigation, redirects, attention links, empty states, and connection actions with the new routes. - Add connection deletion with confirmation and clear failure feedback. - Seed legacy managed git worktrees before runtime startup when their seed status is pending. - Read the CLI worktree selection from the repository-local Paperclip config. - Update focused UI, server, CLI, and development documentation coverage. ## Verification - Ran 202 focused UI, server, and CLI tests. All tests passed. - Ran `pnpm -r typecheck`. All projects passed. - Ran `pnpm build`. All projects built successfully. - Ran `pnpm test:run`. The server and UI stages passed 7,168 tests. The CLI stage found one environment-sensitive secrets test because this workspace injects static AWS credentials. The isolated CLI file passed all 8 tests after those injected variables were unset. - Ran `pnpm check:token-gates`. It reports 12 existing color-token violations in the unchanged `PaperclipOrbit3D.tsx` file from the target branch. This pull request does not modify that file. - Ran focused regression coverage for repository-root CLI config resolution and connection deletion state. All tests and affected package typechecks passed. - Collected all 27 tests in the six changed Playwright specifications successfully. - GitHub Actions passed every latest-head CI gate, including all three e2e shards and the aggregate `e2e` and `verify` jobs. - Greptile reviewed the final commit at 5/5 with zero unresolved threads. ## Risks - Existing bookmarks for `/apps/browse` redirect to `/apps`. - Connection deletion changes visible connection state and requires user confirmation. - The legacy seed path runs only for managed git worktrees with pending seed state. Tests cover the startup condition. - The rebase preserves the target branch's direct OAuth policy for the Notion connection flow. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used OpenAI Codex with the GPT-5 model family assisted this change. The agent used reasoning, repository tools, code execution, and test execution. The runtime does not expose the exact model snapshot or context-window size. ## 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>
463 lines
17 KiB
TypeScript
463 lines
17 KiB
TypeScript
// @vitest-environment jsdom
|
|
|
|
import { flushSync } from "react-dom";
|
|
import { createRoot } from "react-dom/client";
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
import { Connections } from "./Connections";
|
|
|
|
const listGalleryMock = vi.hoisted(() => vi.fn());
|
|
const listApplicationsMock = vi.hoisted(() => vi.fn());
|
|
const listConnectionsMock = vi.hoisted(() => vi.fn());
|
|
const listAppsAttentionMock = vi.hoisted(() => vi.fn());
|
|
const listProfilesMock = vi.hoisted(() => vi.fn());
|
|
const archiveConnectionMock = vi.hoisted(() => vi.fn());
|
|
const pushToastMock = vi.hoisted(() => vi.fn());
|
|
const mockNavigate = vi.hoisted(() => vi.fn());
|
|
|
|
vi.mock("@/api/tools", () => ({
|
|
toolsApi: {
|
|
listGallery: (companyId: string) => listGalleryMock(companyId),
|
|
listApplications: (companyId: string) => listApplicationsMock(companyId),
|
|
listConnections: (companyId: string) => listConnectionsMock(companyId),
|
|
listAppsAttention: (companyId: string) => listAppsAttentionMock(companyId),
|
|
listProfiles: (companyId: string) => listProfilesMock(companyId),
|
|
archiveConnection: (connectionId: string) => archiveConnectionMock(connectionId),
|
|
},
|
|
}));
|
|
|
|
vi.mock("@/lib/router", () => ({
|
|
useNavigate: () => mockNavigate,
|
|
Link: ({ children, to }: { children: React.ReactNode; to: string }) => (
|
|
<a href={to}>{children}</a>
|
|
),
|
|
}));
|
|
|
|
vi.mock("@/context/CompanyContext", () => ({
|
|
useCompany: () => ({
|
|
selectedCompanyId: "company-1",
|
|
selectedCompany: { id: "company-1", name: "Paperclip" },
|
|
}),
|
|
}));
|
|
|
|
vi.mock("@/context/BreadcrumbContext", () => ({
|
|
useBreadcrumbs: () => ({ setBreadcrumbs: vi.fn() }),
|
|
}));
|
|
|
|
vi.mock("@/context/ToastContext", () => ({
|
|
useToast: () => ({ pushToast: pushToastMock }),
|
|
}));
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
(globalThis as any).IS_REACT_ACT_ENVIRONMENT = true;
|
|
|
|
// React 19 does not export a usable `act` in this vitest/jsdom setup; use the
|
|
// flushSync-based helper the sibling apps tests use (PAP-12371 gotcha).
|
|
async function act(callback: () => void | Promise<void>) {
|
|
let result: void | Promise<void> = undefined;
|
|
flushSync(() => {
|
|
result = callback();
|
|
});
|
|
await result;
|
|
}
|
|
|
|
async function flushReact() {
|
|
await act(async () => {
|
|
await Promise.resolve();
|
|
await new Promise((resolve) => window.setTimeout(resolve, 0));
|
|
});
|
|
}
|
|
|
|
function application(overrides: Record<string, unknown>) {
|
|
return {
|
|
id: "app-x",
|
|
companyId: "company-1",
|
|
applicationKey: undefined,
|
|
name: "GitHub",
|
|
description: null,
|
|
type: "mcp_http",
|
|
status: "active",
|
|
pluginId: null,
|
|
ownerAgentId: null,
|
|
ownerUserId: null,
|
|
metadata: null,
|
|
archivedAt: null,
|
|
createdAt: new Date("2026-01-01T00:00:00Z"),
|
|
updatedAt: new Date("2026-01-01T00:00:00Z"),
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
function connection(overrides: Record<string, unknown>) {
|
|
return {
|
|
id: "conn-x",
|
|
companyId: "company-1",
|
|
applicationId: "app-x",
|
|
name: "GitHub",
|
|
connectionKind: "managed",
|
|
transport: "mcp_remote",
|
|
status: "active",
|
|
transportConfig: {},
|
|
config: {},
|
|
credentialSecretRefs: [],
|
|
healthStatus: "healthy",
|
|
healthCheckedAt: null,
|
|
lastError: null,
|
|
enabled: true,
|
|
lastUsedAt: null,
|
|
createdByAgentId: null,
|
|
createdByUserId: null,
|
|
createdAt: new Date("2026-01-01T00:00:00Z"),
|
|
updatedAt: new Date("2026-01-01T00:00:00Z"),
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
function profile(connectionId: string, includedEntryIds: string[]) {
|
|
return {
|
|
id: `profile-${connectionId}`,
|
|
companyId: "company-1",
|
|
profileKey: `app:${connectionId}`,
|
|
name: connectionId,
|
|
description: null,
|
|
status: "active",
|
|
defaultAction: "deny",
|
|
metadata: null,
|
|
createdAt: new Date("2026-01-01T00:00:00Z"),
|
|
updatedAt: new Date("2026-01-01T00:00:00Z"),
|
|
entries: includedEntryIds.map((catalogEntryId, index) => ({
|
|
id: `entry-${connectionId}-${index}`,
|
|
companyId: "company-1",
|
|
profileId: `profile-${connectionId}`,
|
|
selectorType: "catalog_entry",
|
|
effect: "include",
|
|
applicationId: null,
|
|
connectionId,
|
|
catalogEntryId,
|
|
toolName: null,
|
|
riskLevel: null,
|
|
conditions: null,
|
|
createdAt: new Date("2026-01-01T00:00:00Z"),
|
|
updatedAt: new Date("2026-01-01T00:00:00Z"),
|
|
})),
|
|
bindings: [],
|
|
};
|
|
}
|
|
|
|
describe("Connections table (M1b / PAP-13254 door 2)", () => {
|
|
let container: HTMLDivElement;
|
|
let root: ReturnType<typeof createRoot>;
|
|
|
|
beforeEach(() => {
|
|
listGalleryMock.mockResolvedValue({ apps: [] });
|
|
listAppsAttentionMock.mockResolvedValue({ apps: [] });
|
|
listApplicationsMock.mockResolvedValue({ applications: [] });
|
|
listConnectionsMock.mockResolvedValue({ connections: [] });
|
|
listProfilesMock.mockResolvedValue({ profiles: [] });
|
|
archiveConnectionMock.mockResolvedValue(connection({ id: "c-deleted", status: "archived" }));
|
|
container = document.createElement("div");
|
|
document.body.appendChild(container);
|
|
});
|
|
|
|
afterEach(() => {
|
|
act(() => root?.unmount());
|
|
container.remove();
|
|
vi.clearAllMocks();
|
|
});
|
|
|
|
async function renderApps() {
|
|
const client = new QueryClient({ defaultOptions: { queries: { retry: false } } });
|
|
root = createRoot(container);
|
|
await act(async () => {
|
|
root.render(
|
|
<QueryClientProvider client={client}>
|
|
<Connections />
|
|
</QueryClientProvider>,
|
|
);
|
|
});
|
|
await flushReact();
|
|
}
|
|
|
|
it("renders applications without connections as not connected with a Connect action", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [application({ id: "app-github", name: "GitHub" })],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
const text = container.textContent ?? "";
|
|
expect(text).toContain("All (1)");
|
|
expect(text).toContain("GitHub");
|
|
expect(text).toContain("Not connected");
|
|
expect(text).toContain("Connect it so agents can use it.");
|
|
expect(text).toContain("Connect");
|
|
|
|
const row = Array.from(container.querySelectorAll("tbody tr")).find((tr) =>
|
|
tr.textContent?.includes("GitHub"),
|
|
);
|
|
row?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
expect(mockNavigate).toHaveBeenCalledWith("/apps/app/app-github");
|
|
|
|
mockNavigate.mockClear();
|
|
const connectButton = Array.from(container.querySelectorAll("button")).find((button) =>
|
|
button.textContent?.includes("Connect") && !button.textContent.includes("Connect an app"),
|
|
);
|
|
connectButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
expect(mockNavigate).toHaveBeenCalledWith("/apps/app/app-github");
|
|
});
|
|
|
|
it("rolls up multi-connection status, attention count, actions, and navigation by application", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [
|
|
application({ id: "app-github", name: "GitHub" }),
|
|
application({ id: "app-slack", name: "Slack" }),
|
|
application({ id: "app-notion", name: "Notion" }),
|
|
],
|
|
});
|
|
listConnectionsMock.mockResolvedValue({
|
|
connections: [
|
|
connection({ id: "c-connected", applicationId: "app-github", name: "GitHub", healthStatus: "healthy" }),
|
|
connection({
|
|
id: "c-attention",
|
|
applicationId: "app-slack",
|
|
name: "Slack",
|
|
healthStatus: "error",
|
|
lastUsedAt: new Date("2026-06-09T00:00:00Z"),
|
|
}),
|
|
connection({ id: "c-attention-2", applicationId: "app-slack", name: "Slack Team", healthStatus: "healthy" }),
|
|
connection({ id: "c-paused", applicationId: "app-notion", name: "Notion", enabled: false }),
|
|
],
|
|
});
|
|
listAppsAttentionMock.mockResolvedValue({
|
|
apps: [
|
|
{
|
|
connection: connection({ id: "c-attention", applicationId: "app-slack", name: "Slack", healthStatus: "error" }),
|
|
healthNeedsAttention: true,
|
|
quarantinedCatalogEntryCount: 0,
|
|
pendingActionRequestCount: 0,
|
|
reasons: ["health"],
|
|
},
|
|
{
|
|
connection: connection({ id: "c-attention-2", applicationId: "app-slack", name: "Slack Team", healthStatus: "healthy" }),
|
|
healthNeedsAttention: false,
|
|
quarantinedCatalogEntryCount: 1,
|
|
pendingActionRequestCount: 0,
|
|
reasons: ["quarantined_catalog_entries"],
|
|
},
|
|
],
|
|
});
|
|
listProfilesMock.mockResolvedValue({
|
|
profiles: [
|
|
profile("c-connected", ["a", "b", "c"]),
|
|
profile("c-attention", ["a"]),
|
|
profile("c-attention-2", ["b", "c"]),
|
|
],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
const text = container.textContent ?? "";
|
|
// 1. Connected rows lose the repeated hint.
|
|
expect(text).not.toContain("Connected and ready");
|
|
// 2. Attention + Paused rows keep their explanatory hint.
|
|
expect(text).toContain("The key stopped working");
|
|
expect(text).toContain("Paused — agents can");
|
|
// 3. Filter chips and attention banner are application-counted, not connection-counted.
|
|
expect(text).toContain("All (3)");
|
|
expect(text).toContain("Needs attention (1)");
|
|
expect(text).toContain("1 app needs attention");
|
|
// 3. New header columns are present.
|
|
const headers = Array.from(container.querySelectorAll("th")).map((th) => th.textContent?.trim());
|
|
expect(headers).toEqual(["App", "Status", "Actions", "Last used", ""]);
|
|
// 4. Actions column reflects enabled catalog entries rolled up by application; missing profile => 0 on.
|
|
expect(text).toContain("3 on");
|
|
expect(text).toContain("0 on");
|
|
// 5. Last used renders a relative timestamp when present, dash when absent.
|
|
expect(text).toContain("—");
|
|
// 6. Multi-connection app appears once and opens its first connection detail.
|
|
expect(Array.from(container.querySelectorAll("tbody tr")).filter((tr) => tr.textContent?.includes("Slack"))).toHaveLength(1);
|
|
const slackRow = Array.from(container.querySelectorAll("tbody tr")).find((tr) =>
|
|
tr.textContent?.includes("Slack"),
|
|
);
|
|
slackRow?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
expect(mockNavigate).toHaveBeenCalledWith("/apps/c-attention");
|
|
// 7. Button labels are honest: broken health says Reconnect, healthy/paused say Open.
|
|
const rowButtonLabel = (name: string) =>
|
|
Array.from(container.querySelectorAll("tbody tr"))
|
|
.find((tr) => tr.textContent?.includes(name))
|
|
?.querySelector("td:last-child button")?.textContent;
|
|
expect(rowButtonLabel("GitHub")).toBe("Open");
|
|
expect(rowButtonLabel("Slack")).toBe("Reconnect");
|
|
expect(rowButtonLabel("Notion")).toBe("Open");
|
|
});
|
|
|
|
// F6 (PAP-13254 §4): the row highlight and the Status pill derive from ONE
|
|
// health signal, so they can never disagree. A healthy connection stays
|
|
// "Healthy" / "Open" and is not amber-highlighted, even if the broader
|
|
// attention endpoint would once have flagged it (quarantine/new-tools review
|
|
// now live on the app detail + Review door, not the Connections highlight).
|
|
it("keeps a healthy app un-highlighted and Open — pill and highlight agree (F6)", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [application({ id: "app-github", name: "GitHub" })],
|
|
});
|
|
listConnectionsMock.mockResolvedValue({
|
|
connections: [connection({ id: "c-healthy", applicationId: "app-github", healthStatus: "healthy" })],
|
|
});
|
|
listAppsAttentionMock.mockResolvedValue({
|
|
apps: [
|
|
{
|
|
connection: connection({ id: "c-healthy", applicationId: "app-github", healthStatus: "healthy" }),
|
|
healthNeedsAttention: false,
|
|
quarantinedCatalogEntryCount: 2,
|
|
pendingActionRequestCount: 0,
|
|
reasons: ["quarantined_catalog_entries"],
|
|
},
|
|
],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
expect(container.textContent).toContain("Healthy");
|
|
// No attention: the danger banner and attention filter chip are inert.
|
|
expect(container.textContent).not.toContain("needs attention");
|
|
expect(container.textContent).toContain("Needs attention (0)");
|
|
const row = Array.from(container.querySelectorAll("tbody tr")).find((tr) =>
|
|
tr.textContent?.includes("GitHub"),
|
|
);
|
|
expect(row?.className).not.toContain("amber");
|
|
const button = row?.querySelector("td:last-child button");
|
|
expect(button?.textContent).toBe("Open");
|
|
button?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
expect(mockNavigate).toHaveBeenCalledWith("/apps/c-healthy");
|
|
});
|
|
|
|
it("deletes a connection only after trash-can confirmation", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [application({ id: "app-github", name: "GitHub" })],
|
|
});
|
|
listConnectionsMock.mockResolvedValue({
|
|
connections: [connection({ id: "c-github", applicationId: "app-github", name: "GitHub" })],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
const deleteButton = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Delete GitHub connection"]',
|
|
);
|
|
expect(deleteButton).toBeTruthy();
|
|
|
|
await act(async () => {
|
|
deleteButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
|
|
expect(mockNavigate).not.toHaveBeenCalled();
|
|
expect(archiveConnectionMock).not.toHaveBeenCalled();
|
|
expect(document.body.textContent).toContain("Delete GitHub connection?");
|
|
|
|
const confirmButton = Array.from(document.body.querySelectorAll("button")).find(
|
|
(button) => button.textContent?.trim() === "Delete connection",
|
|
);
|
|
expect(confirmButton).toBeTruthy();
|
|
|
|
await act(async () => {
|
|
confirmButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
await flushReact();
|
|
|
|
expect(archiveConnectionMock).toHaveBeenCalledWith("c-github");
|
|
expect(pushToastMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({
|
|
title: "Connection deleted",
|
|
body: "GitHub is no longer available to agents. You can connect it again later.",
|
|
tone: "success",
|
|
}),
|
|
);
|
|
});
|
|
|
|
it("reports the remaining active connections after deleting one", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [application({ id: "app-github", name: "GitHub" })],
|
|
});
|
|
listConnectionsMock.mockResolvedValue({
|
|
connections: [
|
|
connection({ id: "c-github-primary", applicationId: "app-github", name: "GitHub" }),
|
|
connection({ id: "c-github-secondary", applicationId: "app-github", name: "GitHub Team" }),
|
|
],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
const deleteButton = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Delete GitHub connection"]',
|
|
);
|
|
await act(async () => {
|
|
deleteButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
|
|
expect(document.body.textContent).toContain(
|
|
"Agents can still use GitHub through 1 other active connection.",
|
|
);
|
|
|
|
const confirmButton = Array.from(document.body.querySelectorAll("button")).find(
|
|
(button) => button.textContent?.trim() === "Delete connection",
|
|
);
|
|
await act(async () => {
|
|
confirmButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
await flushReact();
|
|
|
|
expect(archiveConnectionMock).toHaveBeenCalledWith("c-github-primary");
|
|
expect(pushToastMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({
|
|
title: "Connection deleted",
|
|
body: "GitHub still has 1 active connection available to agents.",
|
|
tone: "success",
|
|
}),
|
|
);
|
|
});
|
|
|
|
it("does not count disabled connections as available after deletion", async () => {
|
|
listApplicationsMock.mockResolvedValue({
|
|
applications: [application({ id: "app-github", name: "GitHub" })],
|
|
});
|
|
listConnectionsMock.mockResolvedValue({
|
|
connections: [
|
|
connection({ id: "c-github-primary", applicationId: "app-github", name: "GitHub" }),
|
|
connection({
|
|
id: "c-github-disabled",
|
|
applicationId: "app-github",
|
|
name: "GitHub Disabled",
|
|
status: "disabled",
|
|
enabled: false,
|
|
}),
|
|
],
|
|
});
|
|
|
|
await renderApps();
|
|
|
|
const deleteButton = container.querySelector<HTMLButtonElement>(
|
|
'button[aria-label="Delete GitHub connection"]',
|
|
);
|
|
await act(async () => {
|
|
deleteButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
|
|
expect(document.body.textContent).toContain("Agents will lose access immediately.");
|
|
expect(document.body.textContent).not.toContain("Agents can still use GitHub");
|
|
|
|
const confirmButton = Array.from(document.body.querySelectorAll("button")).find(
|
|
(button) => button.textContent?.trim() === "Delete connection",
|
|
);
|
|
await act(async () => {
|
|
confirmButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
|
});
|
|
await flushReact();
|
|
|
|
expect(pushToastMock).toHaveBeenCalledWith(
|
|
expect.objectContaining({
|
|
body: "GitHub is no longer available to agents. You can connect it again later.",
|
|
}),
|
|
);
|
|
});
|
|
});
|