test: trim UI and tooling test seams (#126937)

This commit is contained in:
Peter Steinberger
2026-08-20 19:04:18 -07:00
committed by GitHub
parent 8bc6ab08f8
commit ab2bbd42df
6 changed files with 2 additions and 44 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ eval "$(xdotool getwindowgeometry --shell "$win")"
printf '%s %s %s %s\n' "$X" "$Y" "$WIDTH" "$HEIGHT"`;
}
export function renderHideTelegramWindow(): string {
function renderHideTelegramWindow(): string {
return `set -euo pipefail
export DISPLAY=:99
win="$(wmctrl -lx | awk 'tolower($0) ~ /telegramdesktop/ {print $1; exit}')"
@@ -350,7 +350,6 @@ describe("Mantis Telegram Desktop proof workflow", () => {
);
expect(workflowText).toContain("dispatcherSources.has(inputs.request_source)");
expect(workflowText).toContain('requestSource === "clawsweeper_label"');
expect(workflowText).toContain("pr.head.repo.full_name !== `${owner}/${repo}`");
expect(workflowText).toContain("allow-bot-users: github-actions[bot]");
expect(workflowText).not.toContain("allow-bot-users: github-actions[bot],clawsweeper[bot]");
expect(workflowText).toContain("inputs.approved_head_sha !== candidateRevision");
@@ -462,7 +461,6 @@ describe("Mantis Telegram Desktop proof workflow", () => {
expect(workflow.on?.workflow_dispatch?.inputs?.publish_artifact_name?.required).toBe(false);
expect(workflow.on?.workflow_dispatch?.inputs?.publish_run_id?.required).toBe(false);
expect(captureJob?.if).toContain("needs.resolve_request.outputs.publish_artifact_name == ''");
expect(captureJob?.if).toContain("needs.resolve_request.outputs.visibility_decision != 'skip'");
expect(workflow.jobs?.validate_refs).toBeUndefined();
expect(publishJob?.if).toBe(
"needs.resolve_request.outputs.should_run == 'true' && needs.resolve_request.outputs.publish_artifact_name != ''",
@@ -1071,7 +1069,6 @@ describe("Mantis Telegram Desktop proof workflow", () => {
expect(prompt).toContain("start --repo-root <prepared-root>");
expect(prompt).toContain("MANTIS_BASELINE_ROOT");
expect(prompt).toContain("MANTIS_CANDIDATE_ROOT");
expect(prompt).not.toContain("--sut-container");
expect(prompt).toContain('--baseline-repo-root "$GITHUB_WORKSPACE"');
expect(prompt).toContain('--candidate-repo-root "$GITHUB_WORKSPACE"');
expect(workflow).toContain(
@@ -1089,7 +1086,6 @@ describe("Mantis Telegram Desktop proof workflow", () => {
expect(workflow).toContain('"$runtime_parent/attestations/$lane.json"');
const attestationValidation =
workflowStep("Restore and validate trusted lane evidence").run ?? "";
expect(attestationValidation).toContain('[[ "$lane_status" != "skipped" ]]');
expect(attestationValidation).not.toContain('if [[ "$lane_status" == "skipped"');
expect(attestationValidation.indexOf(".comparison[$lane].sha == $sha")).toBeLessThan(
attestationValidation.indexOf('"$runtime_parent/attestations/$lane.json"'),
@@ -17,7 +17,6 @@ import {
type RecorderOperations,
type RecorderSession,
renderGoldenImagePreflight,
renderHideTelegramWindow,
renderLaunchDesktop,
renderPrepareQr,
renderReadQrLink,
@@ -555,7 +554,6 @@ describe("Telegram Desktop recorder remote contract", () => {
expect(openIndex).toBeGreaterThanOrEqual(0);
expect(hideIndex).toBeGreaterThan(openIndex);
expect(captureIndex).toBeGreaterThan(hideIndex);
expect(renderHideTelegramWindow()).toContain('xdotool windowminimize "$win"');
});
it("fetches the undecodable login screen when login attempts run out", async () => {
+1 -13
View File
@@ -12,7 +12,7 @@ import {
} from "./app-host.test-support.ts";
import "./app-host.ts";
import { DEBUG_OVERLAY_ELEMENT } from "./lazy-custom-element.ts";
import { persistLazyShellAction, readLazyShellAction } from "./lazy-shell-action.ts";
import { readLazyShellAction } from "./lazy-shell-action.ts";
const storageKey = "openclaw:lazy-event";
@@ -33,18 +33,6 @@ async function withConnectedShell(shell: ShellLifecycle, run: () => void | Promi
afterEach(resetAppHostTestGlobals);
describe("lazy shell action storage", () => {
it("round-trips a closed structured panel action", () => {
const storage = createStorageMock();
const action = {
eventType: TERMINAL_PANEL_TOGGLE_EVENT,
detail: { dock: "right", open: true },
} as const;
vi.stubGlobal("sessionStorage", storage);
persistLazyShellAction(action);
expect(readLazyShellAction()).toEqual(action);
});
it.each([
"{",
JSON.stringify({ eventType: COMMAND_PALETTE_OPEN_EVENT, extra: true }),
@@ -76,7 +76,6 @@ describe("sidebar routed-lineage freshness", () => {
},
),
);
harness.reconcile.mockClear();
harness.publishList({ result: result(offline) });
expect(sidebar.sessionData.activeSessionLineageSelectedRow).toMatchObject({
@@ -84,17 +83,5 @@ describe("sidebar routed-lineage freshness", () => {
derivedTitle: "My device session",
lastMessagePreview: "Most recent message",
});
await waitForFast(() =>
expect(harness.reconcile).toHaveBeenCalledWith(
expect.objectContaining({
placement: expect.objectContaining({ runner: { kind: "device", status: "offline" } }),
}),
result(offline).defaults,
{
archivedFilter: "all",
sourceCanonicalListRevision: harness.sessions.canonicalListRevision,
},
),
);
});
});
@@ -114,7 +114,6 @@ describe("supplemental session reconciliation", () => {
const sessions = capabilityWithList(sessionsResult([canonical], 10));
const sourceCanonicalListRevision = sessions.canonicalListRevision;
await sessions.refresh({ force: true });
const reconcile = vi.spyOn(sessions, "reconcile");
const cached = {
...canonical,
updatedAt: 20,
@@ -141,11 +140,6 @@ describe("supplemental session reconciliation", () => {
sourceCanonicalListRevision,
);
expect(reconcile).toHaveBeenCalledWith(
expect.objectContaining({ placement: placement("offline") }),
sessions.state.result?.defaults,
{ archivedFilter: "all", sourceCanonicalListRevision },
);
expect(sessions.state.result?.sessions[0]?.placement).toEqual(placement("offline"));
expect(owner.activeSessionLineageSelectedRow).toMatchObject({
placement: placement("offline"),
@@ -159,7 +153,6 @@ describe("supplemental session reconciliation", () => {
const sessions = capabilityWithList(sessionsResult([], 10));
const sourceCanonicalListRevision = sessions.canonicalListRevision;
await sessions.refresh({ force: true });
const reconcile = vi.spyOn(sessions, "reconcile");
const archived = {
key: "agent:main:archived-routed",
kind: "direct" as const,
@@ -182,10 +175,6 @@ describe("supplemental session reconciliation", () => {
sourceCanonicalListRevision,
);
expect(reconcile).toHaveBeenCalledWith(archived, sessions.state.result?.defaults, {
archivedFilter: "all",
sourceCanonicalListRevision,
});
expect(sessions.state.result?.sessions).toEqual([archived]);
sessions.dispose();
});