diff --git a/src/infra/provider-activity.test.ts b/src/infra/provider-activity.test.ts index 5c8e08387..85ae8c6d5 100644 --- a/src/infra/provider-activity.test.ts +++ b/src/infra/provider-activity.test.ts @@ -1,4 +1,4 @@ -import { beforeEach, describe, expect, it, vi } from "vitest"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { getProviderActivity, @@ -13,6 +13,10 @@ describe("provider activity", () => { vi.setSystemTime(new Date("2026-01-08T00:00:00Z")); }); + afterEach(() => { + vi.useRealTimers(); + }); + it("records inbound/outbound separately", () => { recordProviderActivity({ provider: "telegram", direction: "inbound" }); vi.advanceTimersByTime(1000); @@ -35,13 +39,17 @@ describe("provider activity", () => { direction: "inbound", at: 2, }); - expect(getProviderActivity({ provider: "whatsapp", accountId: "a" })).toEqual({ - inboundAt: 1, - outboundAt: null, - }); - expect(getProviderActivity({ provider: "whatsapp", accountId: "b" })).toEqual({ - inboundAt: 2, - outboundAt: null, - }); + expect(getProviderActivity({ provider: "whatsapp", accountId: "a" })).toEqual( + { + inboundAt: 1, + outboundAt: null, + }, + ); + expect(getProviderActivity({ provider: "whatsapp", accountId: "b" })).toEqual( + { + inboundAt: 2, + outboundAt: null, + }, + ); }); });