feat: write the mairie status back to Nextcloud over CalDAV
REPORT by UID gives href + ETag + calendar-data, then PUT with If-Match: the resource URL is never guessed and a concurrent edit yields 412 instead of an overwrite. URL_COLLECTION is derived from URL_CALENDRIER.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import {
|
||||
URL_CALENDRIER,
|
||||
URL_COLLECTION,
|
||||
recupererFluxCalendrier,
|
||||
} from "./extension/nextcloud.js";
|
||||
|
||||
@@ -64,3 +65,11 @@ describe("recupererFluxCalendrier", () => {
|
||||
expect(optionsVues).toEqual({ credentials: "include" });
|
||||
});
|
||||
});
|
||||
|
||||
describe("URL_COLLECTION", () => {
|
||||
test("= URL_CALENDRIER sans ?export, et se termine par /", () => {
|
||||
expect(URL_COLLECTION).toBe(URL_CALENDRIER.replace("?export", ""));
|
||||
expect(URL_COLLECTION.endsWith("/")).toBe(true);
|
||||
expect(URL_COLLECTION).not.toContain("?export");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user