Expose distribution board copy and delete API
This commit is contained in:
@@ -28,7 +28,9 @@ import {
|
||||
type DistributionBoardUpdateProjectCommand,
|
||||
} from "../src/domain/models/distribution-board-project-command.model.js";
|
||||
import {
|
||||
copyDistributionBoard,
|
||||
createDistributionBoard,
|
||||
deleteDistributionBoard,
|
||||
updateDistributionBoard,
|
||||
} from "../src/frontend/utils/api.js";
|
||||
|
||||
@@ -568,7 +570,7 @@ describe("distribution-board structure project command", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("sends distribution-board updates to the revision-safe API", async () => {
|
||||
it("sends distribution-board writes to the revision-safe API", async () => {
|
||||
const requests: Array<{ url: string; method: string; body: unknown }> = [];
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (input, init) => {
|
||||
@@ -593,6 +595,17 @@ describe("distribution-board structure project command", () => {
|
||||
},
|
||||
9
|
||||
);
|
||||
await copyDistributionBoard(
|
||||
"project-1",
|
||||
"board-1",
|
||||
"UV 1 Kopie",
|
||||
10
|
||||
);
|
||||
await deleteDistributionBoard(
|
||||
"project-1",
|
||||
"board-1",
|
||||
11
|
||||
);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
@@ -607,6 +620,21 @@ describe("distribution-board structure project command", () => {
|
||||
expectedRevision: 9,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: "/api/projects/project-1/distribution-boards/board-1/copy",
|
||||
method: "POST",
|
||||
body: {
|
||||
name: "UV 1 Kopie",
|
||||
expectedRevision: 10,
|
||||
},
|
||||
},
|
||||
{
|
||||
url: "/api/projects/project-1/distribution-boards/board-1",
|
||||
method: "DELETE",
|
||||
body: {
|
||||
expectedRevision: 11,
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user