chore: More flakey test improvements (#5801)

This commit is contained in:
Tom Moor
2023-09-09 18:30:19 -04:00
committed by GitHub
parent 7270e65f0c
commit 80ef0a38d6
37 changed files with 245 additions and 210 deletions

View File

@@ -36,8 +36,10 @@ describe("#attachments.create", () => {
expect(res.status).toEqual(200);
const body = await res.json();
const attachment = await Attachment.findByPk(body.data.attachment.id);
expect(attachment!.expiresAt).toBeNull();
const attachment = await Attachment.findByPk(body.data.attachment.id, {
rejectOnEmpty: true,
});
expect(attachment.expiresAt).toBeNull();
});
it("should allow attachment creation for documents", async () => {
@@ -71,8 +73,10 @@ describe("#attachments.create", () => {
expect(res.status).toEqual(200);
const body = await res.json();
const attachment = await Attachment.findByPk(body.data.attachment.id);
expect(attachment!.expiresAt).toBeTruthy();
const attachment = await Attachment.findByPk(body.data.attachment.id, {
rejectOnEmpty: true,
});
expect(attachment.expiresAt).toBeTruthy();
});
it("should not allow attachment creation for other documents", async () => {