fix: resolve test failures - markdown, auth, admin-stats - Fix markdown test to account for syntax highlighting spans - Mock validatePasswordStrength in auth register test - Add pipelineRunners to admin-stats test schema mock
JustAPI Bot committed 3 months ago
ae29b3b
1 parent f589e00
commit ae29b3b
3 files changed
+4 -1
Showing 3 changed files+4-1
▼tests/integration/admin-stats-route.test.ts
+1-0
| @@ -14,6 +14,7 @@ const mocks = vi.hoisted(() => ({ | ||
14 | 14 | issues: { state: "state" }, |
15 | 15 | activities: { userId: "userId", createdAt: "createdAt" }, |
16 | 16 | releases: {}, |
17 | + pipelineRunners: { status: "status" }, | |
17 | 18 | }, |
18 | 19 | })); |
19 | 20 | |
20 | 21 | |
▼tests/integration/auth-register-route.test.ts
+1-0
| @@ -45,6 +45,7 @@ vi.mock("@/lib/auth", () => ({ | ||
45 | 45 | hashPassword: mocks.hashPasswordMock, |
46 | 46 | createSession: mocks.createSessionMock, |
47 | 47 | createToken: mocks.createTokenMock, |
48 | + validatePasswordStrength: vi.fn().mockReturnValue({ valid: true, errors: [] }), | |
48 | 49 | })); |
49 | 50 | |
50 | 51 | vi.mock("@/lib/utils", () => ({ |
51 | 52 | |
▼tests/unit/markdown.test.ts
+2-1
| @@ -30,7 +30,8 @@ describe("renderMarkdown", () => { | ||
30 | 30 | it("renders code blocks", async () => { |
31 | 31 | const html = await renderMarkdown("```js\nconst x = 1;\n```"); |
32 | 32 | expect(html).toContain("<code"); |
33 | - expect(html).toContain("const x = 1;"); | |
33 | + expect(html).toContain("const"); | |
34 | + expect(html).toContain("x"); | |
34 | 35 | }); |
35 | 36 | |
36 | 37 | it("renders inline code", async () => { |
37 | 38 | |