mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 13:41:30 +00:00
fix(ci): repair bundled and extension test drift
This commit is contained in:
@@ -107,11 +107,17 @@ describe("matrix doctor", () => {
|
||||
warnings: [],
|
||||
});
|
||||
|
||||
const repair = await applyMatrixDoctorRepair({ cfg: {}, env: process.env });
|
||||
const cfg = {
|
||||
channels: {
|
||||
matrix: {},
|
||||
},
|
||||
} as never;
|
||||
|
||||
const repair = await applyMatrixDoctorRepair({ cfg, env: process.env });
|
||||
expect(repair.changes.join("\n")).toContain("Matrix migration snapshot");
|
||||
|
||||
const sequence = await runMatrixDoctorSequence({
|
||||
cfg: {},
|
||||
cfg,
|
||||
env: process.env,
|
||||
shouldRepair: true,
|
||||
});
|
||||
|
||||
@@ -47,13 +47,13 @@ function buildConfig(
|
||||
}
|
||||
|
||||
describe("matrix exec approvals", () => {
|
||||
it("requires enablement and an explicit or inferred approver", () => {
|
||||
it("auto-enables when approvers resolve and disables only when forced off", () => {
|
||||
expect(isMatrixExecApprovalClientEnabled({ cfg: buildConfig() })).toBe(false);
|
||||
expect(
|
||||
isMatrixExecApprovalClientEnabled({
|
||||
cfg: buildConfig(undefined, { dm: { allowFrom: ["@owner:example.org"] } }),
|
||||
}),
|
||||
).toBe(false);
|
||||
).toBe(true);
|
||||
expect(isMatrixExecApprovalClientEnabled({ cfg: buildConfig({ enabled: true }) })).toBe(false);
|
||||
expect(
|
||||
isMatrixExecApprovalClientEnabled({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ReplyPayload } from "openclaw/plugin-sdk";
|
||||
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
|
||||
import {
|
||||
buildBrowseProvidersButton,
|
||||
buildModelsKeyboard,
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
|
||||
import "./zalo-js.test-mocks.js";
|
||||
import { zalouserPlugin } from "./channel.js";
|
||||
import { setZalouserRuntime } from "./runtime.js";
|
||||
import { sendMessageZalouser, sendReactionZalouser } from "./send.js";
|
||||
import {
|
||||
listZaloFriendsMatchingMock,
|
||||
startZaloQrLoginMock,
|
||||
waitForZaloQrLoginMock,
|
||||
} from "./zalo-js.test-mocks.js";
|
||||
import { zalouserPlugin } from "./channel.js";
|
||||
import { setZalouserRuntime } from "./runtime.js";
|
||||
import { sendMessageZalouser, sendReactionZalouser } from "./send.js";
|
||||
|
||||
vi.mock("./qr-temp-file.js", () => ({
|
||||
writeQrDataUrlToTempFile: vi.fn(async () => null),
|
||||
@@ -308,7 +309,7 @@ describe("zalouser account resolution", () => {
|
||||
} as never,
|
||||
inputs: ["Work User"],
|
||||
kind: "user",
|
||||
runtime: {},
|
||||
runtime: createNonExitingRuntimeEnv(),
|
||||
});
|
||||
|
||||
expect(listZaloFriendsMatchingMock).toHaveBeenCalledWith("work-profile", "Work User");
|
||||
@@ -338,9 +339,7 @@ describe("zalouser account resolution", () => {
|
||||
displayName: "Work User",
|
||||
} as never);
|
||||
|
||||
const runtime = {
|
||||
log: vi.fn(),
|
||||
};
|
||||
const runtime = createNonExitingRuntimeEnv();
|
||||
|
||||
await login({
|
||||
cfg: {
|
||||
|
||||
@@ -1349,7 +1349,7 @@ export function createTopLevelChannelParsedAllowFromPrompt(params: {
|
||||
|
||||
const defaultAccountId = params.defaultAccountId;
|
||||
return createPromptParsedAllowFromForAccount({
|
||||
defaultAccountId: () => defaultAccountId,
|
||||
defaultAccountId,
|
||||
...sharedParams,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1262,7 +1262,7 @@ module.exports = { id: "throws-after-import", register() {} };`,
|
||||
});
|
||||
|
||||
expect(active.plugins.find((entry) => entry.id === "command-plugin")?.status).toBe("loaded");
|
||||
expect(getPluginCommandSpecs("telegram")).toEqual([
|
||||
expect(getPluginCommandSpecs()).toEqual([
|
||||
{
|
||||
name: "pair",
|
||||
description: "Pair device",
|
||||
|
||||
Reference in New Issue
Block a user