test(extensions): fix lint-clean test assertions

This commit is contained in:
Peter Steinberger
2026-04-22 01:42:56 +01:00
parent d57fe63ee0
commit 66576f3355
3 changed files with 7 additions and 5 deletions

View File

@@ -153,20 +153,20 @@ describe("createQaScenarioRuntimeApi", () => {
expect(api.getTransportSnapshot()).toEqual(state.getSnapshot());
expect(api.imageUnderstandingPngBase64).toBe("png-small");
const inbound = await api.injectInboundMessage({
const inbound = api.injectInboundMessage({
accountId: "qa-channel",
conversation: { id: "qa-operator", kind: "direct" },
senderId: "qa-operator",
text: "hello",
});
const outbound = await api.injectOutboundMessage({
const outbound = api.injectOutboundMessage({
accountId: "qa-channel",
to: "dm:qa-operator",
text: "hi",
});
expect(inbound.id).toBeTruthy();
expect(outbound.id).toBeTruthy();
await api.readTransportMessage({ accountId: "qa-channel", messageId: outbound.id });
api.readTransportMessage({ accountId: "qa-channel", messageId: outbound.id });
await api.reset();
await api.resetBus();
await api.resetTransport();

View File

@@ -152,7 +152,9 @@ describe("uploadFile memex upload hardening", () => {
maxRedirects: 0,
});
const firstCall = mockGuardedFetch.mock.calls[0]?.[0];
const firstBody = JSON.parse(String(firstCall?.init?.body)) as Record<string, unknown>;
const firstBodyRaw = firstCall?.init?.body;
expect(typeof firstBodyRaw).toBe("string");
const firstBody = JSON.parse(firstBodyRaw as string) as Record<string, unknown>;
expect(firstBody).toMatchObject({
token: "genuine-secret",
contentLength: 11,

View File

@@ -75,7 +75,7 @@ function setup(config: Record<string, unknown>): Registered {
registerService: () => {},
resolvePath: (p: string) => p,
});
void plugin.register(api);
plugin.register(api);
return { methods, tools };
}