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,3 +1,4 @@
import { faker } from "@faker-js/faker";
import { CollectionPermission } from "@shared/types";
import { buildUser, buildTeam, buildCollection } from "@server/test/factories";
import CollectionUser from "./CollectionUser";
@@ -42,10 +43,11 @@ describe("user model", () => {
describe("availableTeams", () => {
it("should return teams where another user with the same email exists", async () => {
const email = faker.internet.email().toLowerCase();
const user = await buildUser({
email: "user-available-teams@example.com",
email,
});
const anotherUser = await buildUser({ email: user.email });
const anotherUser = await buildUser({ email });
const response = await user.availableTeams();
expect(response.length).toEqual(2);