Skip to content

Commit

Permalink
Merge pull request #1414 from EthanV431/development
Browse files Browse the repository at this point in the history
Implemented test case C4
  • Loading branch information
huss authored Jan 2, 2025
2 parents 5bafc0c + ec21a54 commit 17d8af6
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/server/test/web/readingsCompareMeterQuantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,21 @@ mocha.describe('readings API', () => {
expectCompareToEqualExpected(res, expected);
});

// Add C4 here
mocha.it('C4: 1 day shift end 2022-11-01 00:00:00 (full day) for 15 minute reading intervals and quantity units & kWh as kWh', async () => {
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWh);
// Get the unit ID since the DB could use any value.
const unitId = await getUnitId('kWh');
const expected = [4290.60000224332, 4842.21261747704];
// for compare, need the unitID, currentStart, currentEnd, shift
const res = await chai.request(app).get(`/api/compareReadings/meters/${METER_ID}`)
.query({
curr_start: '2022-10-31 00:00:00',
curr_end: '2022-11-01 00:00:00',
shift: 'P1D',
graphicUnitId: unitId
});
expectCompareToEqualExpected(res, expected);
});

mocha.it('C5: 7 day shift end 2022-11-01 15:00:00 (beyond data) for 15 minute reading intervals and quantity units & kWh as kWh', async () => {
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWh);
Expand Down

0 comments on commit 17d8af6

Please sign in to comment.