test: strengthen user-path coverage and CI gates (#5308)

This commit is contained in:
chengyongru
2026-08-09 21:37:06 +08:00
committed by GitHub
parent 411d6061ae
commit 55ecda275d
19 changed files with 1090 additions and 87 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
import { act, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -399,9 +399,14 @@ describe("SettingsView Apps catalog", () => {
dispatchEvent: vi.fn(),
})),
);
vi.stubGlobal(
"fetch",
vi.fn(() => new Promise<Response>(() => {})),
);
});
afterEach(() => {
cleanup();
localStorage.removeItem("nanobot-webui.settings-preferences");
vi.useRealTimers();
vi.unstubAllGlobals();