Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commiting CG4 #1407

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/server/test/web/readingsCompareGroupQuantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ mocha.describe('readings API', () => {
});
expectCompareToEqualExpected(res, expected, GROUP_ID);
});

// Add CG3 here
mocha.it('CG3: 28 day shift end 2022-10-31 17:00:00 for 15 minute reading intervals and quantity units & kWh as kWh ', async () => {
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWhGroups, groupDatakWh);
// Get the unit ID since the DB could use any value.
Expand All @@ -68,7 +66,21 @@ mocha.describe('readings API', () => {
});
expectCompareToEqualExpected(res, expected, GROUP_ID);
});
// Add CG4 here
mocha.it('CG4: 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, meterDatakWhGroups, groupDatakWh);
// Get the unit ID since the DB could use any value.
const unitId = await getUnitId('kWh');
const expected = [7820.41927336775, 8351.13117114892];
// for compare, need the unitID, currentStart, currentEnd, shift
const res = await chai.request(app).get(`/api/compareReadings/groups/${GROUP_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, GROUP_ID);
});

// Add CG5 here

Expand Down
Loading