d204db4 skipped any id that is not all digits, which also skipped real ids the desk can answer (main's CI has been
red since, on the delivery test that checks a replaced photo's old image is taken back). Only the placeholder that
`upload` returns when the desk already had the file is skipped now, with a test of its own.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SC7s5gwdivkoBXbRGxbnAo
17 lines
798 B
TypeScript
17 lines
798 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { ZerozeroClient } from "./zerozero.js";
|
|
|
|
describe("zerozero remove", () => {
|
|
it("never asks the desk to delete a \"synced-\" placeholder (a real image is taken back: test/delivery.test.ts)", async () => {
|
|
const calls: string[] = [];
|
|
const fetchImpl: typeof fetch = async (input, init) => {
|
|
calls.push(`${init?.method ?? "GET"} ${new URL(String(input)).pathname}`);
|
|
return new Response(null, { status: 204 });
|
|
};
|
|
const client = new ZerozeroClient({ username: "u", password: "p" }, fetchImpl);
|
|
// When the desk already had the file, upload answers this placeholder: there was never an image of ours.
|
|
await client.remove("synced-PS_SC Torreense x Sunderland_1.jpg");
|
|
expect(calls).toEqual([]);
|
|
});
|
|
});
|