test: tighten channel runtime context assertions

This commit is contained in:
Peter Steinberger
2026-05-11 12:06:05 +01:00
parent 01d9d1be83
commit 605fb9731d

View File

@@ -100,19 +100,29 @@ describe("channel runtime context helpers", () => {
capability: "approval.native",
}),
).toEqual({ client: "matrix" });
expect(onEvent).toHaveBeenNthCalledWith(
1,
expect.objectContaining({
type: "registered",
context: { app: "slack" },
}),
);
expect(onEvent).toHaveBeenNthCalledWith(
2,
expect.objectContaining({
type: "unregistered",
}),
);
expect(onEvent.mock.calls).toEqual([
[
{
type: "registered",
key: {
channelId: "slack",
accountId: "default",
capability: "approval.native",
},
context: { app: "slack" },
},
],
[
{
type: "unregistered",
key: {
channelId: "slack",
accountId: "default",
capability: "approval.native",
},
},
],
]);
persistentLease?.dispose();
unsubscribe?.();