Skip to content

Commit

Permalink
test(api): clearer mock name
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-telescoop committed Jan 7, 2025
1 parent 504272d commit 8fe601e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ObjectId, WithId } from "mongodb";

const toDboMock = jest.spyOn(OsirisActionAdapter, "toDbo");
const toEntityMock = jest.spyOn(OsirisActionAdapter, "toEntity");
const findByOsirisIdMock = jest.spyOn(OsirisActionPort.prototype, "findByUniqueId");
const findByUniqueIdMock = jest.spyOn(OsirisActionPort.prototype, "findByUniqueId");

describe("OsirisActionPort", () => {
let port: OsirisActionPort;
Expand All @@ -35,7 +35,7 @@ describe("OsirisActionPort", () => {
describe("add()", () => {
it("should insert an OsirisActionEntityDbo and return entity", async () => {
// @ts-expect-error: mock
findByOsirisIdMock.mockImplementationOnce(jest.fn(() => ({})));
findByUniqueIdMock.mockImplementationOnce(jest.fn(() => ({})));
toDboMock.mockImplementationOnce(jest.fn());
const entity = await port.add(ENTITY);
expect(toDboMock).toHaveBeenCalledWith(ENTITY);
Expand Down

0 comments on commit 8fe601e

Please sign in to comment.