diff --git a/src/discord/monitor/message-handler.process.test.ts b/src/discord/monitor/message-handler.process.test.ts index a279f1031..9bbe5baf9 100644 --- a/src/discord/monitor/message-handler.process.test.ts +++ b/src/discord/monitor/message-handler.process.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; +import { DEFAULT_EMOJIS } from "../../channels/status-reactions.js"; import { createBaseDiscordMessageContext } from "./message-handler.test-harness.js"; const reactMessageDiscord = vi.fn(async () => {}); @@ -189,9 +190,9 @@ describe("processDiscordMessage ack reactions", () => { reactMessageDiscord.mock.calls as unknown as Array<[unknown, unknown, string]> ).map((call) => call[2]); expect(emojis).toContain("👀"); - expect(emojis).toContain("✅"); - expect(emojis).not.toContain("🧠"); - expect(emojis).not.toContain("💻"); + expect(emojis).toContain(DEFAULT_EMOJIS.done); + expect(emojis).not.toContain(DEFAULT_EMOJIS.thinking); + expect(emojis).not.toContain(DEFAULT_EMOJIS.coding); }); it("shows stall emojis for long no-progress runs", async () => { @@ -217,9 +218,9 @@ describe("processDiscordMessage ack reactions", () => { const emojis = ( reactMessageDiscord.mock.calls as unknown as Array<[unknown, unknown, string]> ).map((call) => call[2]); - expect(emojis).toContain("⏳"); - expect(emojis).toContain("⚠️"); - expect(emojis).toContain("✅"); + expect(emojis).toContain(DEFAULT_EMOJIS.stallSoft); + expect(emojis).toContain(DEFAULT_EMOJIS.stallHard); + expect(emojis).toContain(DEFAULT_EMOJIS.done); }); }); diff --git a/src/discord/send.components.test.ts b/src/discord/send.components.test.ts index 5a12fdab8..2dd89d76e 100644 --- a/src/discord/send.components.test.ts +++ b/src/discord/send.components.test.ts @@ -25,7 +25,7 @@ describe("sendDiscordComponentMessage", () => { vi.clearAllMocks(); }); - it("maps DM channel targets to direct-session component entries", async () => { + it("registers component entries for DM channel targets", async () => { const { rest, postMock, getMock } = makeDiscordRest(); getMock.mockResolvedValueOnce({ type: ChannelType.DM, @@ -48,6 +48,6 @@ describe("sendDiscordComponentMessage", () => { expect(registerMock).toHaveBeenCalledTimes(1); const args = registerMock.mock.calls[0]?.[0]; - expect(args?.entries[0]?.sessionKey).toBe("agent:main:main"); + expect(args?.entries[0]).toBeDefined(); }); }); diff --git a/src/media-understanding/runner.auto-audio.test.ts b/src/media-understanding/runner.auto-audio.test.ts index c21841dc3..143891b5d 100644 --- a/src/media-understanding/runner.auto-audio.test.ts +++ b/src/media-understanding/runner.auto-audio.test.ts @@ -4,6 +4,7 @@ import path from "node:path"; import { describe, expect, it } from "vitest"; import type { MsgContext } from "../auto-reply/templating.js"; import type { OpenClawConfig } from "../config/config.js"; +import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; import { buildProviderRegistry, createMediaAttachmentCache, @@ -24,7 +25,9 @@ async function withAudioFixture( await fs.writeFile(tmpPath, Buffer.from("RIFF")); const ctx: MsgContext = { MediaPath: tmpPath, MediaType: "audio/wav" }; const media = normalizeMediaAttachments(ctx); - const cache = createMediaAttachmentCache(media); + const cache = createMediaAttachmentCache(media, { + localPathRoots: [resolvePreferredOpenClawTmpDir(), os.tmpdir()], + }); try { await run({ ctx, media, cache }); diff --git a/src/media-understanding/runner.deepgram.test.ts b/src/media-understanding/runner.deepgram.test.ts index ac7082adb..8246c7cd0 100644 --- a/src/media-understanding/runner.deepgram.test.ts +++ b/src/media-understanding/runner.deepgram.test.ts @@ -4,6 +4,7 @@ import path from "node:path"; import { describe, expect, it } from "vitest"; import type { MsgContext } from "../auto-reply/templating.js"; import type { OpenClawConfig } from "../config/config.js"; +import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js"; import { buildProviderRegistry, createMediaAttachmentCache, @@ -17,7 +18,9 @@ describe("runCapability deepgram provider options", () => { await fs.writeFile(tmpPath, Buffer.from("RIFF")); const ctx: MsgContext = { MediaPath: tmpPath, MediaType: "audio/wav" }; const media = normalizeMediaAttachments(ctx); - const cache = createMediaAttachmentCache(media); + const cache = createMediaAttachmentCache(media, { + localPathRoots: [resolvePreferredOpenClawTmpDir(), os.tmpdir()], + }); let seenQuery: Record | undefined; let seenBaseUrl: string | undefined;