fix(ci): repair bundled and extension test drift

This commit is contained in:
Peter Steinberger
2026-04-03 19:24:42 +01:00
parent e063f67ac0
commit eea069bdc3
6 changed files with 19 additions and 14 deletions

View File

@@ -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,
});

View File

@@ -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({

View File

@@ -1,4 +1,4 @@
import type { ReplyPayload } from "openclaw/plugin-sdk";
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
import {
buildBrowseProvidersButton,
buildModelsKeyboard,

View File

@@ -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: {

View File

@@ -1349,7 +1349,7 @@ export function createTopLevelChannelParsedAllowFromPrompt(params: {
const defaultAccountId = params.defaultAccountId;
return createPromptParsedAllowFromForAccount({
defaultAccountId: () => defaultAccountId,
defaultAccountId,
...sharedParams,
});
}

View File

@@ -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",