@@ -4,26 +4,26 @@ import { formatDocsLink } from "./links.js";
|
4 | 4 | describe("formatDocsLink", () => { |
5 | 5 | it("prepends the docs root when given a relative path", () => { |
6 | 6 | const out = formatDocsLink("/channels/quietchat", "quietchat"); |
7 | | -expect(out).toContain("https://docs.openclaw.ai/channels/quietchat"); |
| 7 | +expect(out).toBe("https://docs.openclaw.ai/channels/quietchat"); |
8 | 8 | }); |
9 | 9 | |
10 | 10 | it("preserves an absolute http url", () => { |
11 | 11 | const out = formatDocsLink("https://example.com/page", "page"); |
12 | | -expect(out).toContain("https://example.com/page"); |
| 12 | +expect(out).toBe("https://example.com/page"); |
13 | 13 | }); |
14 | 14 | |
15 | 15 | it("treats whitespace-only path like an empty path and falls back to docs root", () => { |
16 | 16 | const out = formatDocsLink(" ", "root"); |
17 | | -expect(out).toContain("https://docs.openclaw.ai"); |
| 17 | +expect(out).toBe("https://docs.openclaw.ai"); |
18 | 18 | }); |
19 | 19 | |
20 | 20 | it("falls back to docs root when path is undefined (regression: #67076, #67074)", () => { |
21 | 21 | const out = formatDocsLink(undefined as unknown as string, "label"); |
22 | | -expect(out).toContain("https://docs.openclaw.ai"); |
| 22 | +expect(out).toBe("https://docs.openclaw.ai"); |
23 | 23 | }); |
24 | 24 | |
25 | 25 | it("falls back to docs root when path is null", () => { |
26 | 26 | const out = formatDocsLink(null as unknown as string); |
27 | | -expect(out).toContain("https://docs.openclaw.ai"); |
| 27 | +expect(out).toBe("https://docs.openclaw.ai"); |
28 | 28 | }); |
29 | 29 | }); |