@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 25 lines 1.03 KB
Raw
1 import { describe, expect, it } from "vite-plus/test";
2 import { EnvironmentId } from "@t3tools/contracts";
3 import { filePreviewGallery } from "../../lib/filePreviewGallery";
4 import { pullRequestImageSource } from "./pullRequestMediaSource";
5
6 const location = {
7 environmentId: EnvironmentId.make("test"),
8 cwd: "/repo",
9 repository: "enterprise/private",
10 };
11 const url = "https://github.com/user-attachments/assets/abc-123";
12
13 describe("PR media previews", () => {
14 it("keeps every gallery image resolvable and the tapped image appears only once", () => {
15 const first = pullRequestImageSource(url, location);
16 const second = pullRequestImageSource(`${url}-second`, location);
17 const selected = { ...second, sourceIdentifier: "tapped" };
18 const gallery = filePreviewGallery(selected, [first, second]);
19 expect(gallery).toEqual([first, selected]);
20 expect(gallery).toMatchObject([
21 { resource: { url, repository: location.repository } },
22 { resource: { url: `${url}-second`, repository: location.repository } },
23 ]);
24 });
25 });