mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
rename shuttle data fetch snapshot
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Snapshot taken from the Passio GO! API
|
// Snapshot taken from the Passio GO! API
|
||||||
export const genericShuttleDataBySystemId = {
|
export const fetchShuttleDataSuccessfulResponse = {
|
||||||
"alertCRC": "23c1b91c",
|
"alertCRC": "23c1b91c",
|
||||||
"buses": {
|
"buses": {
|
||||||
"402840": [
|
"402840": [
|
||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from "../../src/repositories/ApiBasedRepository";
|
} from "../../src/repositories/ApiBasedRepository";
|
||||||
import { IEta, IShuttle, IStop } from "../../src/entities/entities";
|
import { IEta, IShuttle, IStop } from "../../src/entities/entities";
|
||||||
import { genericEtaDataByStopId } from "../jsonSnapshots/genericEtaDataBySystemId";
|
import { genericEtaDataByStopId } from "../jsonSnapshots/genericEtaDataBySystemId";
|
||||||
import { genericShuttleDataBySystemId } from "../jsonSnapshots/genericShuttleDataBySystemId";
|
import { fetchShuttleDataSuccessfulResponse } from "../jsonSnapshots/fetchShuttleData/fetchShuttleDataSuccessfulResponse";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the global fetch function to return a specific object.
|
* Update the global fetch function to return a specific object.
|
||||||
@@ -290,7 +290,7 @@ describe("updateEtasForSystemIfTTL", () => {
|
|||||||
|
|
||||||
describe("getShuttleById", () => {
|
describe("getShuttleById", () => {
|
||||||
test("getShuttleById returns null if unseeded cache", async () => {
|
test("getShuttleById returns null if unseeded cache", async () => {
|
||||||
updateGlobalFetchMockJson(genericShuttleDataBySystemId);
|
updateGlobalFetchMockJson(fetchShuttleDataSuccessfulResponse);
|
||||||
|
|
||||||
const initialCache: ApiBasedRepositoryCache = {};
|
const initialCache: ApiBasedRepositoryCache = {};
|
||||||
const repository = new ApiBasedRepository(initialCache);
|
const repository = new ApiBasedRepository(initialCache);
|
||||||
@@ -300,7 +300,7 @@ describe("getShuttleById", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("getShuttleById returns data if present", async () => {
|
test("getShuttleById returns data if present", async () => {
|
||||||
updateGlobalFetchMockJson(genericShuttleDataBySystemId);
|
updateGlobalFetchMockJson(fetchShuttleDataSuccessfulResponse);
|
||||||
|
|
||||||
const initialCacheShuttle = {
|
const initialCacheShuttle = {
|
||||||
coordinates: {
|
coordinates: {
|
||||||
|
|||||||
Reference in New Issue
Block a user