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

@@ -1,3 +1,4 @@
import { faker } from "@faker-js/faker";
import { UserRole } from "@shared/types";
import { buildUser } from "@server/test/factories";
import { setupTestDatabase } from "@server/test/support";
@@ -14,7 +15,7 @@ describe("userInviter", () => {
invites: [
{
role: UserRole.Member,
email: "test@example.com",
email: faker.internet.email(),
name: "Test",
},
],
@@ -78,12 +79,13 @@ describe("userInviter", () => {
});
it("should not send invites to existing team members", async () => {
const user = await buildUser();
const email = faker.internet.email().toLowerCase();
const user = await buildUser({ email });
const response = await userInviter({
invites: [
{
role: UserRole.Member,
email: user.email!,
email,
name: user.name,
},
],