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
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { workGroupImageGallery } from "./markdownImageGallery"; |
| 4 | |
| 5 | const item = (name: string) => ({ src: `https://assets.test/${name}`, name }); |
| 6 | |
| 7 | describe("workGroupImageGallery", () => { |
| 8 | it("pages the clicked image through the group's resolved images", () => { |
| 9 | const clicked = { ...item("second.png"), src: "https://assets.test/second.png#fresh" }; |
| 10 | const viewed = [ |
| 11 | { path: "/repo/first.png", item: item("first.png") }, |
| 12 | { path: "/repo/pending.png", item: null }, |
| 13 | { path: "/repo/second.png", item: item("second.png") }, |
| 14 | { path: "/repo/third.png", item: item("third.png") }, |
| 15 | ]; |
| 16 | expect( |
| 17 | workGroupImageGallery(viewed, "/repo/second.png", { images: [clicked], index: 0 }), |
| 18 | ).toEqual({ images: [item("first.png"), clicked, item("third.png")], index: 1 }); |
| 19 | const single = { images: [clicked], index: 0 }; |
| 20 | expect(workGroupImageGallery(viewed, "/repo/other.png", single)).toBe(single); |
| 21 | }); |
| 22 | }); |