mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:47:39 +00:00
refactor!: rename chat providers to channels
This commit is contained in:
@@ -39,8 +39,8 @@ vi.mock("../config/sessions.js", () => ({
|
||||
resolveMainSessionKey: mocks.resolveMainSessionKey,
|
||||
resolveStorePath: mocks.resolveStorePath,
|
||||
}));
|
||||
vi.mock("../providers/plugins/index.js", () => ({
|
||||
listProviderPlugins: () =>
|
||||
vi.mock("../channels/plugins/index.js", () => ({
|
||||
listChannelPlugins: () =>
|
||||
[
|
||||
{
|
||||
id: "whatsapp",
|
||||
@@ -56,7 +56,7 @@ vi.mock("../providers/plugins/index.js", () => ({
|
||||
resolveAccount: () => ({}),
|
||||
},
|
||||
status: {
|
||||
buildProviderSummary: async () => ({ linked: true, authAgeMs: 5000 }),
|
||||
buildChannelSummary: async () => ({ linked: true, authAgeMs: 5000 }),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -80,12 +80,12 @@ vi.mock("../providers/plugins/index.js", () => ({
|
||||
typeof account.lastError === "string" && account.lastError,
|
||||
)
|
||||
.map((account) => ({
|
||||
provider: "signal",
|
||||
channel: "signal",
|
||||
accountId:
|
||||
typeof account.accountId === "string"
|
||||
? account.accountId
|
||||
: "default",
|
||||
message: `Provider error: ${String(account.lastError)}`,
|
||||
message: `Channel error: ${String(account.lastError)}`,
|
||||
})),
|
||||
},
|
||||
},
|
||||
@@ -110,12 +110,12 @@ vi.mock("../providers/plugins/index.js", () => ({
|
||||
typeof account.lastError === "string" && account.lastError,
|
||||
)
|
||||
.map((account) => ({
|
||||
provider: "imessage",
|
||||
channel: "imessage",
|
||||
accountId:
|
||||
typeof account.accountId === "string"
|
||||
? account.accountId
|
||||
: "default",
|
||||
message: `Provider error: ${String(account.lastError)}`,
|
||||
message: `Channel error: ${String(account.lastError)}`,
|
||||
})),
|
||||
},
|
||||
},
|
||||
@@ -210,7 +210,7 @@ describe("statusCommand", () => {
|
||||
it("prints JSON when requested", async () => {
|
||||
await statusCommand({ json: true }, runtime as never);
|
||||
const payload = JSON.parse((runtime.log as vi.Mock).mock.calls[0][0]);
|
||||
expect(payload.linkProvider.linked).toBe(true);
|
||||
expect(payload.linkChannel.linked).toBe(true);
|
||||
expect(payload.sessions.count).toBe(1);
|
||||
expect(payload.sessions.path).toBe("/tmp/sessions.json");
|
||||
expect(payload.sessions.defaults.model).toBeTruthy();
|
||||
@@ -228,7 +228,7 @@ describe("statusCommand", () => {
|
||||
expect(logs.some((l) => l.includes("Overview"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("Dashboard"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("macos 14.0 (arm64)"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("Providers"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("Channels"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("WhatsApp"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("Sessions"))).toBe(true);
|
||||
expect(logs.some((l) => l.includes("+1000"))).toBe(true);
|
||||
@@ -265,7 +265,7 @@ describe("statusCommand", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("surfaces provider runtime errors from the gateway", async () => {
|
||||
it("surfaces channel runtime errors from the gateway", async () => {
|
||||
mocks.probeGateway.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
url: "ws://127.0.0.1:18789",
|
||||
@@ -278,7 +278,7 @@ describe("statusCommand", () => {
|
||||
configSnapshot: null,
|
||||
});
|
||||
mocks.callGateway.mockResolvedValueOnce({
|
||||
providerAccounts: {
|
||||
channelAccounts: {
|
||||
signal: [
|
||||
{
|
||||
accountId: "default",
|
||||
|
||||
Reference in New Issue
Block a user