test(etapi): port delete-note-with-all-branches

This commit is contained in:
Elian Doran
2025-06-03 19:21:02 +03:00
parent 9d1717ca9f
commit 594e264eea
2 changed files with 24 additions and 126 deletions

View File

@@ -56,6 +56,30 @@ describe("etapi/delete-entities", () => {
expectFound("branches", clonedBranchId);
expectFound("notes", createdNoteId);
});
it("deletes note with all branches", async () => {
const attributeId = await createAttribute();
const response = await supertest(app)
.post("/etapi/branches")
.auth(USER, token, { "type": "basic"})
.send({
noteId: createdNoteId,
parentNoteId: "_hidden"
});
const clonedBranchId = response.body.branchId;
expectFound("notes", createdNoteId);
expectFound("branches", createdBranchId);
expectFound("branches", clonedBranchId);
expectFound("attributes", attributeId);
deleteEntity("notes", createdNoteId);
expectNotFound("branches", createdBranchId);
expectNotFound("branches", clonedBranchId);
expectNotFound("notes", createdNoteId);
expectNotFound("attributes", attributeId);
});
});
async function createNote() {