diff --git a/src/gateway/probe.auth.integration.test.ts b/src/gateway/probe.auth.integration.test.ts index 07e57dcef5c3..153f50a6303f 100644 --- a/src/gateway/probe.auth.integration.test.ts +++ b/src/gateway/probe.auth.integration.test.ts @@ -116,25 +116,19 @@ describe("probeGateway auth integration", () => { expect(fs.existsSync(statePath("identity", "device-auth.json"))).toBe(false); }); - describe("with cached device auth", () => { - let cachedProbeResult: Awaited>; - - beforeAll(async () => { - const token = requireGatewayToken(); - await seedCachedOperatorToken(["operator.read"]); - cachedProbeResult = await probeGateway({ - url: `ws://127.0.0.1:${gatewayHarness.port}`, - auth: { token }, - timeoutMs: 5_000, - }); + it("keeps detail RPCs available for local authenticated probes with cached device auth", async () => { + const token = requireGatewayToken(); + await seedCachedOperatorToken(["operator.read"]); + const result = await probeGateway({ + url: `ws://127.0.0.1:${gatewayHarness.port}`, + auth: { token }, + timeoutMs: 10_000, }); - it("keeps detail RPCs available for local authenticated probes with cached device auth", async () => { - expect(cachedProbeResult.ok).toBe(true); - expect(cachedProbeResult.error).toBeNull(); - expectRecord(cachedProbeResult.health, "probe health"); - expectRecord(cachedProbeResult.status, "probe status"); - expectRecord(cachedProbeResult.configSnapshot, "probe config snapshot"); - }); + expect(result.ok).toBe(true); + expect(result.error).toBeNull(); + expectRecord(result.health, "probe health"); + expectRecord(result.status, "probe status"); + expectRecord(result.configSnapshot, "probe config snapshot"); }); }); diff --git a/ui/src/pages/profile/profile-page.test.ts b/ui/src/pages/profile/profile-page.test.ts index 969e36224b30..1fb992f724fe 100644 --- a/ui/src/pages/profile/profile-page.test.ts +++ b/ui/src/pages/profile/profile-page.test.ts @@ -236,9 +236,12 @@ it("gates profile usage refreshes by payload age and page visibility", async () pendingFiles: 1, staleFiles: 0, }); - page.lastProfileLoadedAtMs = Date.now(); + const nowMs = Date.now(); + const nowSpy = vi.spyOn(Date, "now").mockReturnValue(nowMs); + page.lastProfileLoadedAtMs = nowMs; page.scheduleCacheSettleRefresh(); expect(settleDelayMs).toBe(USAGE_PAYLOAD_TTL_MS); + nowSpy.mockRestore(); page.lastProfileLoadedAtMs = Date.now() - USAGE_PAYLOAD_TTL_MS; visibility.mockReturnValue("hidden");