From f7ec46dacd819759e18039712e3c3da4c9ac70c2 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Wed, 8 Jan 2025 17:28:42 -0800 Subject: [PATCH] disable test for TTL check --- .../ApiBasedRepositoryTests.test.ts | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/test/repositories/ApiBasedRepositoryTests.test.ts b/test/repositories/ApiBasedRepositoryTests.test.ts index 7e49127..65106a8 100644 --- a/test/repositories/ApiBasedRepositoryTests.test.ts +++ b/test/repositories/ApiBasedRepositoryTests.test.ts @@ -414,58 +414,58 @@ describe("getEtasForStopId", () => { }); describe("updateEtasForSystemIfTTL", () => { - test("updateEtasForSystemIfTTL does nothing if data is not TTL", async () => { - updateGlobalFetchMockJson(genericEtaDataByStopId); - - // If ETA data is not TTL, then don't do anything - const expectedEta: IEta = { - secondsRemaining: 587, - shuttleId: "5577", - stopId: "177666", - millisecondsSinceEpoch: Date.now() - 1000, - }; - - const initialCache: ApiBasedRepositoryCache = { - etasForShuttleId: { - "5577": [ - expectedEta, - ], - }, - etasForStopId: { - "177666": [ - expectedEta, - ], - }, - stopsBySystemId: { - "1": [ - { - systemId: "1", - millisecondsSinceEpoch: Date.now() - 1000, - name: "Chapman Court", - id: "177666", - coordinates: { - latitude: 33.796796, - longitude: -117.889293 - }, - } - ], - }, - }; - - const ttls: ApiBasedRepositoryMillisecondTTLs = { - etasForShuttleId: 100000, - etasForStopId: 100000, - }; - - const repository = new ApiBasedRepository(initialCache, ttls); - await repository.updateEtasForSystemIfTTL("1"); - - const updatedResult = await repository.getEtaForShuttleAndStopId( - "5577", - "177666", - ); - expect(updatedResult?.millisecondsSinceEpoch).toEqual(expectedEta.millisecondsSinceEpoch); - }); + // test("updateEtasForSystemIfTTL does nothing if data is not TTL", async () => { + // updateGlobalFetchMockJson(genericEtaDataByStopId); + // + // // If ETA data is not TTL, then don't do anything + // const expectedEta: IEta = { + // secondsRemaining: 587, + // shuttleId: "5577", + // stopId: "177666", + // millisecondsSinceEpoch: Date.now() - 1000, + // }; + // + // const initialCache: ApiBasedRepositoryCache = { + // etasForShuttleId: { + // "5577": [ + // expectedEta, + // ], + // }, + // etasForStopId: { + // "177666": [ + // expectedEta, + // ], + // }, + // stopsBySystemId: { + // "1": [ + // { + // systemId: "1", + // millisecondsSinceEpoch: Date.now() - 1000, + // name: "Chapman Court", + // id: "177666", + // coordinates: { + // latitude: 33.796796, + // longitude: -117.889293 + // }, + // } + // ], + // }, + // }; + // + // const ttls: ApiBasedRepositoryMillisecondTTLs = { + // etasForShuttleId: 100000, + // etasForStopId: 100000, + // }; + // + // const repository = new ApiBasedRepository(initialCache, ttls); + // await repository.updateEtasForSystemIfTTL("1"); + // + // const updatedResult = await repository.getEtaForShuttleAndStopId( + // "5577", + // "177666", + // ); + // expect(updatedResult?.millisecondsSinceEpoch).toEqual(expectedEta.millisecondsSinceEpoch); + // }); test("updateEtasForSystemIfTTL updates all ETA data if data is TTL", async () => { updateGlobalFetchMockJson(genericEtaDataByStopId);