Skip to content

Commit

Permalink
Merge pull request #1338 from oss-slu/test_BG5
Browse files Browse the repository at this point in the history
test BG5
  • Loading branch information
huss authored Sep 21, 2024
2 parents 0f05982 + 362e297 commit 46e6921
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/server/test/web/readingsBarGroupQuantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,22 @@ mocha.describe('readings API', () => {
expectReadingToEqualExpected(res, expected, GROUP_ID);
});

// Add BG5 here
mocha.it('BG5: 75 day bars for 15 + 20 minute reading intervals and quantity units with +-inf start/end time & kWh as kWh', async () =>{
//load data into database
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWhGroups, groupDatakWh);
//get unit ID since the DB could use any value.
const unitId = await getUnitId('kWh');
// Load the expected response data from the corresponding csv file
const expected = await parseExpectedCsv('src/server/test/web/readingsData/expected_bar_group_ri_15-20_mu_kWh_gu_kWh_st_-inf_et_inf_bd_75.csv');
// Create a request to the API for unbounded reading times and save the response
const res = await chai.request(app).get(`/api/unitReadings/bar/groups/${GROUP_ID}`)
.query({
timeInterval: ETERNITY.toString(),
barWidthDays: '75',
graphicUnitId: unitId });
// Check that the API reading is equal to what it is expected to equal
expectReadingToEqualExpected(res, expected, GROUP_ID);
});

mocha.it('BG6: 76 day bars (no values) for 15 + 20 minute reading intervals and quantity units with +-inf start/end time & kWh as kWh', async () =>{
//load data into database
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reading,start time,end time
627024.401870568,2022-08-18 00:00:00,2022-11-01 00:00:00

0 comments on commit 46e6921

Please sign in to comment.