Improve reliability of document operations with websocket disconnected

This commit is contained in:
Tom Moor
2023-10-22 23:21:33 -04:00
parent 1abe4964e8
commit 5fc68db5da
3 changed files with 24 additions and 80 deletions

View File

@@ -3360,40 +3360,6 @@ describe("#documents.update", () => {
expect(res.status).toBe(400);
expect(body.message).toBe("id: Required");
});
describe("apiVersion=2", () => {
it("should successfully publish a draft", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const document = await buildDraftDocument({
title: "title",
text: "text",
teamId: team.id,
collectionId: null,
});
const res = await server.post("/api/documents.update", {
body: {
apiVersion: 2,
token: user.getJwtToken(),
id: document.id,
title: "Updated title",
text: "Updated text",
collectionId: collection.id,
publish: true,
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.document.collectionId).toBe(collection.id);
expect(body.data.document.title).toBe("Updated title");
expect(body.data.document.text).toBe("Updated text");
});
});
});
describe("#documents.archive", () => {