Skip to content

Commit

Permalink
custom metrics - test numbers / keys
Browse files Browse the repository at this point in the history
adding specific numbers from fakeLabels.json for the footprints, but keeping the testing at just the keys for mets due to complexity

the keys in the fallback are different, so we can be sure here that the custom mets were accessed
  • Loading branch information
Abby Wheelis committed Dec 4, 2023
1 parent 0b471e5 commit 6947351
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions www/__tests__/customMetricsHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ global.fetch = (url: string) =>
it('gets the custom mets', async () => {
const appConfig = await getConfig();
await initCustomDatasetHelper(appConfig);
//expecting the keys from fakeLabels.json NOT metrics/metDataset.ts
expect(getCustomMETs()).toMatchObject({
walk: expect.any(Object),
bike: expect.any(Object),
Expand All @@ -40,12 +41,13 @@ it('gets the custom mets', async () => {
it('gets the custom footprint', async () => {
const appConfig = await getConfig();
await initCustomDatasetHelper(appConfig);
//numbers from fakeLabels.json
expect(getCustomFootprint()).toMatchObject({
walk: expect.any(Number),
bike: expect.any(Number),
bikeshare: expect.any(Number),
'e-bike': expect.any(Number),
scootershare: expect.any(Number),
drove_alone: expect.any(Number),
walk: 0,
bike: 0,
bikeshare: 0,
'e-bike': 0.00728,
scootershare: 0.00894,
drove_alone: 0.22031,
});
});

0 comments on commit 6947351

Please sign in to comment.