chore: Improve perf of server tests (#5785)

This commit is contained in:
Tom Moor
2023-09-06 07:14:49 -04:00
committed by GitHub
parent a724a21c21
commit 3eb947e9a5
69 changed files with 2045 additions and 1551 deletions

View File

@@ -191,7 +191,13 @@ describe("#attachments.delete", () => {
},
});
expect(res.status).toEqual(200);
expect(await Attachment.count()).toEqual(0);
expect(
await Attachment.count({
where: {
teamId: user.teamId,
},
})
).toEqual(0);
});
it("should allow deleting an attachment without a document created by user", async () => {
@@ -209,7 +215,13 @@ describe("#attachments.delete", () => {
},
});
expect(res.status).toEqual(200);
expect(await Attachment.count()).toEqual(0);
expect(
await Attachment.count({
where: {
teamId: user.teamId,
},
})
).toEqual(0);
});
it("should allow deleting an attachment without a document if admin", async () => {
@@ -226,7 +238,13 @@ describe("#attachments.delete", () => {
},
});
expect(res.status).toEqual(200);
expect(await Attachment.count()).toEqual(0);
expect(
await Attachment.count({
where: {
teamId: user.teamId,
},
})
).toEqual(0);
});
it("should not allow deleting an attachment in another team", async () => {