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

@@ -1,6 +1,5 @@
import { Star } from "@server/models";
import { Event, Star } from "@server/models";
import { buildDocument, buildUser } from "@server/test/factories";
import { findLatestEvent } from "@server/test/support";
import starDestroyer from "./starDestroyer";
describe("starDestroyer", () => {
@@ -34,7 +33,9 @@ describe("starDestroyer", () => {
});
expect(count).toEqual(0);
const event = await findLatestEvent();
const event = await Event.findLatest({
teamId: user.teamId,
});
expect(event!.name).toEqual("stars.delete");
expect(event!.modelId).toEqual(star.id);
});