test: dedupe heartbeat and action-runner fixtures

This commit is contained in:
Peter Steinberger
2026-02-19 13:59:27 +00:00
parent 26c9b37f5b
commit cb6b835a49
5 changed files with 93 additions and 114 deletions

View File

@@ -78,6 +78,14 @@ const runDrySend = (params: {
action: "send",
});
function createAlwaysConfiguredPluginConfig(account: Record<string, unknown> = { enabled: true }) {
return {
listAccountIds: () => ["default"],
resolveAccount: () => account,
isConfigured: () => true,
};
}
describe("runMessageAction context isolation", () => {
beforeEach(async () => {
const { createPluginRuntime } = await import("../../plugins/runtime/index.js");
@@ -680,11 +688,7 @@ describe("runMessageAction card-only send behavior", () => {
blurb: "Card-only send test plugin.",
},
capabilities: { chatTypes: ["direct"] },
config: {
listAccountIds: () => ["default"],
resolveAccount: () => ({ enabled: true }),
isConfigured: () => true,
},
config: createAlwaysConfiguredPluginConfig(),
actions: {
listActions: () => ["send"],
supportsAction: ({ action }) => action === "send",
@@ -764,11 +768,7 @@ describe("runMessageAction components parsing", () => {
blurb: "Discord components send test plugin.",
},
capabilities: { chatTypes: ["direct"] },
config: {
listAccountIds: () => ["default"],
resolveAccount: () => ({}),
isConfigured: () => true,
},
config: createAlwaysConfiguredPluginConfig({}),
actions: {
listActions: () => ["send"],
supportsAction: ({ action }) => action === "send",