mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 22:09:57 +00:00
test: fix gate regressions
This commit is contained in:
@@ -112,7 +112,7 @@ async function runReasoningDefaultCase(params: {
|
||||
describe("directive behavior", () => {
|
||||
installDirectiveBehaviorE2EHooks();
|
||||
|
||||
it("shows /think defaults for reasoning and non-reasoning models", async () => {
|
||||
it("covers /think status and reasoning defaults for reasoning and non-reasoning models", async () => {
|
||||
await withTempHome(async (home) => {
|
||||
await expectThinkStatusForReasoningModel({
|
||||
home,
|
||||
@@ -125,6 +125,25 @@ describe("directive behavior", () => {
|
||||
expectedLevel: "off",
|
||||
});
|
||||
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
|
||||
|
||||
vi.mocked(runEmbeddedPiAgent).mockClear();
|
||||
|
||||
for (const scenario of [
|
||||
{
|
||||
expectedThinkLevel: "low" as const,
|
||||
expectedReasoningLevel: "off" as const,
|
||||
},
|
||||
{
|
||||
expectedThinkLevel: "off" as const,
|
||||
expectedReasoningLevel: "on" as const,
|
||||
thinkingDefault: "off" as const,
|
||||
},
|
||||
]) {
|
||||
await runReasoningDefaultCase({
|
||||
home,
|
||||
...scenario,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
it("renders model list and status variants across catalog/config combinations", async () => {
|
||||
@@ -282,26 +301,6 @@ describe("directive behavior", () => {
|
||||
expect(runEmbeddedPiAgent).toHaveBeenCalledOnce();
|
||||
});
|
||||
});
|
||||
it("applies reasoning defaults based on thinkingDefault configuration", async () => {
|
||||
await withTempHome(async (home) => {
|
||||
for (const scenario of [
|
||||
{
|
||||
expectedThinkLevel: "low" as const,
|
||||
expectedReasoningLevel: "off" as const,
|
||||
},
|
||||
{
|
||||
expectedThinkLevel: "off" as const,
|
||||
expectedReasoningLevel: "on" as const,
|
||||
thinkingDefault: "off" as const,
|
||||
},
|
||||
]) {
|
||||
await runReasoningDefaultCase({
|
||||
home,
|
||||
...scenario,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
it("passes elevated defaults when sender is approved", async () => {
|
||||
await withTempHome(async (home) => {
|
||||
mockEmbeddedTextResult("done");
|
||||
|
||||
@@ -64,14 +64,16 @@ describe("browser control server", () => {
|
||||
});
|
||||
expect(nav.ok).toBe(true);
|
||||
expect(typeof nav.targetId).toBe("string");
|
||||
expect(pwMocks.navigateViaPlaywright).toHaveBeenCalledWith({
|
||||
cdpUrl: state.cdpBaseUrl,
|
||||
targetId: "abcd1234",
|
||||
url: "https://example.com",
|
||||
ssrfPolicy: {
|
||||
dangerouslyAllowPrivateNetwork: true,
|
||||
},
|
||||
});
|
||||
expect(pwMocks.navigateViaPlaywright).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
cdpUrl: state.cdpBaseUrl,
|
||||
targetId: "abcd1234",
|
||||
url: "https://example.com",
|
||||
ssrfPolicy: {
|
||||
dangerouslyAllowPrivateNetwork: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
const click = await postJson<{ ok: boolean }>(`${base}/act`, {
|
||||
kind: "click",
|
||||
|
||||
@@ -636,14 +636,6 @@ describe("update-cli", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("updateCommand skips restart when --no-restart is set", async () => {
|
||||
vi.mocked(runGatewayUpdate).mockResolvedValue(makeOkUpdateResult());
|
||||
|
||||
await updateCommand({ restart: false });
|
||||
|
||||
expect(runDaemonRestart).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("updateCommand skips success message when restart does not run", async () => {
|
||||
vi.mocked(runGatewayUpdate).mockResolvedValue(makeOkUpdateResult());
|
||||
vi.mocked(runDaemonRestart).mockResolvedValue(false);
|
||||
|
||||
@@ -134,7 +134,7 @@ describe("config io write", () => {
|
||||
logger: silentLogger,
|
||||
});
|
||||
|
||||
const invalidConfig = {
|
||||
const invalidConfig: OpenClawConfig = {
|
||||
channels: {
|
||||
telegram: {
|
||||
dmPolicy: "open",
|
||||
|
||||
@@ -105,12 +105,12 @@ describe("runCommandWithTimeout", () => {
|
||||
"clearInterval(ticker);",
|
||||
"process.exit(0);",
|
||||
"}",
|
||||
"}, 40);",
|
||||
"}, 12);",
|
||||
].join(" "),
|
||||
],
|
||||
{
|
||||
timeoutMs: 5_000,
|
||||
noOutputTimeoutMs: 1_500,
|
||||
noOutputTimeoutMs: 120,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user