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

@@ -4,11 +4,9 @@ import { buildDocument, buildUser } from "@server/test/factories";
import { getTestServer } from "@server/test/support";
import resolvers from "@server/utils/unfurl";
jest.mock("@server/utils/unfurl", () => ({
Iframely: {
unfurl: jest.fn(),
},
}));
jest
.spyOn(resolvers.Iframely, "unfurl")
.mockImplementation(async (_: string) => false);
const server = getTestServer();
@@ -166,6 +164,7 @@ describe("#urls.unfurl", () => {
},
});
expect(res.status).toEqual(200);
const body = await res.json();
expect(resolvers.Iframely.unfurl).toHaveBeenCalledWith(