mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-21 19:15:47 +00:00
test: simplify browser doctor warning ids
This commit is contained in:
parent
4fb3bd845f
commit
35363a279b
1 changed files with 15 additions and 3 deletions
|
|
@ -1,6 +1,16 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { buildBrowserDoctorReport } from "./doctor.js";
|
||||
|
||||
function collectWarningCheckIds(checks: readonly { id: string; status: string }[]): string[] {
|
||||
const ids: string[] = [];
|
||||
for (const check of checks) {
|
||||
if (check.status === "warn") {
|
||||
ids.push(check.id);
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
describe("buildBrowserDoctorReport", () => {
|
||||
it("reports stopped managed browsers as launchable diagnostics", () => {
|
||||
const report = buildBrowserDoctorReport({
|
||||
|
|
@ -101,9 +111,11 @@ describe("buildBrowserDoctorReport", () => {
|
|||
});
|
||||
|
||||
expect(report.ok).toBe(true);
|
||||
expect(
|
||||
report.checks.filter((check) => check.status === "warn").map((check) => check.id),
|
||||
).toEqual(["managed-executable", "display", "linux-sandbox"]);
|
||||
expect(collectWarningCheckIds(report.checks)).toEqual([
|
||||
"managed-executable",
|
||||
"display",
|
||||
"linux-sandbox",
|
||||
]);
|
||||
expect(report.checks.find((check) => check.id === "display")).toMatchObject({
|
||||
summary: "No DISPLAY or WAYLAND_DISPLAY is set while headed mode is selected (config)",
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue