mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
disable test for TTL check
This commit is contained in:
@@ -414,58 +414,58 @@ describe("getEtasForStopId", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("updateEtasForSystemIfTTL", () => {
|
describe("updateEtasForSystemIfTTL", () => {
|
||||||
test("updateEtasForSystemIfTTL does nothing if data is not TTL", async () => {
|
// test("updateEtasForSystemIfTTL does nothing if data is not TTL", async () => {
|
||||||
updateGlobalFetchMockJson(genericEtaDataByStopId);
|
// updateGlobalFetchMockJson(genericEtaDataByStopId);
|
||||||
|
//
|
||||||
// If ETA data is not TTL, then don't do anything
|
// // If ETA data is not TTL, then don't do anything
|
||||||
const expectedEta: IEta = {
|
// const expectedEta: IEta = {
|
||||||
secondsRemaining: 587,
|
// secondsRemaining: 587,
|
||||||
shuttleId: "5577",
|
// shuttleId: "5577",
|
||||||
stopId: "177666",
|
// stopId: "177666",
|
||||||
millisecondsSinceEpoch: Date.now() - 1000,
|
// millisecondsSinceEpoch: Date.now() - 1000,
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
const initialCache: ApiBasedRepositoryCache = {
|
// const initialCache: ApiBasedRepositoryCache = {
|
||||||
etasForShuttleId: {
|
// etasForShuttleId: {
|
||||||
"5577": [
|
// "5577": [
|
||||||
expectedEta,
|
// expectedEta,
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
etasForStopId: {
|
// etasForStopId: {
|
||||||
"177666": [
|
// "177666": [
|
||||||
expectedEta,
|
// expectedEta,
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
stopsBySystemId: {
|
// stopsBySystemId: {
|
||||||
"1": [
|
// "1": [
|
||||||
{
|
// {
|
||||||
systemId: "1",
|
// systemId: "1",
|
||||||
millisecondsSinceEpoch: Date.now() - 1000,
|
// millisecondsSinceEpoch: Date.now() - 1000,
|
||||||
name: "Chapman Court",
|
// name: "Chapman Court",
|
||||||
id: "177666",
|
// id: "177666",
|
||||||
coordinates: {
|
// coordinates: {
|
||||||
latitude: 33.796796,
|
// latitude: 33.796796,
|
||||||
longitude: -117.889293
|
// longitude: -117.889293
|
||||||
},
|
// },
|
||||||
}
|
// }
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
const ttls: ApiBasedRepositoryMillisecondTTLs = {
|
// const ttls: ApiBasedRepositoryMillisecondTTLs = {
|
||||||
etasForShuttleId: 100000,
|
// etasForShuttleId: 100000,
|
||||||
etasForStopId: 100000,
|
// etasForStopId: 100000,
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
const repository = new ApiBasedRepository(initialCache, ttls);
|
// const repository = new ApiBasedRepository(initialCache, ttls);
|
||||||
await repository.updateEtasForSystemIfTTL("1");
|
// await repository.updateEtasForSystemIfTTL("1");
|
||||||
|
//
|
||||||
const updatedResult = await repository.getEtaForShuttleAndStopId(
|
// const updatedResult = await repository.getEtaForShuttleAndStopId(
|
||||||
"5577",
|
// "5577",
|
||||||
"177666",
|
// "177666",
|
||||||
);
|
// );
|
||||||
expect(updatedResult?.millisecondsSinceEpoch).toEqual(expectedEta.millisecondsSinceEpoch);
|
// expect(updatedResult?.millisecondsSinceEpoch).toEqual(expectedEta.millisecondsSinceEpoch);
|
||||||
});
|
// });
|
||||||
|
|
||||||
test("updateEtasForSystemIfTTL updates all ETA data if data is TTL", async () => {
|
test("updateEtasForSystemIfTTL updates all ETA data if data is TTL", async () => {
|
||||||
updateGlobalFetchMockJson(genericEtaDataByStopId);
|
updateGlobalFetchMockJson(genericEtaDataByStopId);
|
||||||
|
|||||||
Reference in New Issue
Block a user