Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { describe, expect, test } from "bun:test"; |
| 2 | import { resolveCopyLinkUrl } from "../../lib/copy-link"; |
| 3 | |
| 4 | describe("resolveCopyLinkUrl", () => { |
| 5 | test("keeps the current pathname for anchor links", () => { |
| 6 | expect( |
| 7 | resolveCopyLinkUrl( |
| 8 | "#2026-04-08", |
| 9 | "https://docs.composio.dev/reference/changelog" |
| 10 | ) |
| 11 | ).toBe("https://docs.composio.dev/reference/changelog#2026-04-08"); |
| 12 | }); |
| 13 | |
| 14 | test("resolves site-relative links from the docs origin", () => { |
| 15 | expect( |
| 16 | resolveCopyLinkUrl( |
| 17 | "/docs/changelog/2026/04/08", |
| 18 | "https://docs.composio.dev/reference/changelog" |
| 19 | ) |
| 20 | ).toBe("https://docs.composio.dev/docs/changelog/2026/04/08"); |
| 21 | }); |
| 22 | }); |