test(etapi): deduplicate cloning in delete-entities

This commit is contained in:
Elian Doran 2025-06-03 19:24:23 +03:00
parent cd310119bc
commit 931f9e572a
No known key found for this signature in database

View File

@ -39,14 +39,8 @@ describe("etapi/delete-entities", () => {
}); });
it("deletes cloned branch", async () => { it("deletes cloned branch", async () => {
const response = await supertest(app) const clonedBranchId = await createClone();
.post("/etapi/branches")
.auth(USER, token, { "type": "basic"})
.send({
noteId: createdNoteId,
parentNoteId: "_hidden"
});
const clonedBranchId = response.body.branchId;
await expectFound("branches", createdBranchId); await expectFound("branches", createdBranchId);
await expectFound("branches", clonedBranchId); await expectFound("branches", clonedBranchId);
@ -60,14 +54,7 @@ describe("etapi/delete-entities", () => {
it("deletes note with all branches", async () => { it("deletes note with all branches", async () => {
const attributeId = await createAttribute(); const attributeId = await createAttribute();
const response = await supertest(app) const clonedBranchId = await createClone();
.post("/etapi/branches")
.auth(USER, token, { "type": "basic"})
.send({
noteId: createdNoteId,
parentNoteId: "_hidden"
});
const clonedBranchId = response.body.branchId;
await expectFound("notes", createdNoteId); await expectFound("notes", createdNoteId);
await expectFound("branches", createdBranchId); await expectFound("branches", createdBranchId);