Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

test(canvas): verify cloud task user activation (#98218)

Peter Kirkham20859ae7e323
diff --git a/products/desktop/packages/ui/src/features/canvas/freeform/canvasHostMessageRouter.test.ts b/products/desktop/packages/ui/src/features/canvas/freeform/canvasHostMessageRouter.test.ts
index 0e1b5ff2140f..4baf93628d65 100644
--- a/products/desktop/packages/ui/src/features/canvas/freeform/canvasHostMessageRouter.test.ts
+++ b/products/desktop/packages/ui/src/features/canvas/freeform/canvasHostMessageRouter.test.ts
@@ -21,11 +21,13 @@ describe("createCanvasHostMessageRouter", () => {
},
);
it.each([
- [false, false],
- [true, true],
+ [false, false, "tasks.create"],
+ [true, true, "tasks.create"],
+ [false, false, "tasks.create_and_run"],
+ [true, true, "tasks.create_and_run"],
])(
- "forwards action invocations only under a user gesture (activation: %s)",
- async (hasActivation, forwarded) => {
+ "forwards action invocations only under a user gesture (activation: %s, forwarded: %s, verb: %s)",
+ async (hasActivation, forwarded, verb) => {
const post = vi.fn();
const onDataRequest = vi.fn().mockResolvedValue({ ok: true });
const route = createCanvasHostMessageRouter({
@@ -40,12 +42,12 @@ describe("createCanvasHostMessageRouter", () => {
type: "data-request",
id: "request-1",
method: "actionInvoke",
- payload: { verb: "tasks.create", payload: { title: "t" } },
+ payload: { verb, payload: { title: "t" } },
});
if (forwarded) {
expect(onDataRequest).toHaveBeenCalledWith("actionInvoke", {
- verb: "tasks.create",
+ verb,
payload: { title: "t" },
});
} else {