add additional test for HTTP status code

This commit is contained in:
2025-01-22 14:03:43 -08:00
parent 1b9a77209f
commit bbe2c4c7aa

View File

@@ -63,6 +63,14 @@ describe("ApiBasedRepositoryLoader", () => {
await loader.fetchAndUpdateSystemData();
}).rejects.toThrow(ApiResponseError);
});
it("throws the correct error if HTTP status code is not 200", async () => {
updateGlobalFetchMockJson(fetchSystemDataFailedResponse, 400);
await expect(async () => {
await loader.fetchAndUpdateSystemData();
}).rejects.toThrow(ApiResponseError);
});
});
describe("fetchAndUpdateRouteDataForExistingSystems", () => {