test(briefs): cover bridge host context

This commit is contained in:
Dotta committed 2026-05-24 02:36:56 +00:00
1 parent 59dd63fde6
commit 71734b3d73
3 files changed
+10 -1

No files matched your search

@@ -26,6 +26,14 @@ vi.mock("@paperclipai/plugin-sdk/ui", () => {
navigate: () => {},
linkProps: (to: string) => ({ href: to, onClick: () => {} }),
}),
useHostContext: () => ({
companyId: "company-1",
companyPrefix: "PAP",
projectId: null,
entityId: null,
entityType: null,
userId: "user-1",
}),
usePluginAction: (key: string) => {
if (key === "pin-card") return actionCalls.pin;
if (key === "dismiss-card") return actionCalls.dismiss;
+1
View File
@@ -15,6 +15,7 @@ import type {
PluginEventType,
PluginToolDeclaration,
PluginLauncherDeclaration,
PluginLauncherRenderContextSnapshot,
Company,
Project,
Issue,
+1 -1
View File
@@ -1188,7 +1188,7 @@ export function startWorkerRpcHost(options: WorkerRpcHostOptions): WorkerRpcHost
},
data: {
register(key: string, handler: (params: Record<string, unknown>) => Promise<unknown>): void {
register(key: string, handler: PluginDataHandler): void {
dataHandlers.set(key, handler);
},
},