refactor(core): dedupe infra, media, pairing, and plugin helpers

This commit is contained in:
Peter Steinberger
2026-03-02 21:31:18 +00:00
parent 91dd89313a
commit 34daed1d1e
11 changed files with 301 additions and 340 deletions

View File

@@ -1,12 +1,16 @@
import { describe, expect, it, vi } from "vitest";
import { handleSlackMessageAction } from "./slack-message-actions.js";
function createInvokeSpy() {
return vi.fn(async (action: Record<string, unknown>) => ({
ok: true,
content: action,
}));
}
describe("handleSlackMessageAction", () => {
it("maps download-file to the internal downloadFile action", async () => {
const invoke = vi.fn(async (action: Record<string, unknown>) => ({
ok: true,
content: action,
}));
const invoke = createInvokeSpy();
await handleSlackMessageAction({
providerId: "slack",
@@ -34,10 +38,7 @@ describe("handleSlackMessageAction", () => {
});
it("maps download-file target aliases to scope fields", async () => {
const invoke = vi.fn(async (action: Record<string, unknown>) => ({
ok: true,
content: action,
}));
const invoke = createInvokeSpy();
await handleSlackMessageAction({
providerId: "slack",