read-only.test.js
659 bytes
| 1 | import { afterEach, describe, expect, it } from "vitest"; |
|---|---|
| 2 | import { createShare, makeHarness } from "./helpers.js"; |
| 3 | |
| 4 | describe("read only", () => { |
| 5 | let harness; |
| 6 | afterEach(() => harness.close()); |
| 7 | |
| 8 | it("has no viewer mutation, comment, or download controls", async () => { |
| 9 | harness = makeHarness(); |
| 10 | const { id } = await createShare(harness); |
| 11 | const page = await harness.agent.get(`/s/${id}/repositories/101`).expect(200); |
| 12 | expect(page.text).not.toMatch(/<form[^>]+method=["']?post|download=|add comment|edit file/i); |
| 13 | expect(page.text).toContain('method="get" role="search"'); |
| 14 | expect(page.text).toContain("Read-only snapshot"); |
| 15 | }); |
| 16 | }); |
| 17 | |