test: simplify browser doctor warning ids · openclaw/openclaw@35363a2
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
File tree
extensions/browser/src/browser
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { describe, expect, it } from "vitest"; |
2 | 2 | import { buildBrowserDoctorReport } from "./doctor.js"; |
3 | 3 | |
| 4 | +function collectWarningCheckIds(checks: readonly { id: string; status: string }[]): string[] { |
| 5 | +const ids: string[] = []; |
| 6 | +for (const check of checks) { |
| 7 | +if (check.status === "warn") { |
| 8 | +ids.push(check.id); |
| 9 | +} |
| 10 | +} |
| 11 | +return ids; |
| 12 | +} |
| 13 | + |
4 | 14 | describe("buildBrowserDoctorReport", () => { |
5 | 15 | it("reports stopped managed browsers as launchable diagnostics", () => { |
6 | 16 | const report = buildBrowserDoctorReport({ |
@@ -101,9 +111,11 @@ describe("buildBrowserDoctorReport", () => {
|
101 | 111 | }); |
102 | 112 | |
103 | 113 | expect(report.ok).toBe(true); |
104 | | -expect( |
105 | | -report.checks.filter((check) => check.status === "warn").map((check) => check.id), |
106 | | -).toEqual(["managed-executable", "display", "linux-sandbox"]); |
| 114 | +expect(collectWarningCheckIds(report.checks)).toEqual([ |
| 115 | +"managed-executable", |
| 116 | +"display", |
| 117 | +"linux-sandbox", |
| 118 | +]); |
107 | 119 | expect(report.checks.find((check) => check.id === "display")).toMatchObject({ |
108 | 120 | summary: "No DISPLAY or WAYLAND_DISPLAY is set while headed mode is selected (config)", |
109 | 121 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。