Skip to content

Commit

Permalink
Added comments to B17 test case for clarity
Browse files Browse the repository at this point in the history
Co-authored-by: Aizen Baidya <aizen.shiratani.baidya@gmail.com>
Co-authored-by: Khang Nguyen <khang@mail.ccsf.edu>
  • Loading branch information
3 people authored Feb 24, 2025
1 parent 17cb7f2 commit 60ad8c2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/server/test/web/readingsBarMeterFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ mocha.describe('readings API', () => {

mocha.it('B17: should have daily points for 15 minute reading intervals and flow units with +-inf start/end time & kW as kW for Electric meter', async () => {
const unitData = [
{
{
// u4
name: 'kW',
identifier: '',
unitRepresent: Unit.unitRepresentType.FLOW,
Expand All @@ -178,6 +179,7 @@ mocha.describe('readings API', () => {
note: 'kilowatts'
},
{
// u5
name: 'Electric',
identifier: '',
unitRepresent: Unit.unitRepresentType.FLOW,
Expand All @@ -190,7 +192,8 @@ mocha.describe('readings API', () => {
}
];
const conversionData = [
{
{
// c4
sourceName: 'Electric',
destinationName: 'kW',
bidirectional: false,
Expand All @@ -215,14 +218,18 @@ mocha.describe('readings API', () => {
];
// Load the data into the database
await prepareTest(unitData, conversionData, meterData);
// Get the unit ID since the DB could use any value.
const unitId = await getUnitId('kW');
// Load the expected response data from the corresponding csv file
const expected = await parseExpectedCsv('src/server/test/web/readingsData/expected_bar_ri_15_mu_kW_gu_kW_st_-inf_et_inf_bd_1.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/meters/${METER_ID}`)
.query({
timeInterval: ETERNITY.toString(),
barWidthDays: 1,
graphicUnitId: unitId
});
// Check that the API reading is equal to what it is expected to equal
expectReadingToEqualExpected(res, expected);
});
// Add B18 here
Expand All @@ -237,4 +244,4 @@ mocha.describe('readings API', () => {
});
});
});
});
});

0 comments on commit 60ad8c2

Please sign in to comment.