mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:37:41 +00:00
test(discord): stabilize parent-info + doctor migration assertions (#25028)
This commit is contained in:
committed by
GitHub
parent
dd41a78458
commit
721d8b2278
@@ -54,9 +54,11 @@ describe("doctor command", () => {
|
|||||||
const remote = gateway.remote as Record<string, unknown>;
|
const remote = gateway.remote as Record<string, unknown>;
|
||||||
const channels = (written.channels as Record<string, unknown>) ?? {};
|
const channels = (written.channels as Record<string, unknown>) ?? {};
|
||||||
|
|
||||||
expect(channels.whatsapp).toEqual({
|
expect(channels.whatsapp).toEqual(
|
||||||
allowFrom: ["+15555550123"],
|
expect.objectContaining({
|
||||||
});
|
allowFrom: ["+15555550123"],
|
||||||
|
}),
|
||||||
|
);
|
||||||
expect(written.routing).toBeUndefined();
|
expect(written.routing).toBeUndefined();
|
||||||
expect(remote.token).toBe("legacy-remote-token");
|
expect(remote.token).toBe("legacy-remote-token");
|
||||||
expect(auth).toBeUndefined();
|
expect(auth).toBeUndefined();
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
import { ChannelType } from "@buape/carbon";
|
import { ChannelType } from "@buape/carbon";
|
||||||
import { describe, expect, it, vi } from "vitest";
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import { __resetDiscordChannelInfoCacheForTest } from "./message-utils.js";
|
||||||
import { resolveDiscordThreadParentInfo } from "./threading.js";
|
import { resolveDiscordThreadParentInfo } from "./threading.js";
|
||||||
|
|
||||||
describe("resolveDiscordThreadParentInfo", () => {
|
describe("resolveDiscordThreadParentInfo", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
__resetDiscordChannelInfoCacheForTest();
|
||||||
|
});
|
||||||
|
|
||||||
it("falls back to fetched thread parentId when parentId is missing in payload", async () => {
|
it("falls back to fetched thread parentId when parentId is missing in payload", async () => {
|
||||||
const fetchChannel = vi.fn(async (channelId: string) => {
|
const fetchChannel = vi.fn(async (channelId: string) => {
|
||||||
if (channelId === "thread-1") {
|
if (channelId === "thread-1") {
|
||||||
|
|||||||
Reference in New Issue
Block a user