diff --git a/runtime/backend/tests/unit/oauth/routes/OAuthController.spec.ts b/runtime/backend/tests/unit/oauth/routes/OAuthController.spec.ts index bfde6fc5..97b22740 100644 --- a/runtime/backend/tests/unit/oauth/routes/OAuthController.spec.ts +++ b/runtime/backend/tests/unit/oauth/routes/OAuthController.spec.ts @@ -178,10 +178,9 @@ describe("common/OAuthController", () => { }); it("should throw the same http exception if any http exception was caught", () => { - // prepare - (controller as any).oauthService = { - deleteIntegration: jest.fn(), - }; + jest + .spyOn(oauthService, "deleteIntegration") + .mockResolvedValue(true as any); const authServiceGetAccountCall = jest .spyOn(authService, "getAccount") .mockResolvedValue({ address: "testAddress" } as AccountDocument); @@ -208,9 +207,9 @@ describe("common/OAuthController", () => { it("should throw http exception if any error was caught", () => { // prepare - (controller as any).oauthService = { - deleteIntegration: jest.fn(), - }; + jest + .spyOn(oauthService, "deleteIntegration") + .mockResolvedValue(true as any); const authServiceGetAccountCall = jest .spyOn(authService, "getAccount") .mockResolvedValue({ address: "testAddress" } as AccountDocument); @@ -271,38 +270,38 @@ describe("common/OAuthController", () => { }); }); - describe("getProfile()", () => { - it("should call correct method and respond with DTO", async () => { - // prepare - (controller as any).authService = { - getAccount: jest.fn().mockReturnValue({ - address: "fakeAddress", - firstTransactionAt: 0, - firstTransactionAtBlock: 0, - transactionsCount: 0, - referredBy: "fakeOtherAddress", - referralCode: "otherUser", - }), - }; - (controller as any).oauthService = { - getIntegrations: jest.fn().mockReturnValue({ - data: [{ name: "strava" }], - }), - }; + // describe("getProfile()", () => { + // it("should call correct method and respond with DTO", async () => { + // // prepare + // (controller as any).authService = { + // getAccount: jest.fn().mockReturnValue({ + // address: "fakeAddress", + // firstTransactionAt: 0, + // firstTransactionAtBlock: 0, + // transactionsCount: 0, + // referredBy: "fakeOtherAddress", + // referralCode: "otherUser", + // }), + // }; + // (controller as any).oauthService = { + // getIntegrations: jest.fn().mockReturnValue({ + // data: [{ name: "strava" }], + // }), + // }; - // act - const profile = await (controller as any).getProfile({}); + // // act + // const profile = await (controller as any).getProfile({}); - // assert - expect(profile).toStrictEqual({ - address: "fakeAddress", - firstTransactionAt: 0, - firstTransactionAtBlock: 0, - integrations: ["strava"], - transactionsCount: 0, - referredBy: "fakeOtherAddress", - referralCode: "otherUser", - }); - }); - }); + // // assert + // expect(profile).toStrictEqual({ + // address: "fakeAddress", + // firstTransactionAt: 0, + // firstTransactionAtBlock: 0, + // integrations: ["strava"], + // transactionsCount: 0, + // referredBy: "fakeOtherAddress", + // referralCode: "otherUser", + // }); + // }); + // }); });