link-generation.test.js
664 bytes
| 1 | import { afterEach, describe, expect, it } from "vitest"; |
|---|---|
| 2 | import { createShare, makeHarness } from "./helpers.js"; |
| 3 | |
| 4 | describe("link generation", () => { |
| 5 | let harness; |
| 6 | afterEach(() => harness.close()); |
| 7 | |
| 8 | it("creates a simple public URL with the chosen duration", async () => { |
| 9 | harness = makeHarness(); |
| 10 | const { id, response } = await createShare(harness, [101], 12); |
| 11 | expect(response.text).toContain(`http://profileshare.test/s/${id}`); |
| 12 | expect(harness.store.getShare(id).expires_at).toBe("2026-08-04T12:00:00.000Z"); |
| 13 | expect(response.text).toContain("Review snapshot before sharing"); |
| 14 | expect(response.text).toContain("2 commits"); |
| 15 | }); |
| 16 | }); |
| 17 | |