chore: Improve perf of server tests (#5785)
This commit is contained in:
@@ -137,7 +137,10 @@ describe("revisions.create", () => {
|
||||
const collaborator0 = await buildUser();
|
||||
const collaborator1 = await buildUser({ teamId: collaborator0.teamId });
|
||||
const collaborator2 = await buildUser({ teamId: collaborator0.teamId });
|
||||
const document = await buildDocument({ userId: collaborator0.id });
|
||||
const document = await buildDocument({
|
||||
teamId: collaborator0.teamId,
|
||||
userId: collaborator0.id,
|
||||
});
|
||||
await Revision.createFromDocument(document);
|
||||
document.text = "Updated body content";
|
||||
document.updatedAt = new Date();
|
||||
@@ -159,7 +162,11 @@ describe("revisions.create", () => {
|
||||
ip,
|
||||
});
|
||||
|
||||
const events = await Event.findAll();
|
||||
const events = await Event.findAll({
|
||||
where: {
|
||||
teamId: document.teamId,
|
||||
},
|
||||
});
|
||||
|
||||
// Should emit 3 `subscriptions.create` events.
|
||||
expect(events.length).toEqual(3);
|
||||
@@ -254,7 +261,11 @@ describe("revisions.create", () => {
|
||||
ip,
|
||||
});
|
||||
|
||||
const events = await Event.findAll();
|
||||
const events = await Event.findAll({
|
||||
where: {
|
||||
teamId: document.teamId,
|
||||
},
|
||||
});
|
||||
|
||||
// Should emit 2 `subscriptions.create` events.
|
||||
expect(events.length).toEqual(2);
|
||||
|
||||
Reference in New Issue
Block a user