完善 CI 质量门禁并启用覆盖率阈值

This commit is contained in:
2026-03-03 13:02:31 +08:00
parent 4cd593bc30
commit 41ac21ea12
8 changed files with 213 additions and 19 deletions
+13 -3
View File
@@ -70,9 +70,14 @@ beforeEach(() => {
});
describe("ProfilePage", () => {
it("renders profile heading", () => {
it("renders profile heading", async () => {
renderPage();
expect(screen.getByText("个人中心")).toBeInTheDocument();
expect(await screen.findByText("个人中心")).toBeInTheDocument();
await waitFor(() => {
expect(mockFetch).toHaveBeenCalledWith(
"/api/user?id=user-1",
);
});
});
it("fetches user profile data with correct URL", async () => {
@@ -91,8 +96,13 @@ describe("ProfilePage", () => {
});
});
it("renders navigation element", () => {
it("renders navigation element", async () => {
renderPage();
await waitFor(() => {
expect(mockFetch).toHaveBeenCalledWith(
"/api/user?id=user-1",
);
});
expect(screen.getByRole("navigation")).toBeInTheDocument();
});
});