Skip to content

Commit 447393d

Browse files
authored
test(core): remove residual duplicate assertions (#124116)
1 parent 160e368 commit 447393d

14 files changed

Lines changed: 2 additions & 100 deletions

‎extensions/onepassword/src/secret-ref-resolver.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ describe("plugin manifest", () => {
256256
expect(integration?.maxOutputBytes).toBeGreaterThan(
257257
maxRefsPerRequest * worstCaseEscapedValueBytes,
258258
);
259-
expect(resolverSource).toContain("#!/usr/bin/env node");
260-
expect(resolverSource).toContain('from "execa"');
261259
expect(packageJson.openclaw?.build?.staticAssets).toContainEqual({
262260
source: "./onepassword-op-path.js",
263261
output: "onepassword-op-path.js",

‎packages/gateway-protocol/src/schema/sessions-row.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ describe("SessionRowSchema", () => {
2929
activeLeafEntryId: "leaf-rendered",
3030
createdActor: { avatarUrl: "/api/users/profile-ada/avatar?v=7" },
3131
archivedBy: { type: "human", id: "profile-bob", label: "Bob" },
32-
icon: "🦞",
3332
visibility: "suggest",
3433
sharingRole: "owner",
3534
restartRecoveryStatus: "tombstoned",

‎src/agents/agent-model-discovery.internal.test.ts‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎src/agents/tools/sessions-tool.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
} from "../../config/sessions/session-accessor.js";
99
import type { OpenClawConfig } from "../../config/types.openclaw.js";
1010
import { isAgentSessionModelPatchOrigin } from "../../gateway/session-model-patch-origin.js";
11-
import { GATEWAY_OWNER_ONLY_CORE_TOOLS } from "../../security/dangerous-tools.js";
1211
import { beginSessionWorkAdmission } from "../../sessions/session-lifecycle-admission.js";
1312
import { withTestDir } from "../../test-helpers/temp-dir.js";
1413
import { createAgentPatchedSessionModelRunGuard } from "../session-model-auto-revert.js";
@@ -25,10 +24,6 @@ import {
2524
type AgentToolGatewayRequest = Parameters<AgentToolGatewayRequestCaller>[0];
2625

2726
describe("sessions tool", () => {
28-
it("uses the core owner gate", () => {
29-
expect(GATEWAY_OWNER_ONLY_CORE_TOOLS).toContain("sessions");
30-
});
31-
3227
it("carries the persisted fixed-store owner for a bare patch key", async () => {
3328
const callGateway = vi.fn().mockResolvedValue({});
3429
const tool = createSessionsTool({

‎src/cli/directory-cli.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ describe("registerDirectoryCli", () => {
389389
if (mode === "JSON") {
390390
const payload = JSON.parse(runtimeState.runtimeLogs.at(-1) ?? "");
391391
expect(payload).toEqual({ error: error.message });
392-
expect(Object.keys(payload)).toEqual(["error"]);
393392
expect(runtimeState.defaultRuntime.error).not.toHaveBeenCalled();
394393
} else {
395394
expect(runtimeErrors()).toEqual([error.message]);

‎src/cli/program.nodes-basic.e2e.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,8 @@ describe("cli program (nodes basics)", () => {
434434
"S10 Ultra",
435435
"Detail",
436436
"device: Android",
437-
"hw: samsung",
437+
"hw:",
438+
"samsung",
438439
"SM-X926B",
439440
"Status",
440441
"unpaired",

‎src/cli/program.nodes-test-helpers.test.ts‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎src/cli/program/message/helpers.test.ts‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -530,27 +530,6 @@ describe("runMessageAction", () => {
530530
expect(exitMock).toHaveBeenCalledWith(1);
531531
});
532532

533-
it("does not call exit(0) when the action throws", async () => {
534-
messageCommandMock.mockRejectedValueOnce(new Error("boom"));
535-
await runSendAction();
536-
537-
// exit should only be called once with code 1, never with 0
538-
expect(exitMock).toHaveBeenCalledOnce();
539-
expect(exitMock).not.toHaveBeenCalledWith(0);
540-
});
541-
542-
it("does not call exit(0) if the error path returns", async () => {
543-
messageCommandMock.mockRejectedValueOnce(new Error("boom"));
544-
exitMock.mockClear().mockImplementation(() => undefined as never);
545-
const runMessageAction = createRunMessageAction();
546-
await expect(runMessageAction("send", baseSendOptions)).resolves.toBeUndefined();
547-
548-
expect(errorMock).toHaveBeenCalledWith("boom");
549-
expect(exitMock).toHaveBeenCalledOnce();
550-
expect(exitMock).toHaveBeenCalledWith(1);
551-
expect(exitMock).not.toHaveBeenCalledWith(0);
552-
});
553-
554533
it("passes action and maps account to accountId", async () => {
555534
const fakeCommand = { help: vi.fn() } as never;
556535
const { runMessageAction } = createMessageCliHelpers(fakeCommand, "discord");

‎src/cli/system-cli.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ describe("system-cli", () => {
135135
if (mode === "JSON") {
136136
const payload = JSON.parse(runtimeLogs.at(-1) ?? "");
137137
expect(payload).toEqual({ error: error.message });
138-
expect(Object.keys(payload)).toEqual(["error"]);
139138
expect(runtimeErrors).toEqual([]);
140139
} else {
141140
expect(runtimeErrors).toEqual([error.message]);

‎src/cli/webhooks-cli.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ describe("webhooks cli", () => {
101101
expect(payload).toEqual({
102102
error: expect.stringContaining("Gmail failed: Authorization: Bearer"),
103103
});
104-
expect(Object.keys(payload)).toEqual(["error"]);
105104
expect(mocks.defaultRuntime.error).not.toHaveBeenCalled();
106105
} else {
107106
expect(runtimeErrors()).toEqual([

0 commit comments

Comments
 (0)