Skip to content

Commit

Permalink
Finished test B15
Browse files Browse the repository at this point in the history
  • Loading branch information
alfarj83 committed Feb 16, 2024
1 parent d9753ca commit d3fa940
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 5 deletions.
58 changes: 53 additions & 5 deletions src/server/test/web/readingsBarMeterFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,60 @@ mocha.describe('readings API', () => {
mocha.describe('for bar charts', () => {
mocha.describe('for flow meters', () => {

// Add B15 here
/*
mocha.it('B15: should have daily points for 15 minute reading intervals and flow units with +-inf start/end time & kW as kW', async () => {
const unitData = [
{
// u4
name: 'kW',
identifier: '',
unitRepresent: Unit.unitRepresentType.FLOW,
secInRate: 3600,
typeOfUnit: Unit.unitType.UNIT,
suffix: '',
displayable: Unit.displayableType.ALL,
preferredDisplay: true,
note: 'kilowatts'
},
{
// u5
name: 'Electric',
identifier: '',
unitRepresent: Unit.unitRepresentType.FLOW,
secInRate: 3600,
typeOfUnit: Unit.unitType.METER,
suffix: '',
displayable: Unit.displayableType.NONE,
preferredDisplay: false,
note: 'special unit'
}
];
const conversionData = [
{
// c4
sourceName: 'Electric',
destinationName: 'kW',
bidirectional: false,
slope: 1,
intercept: 0,
note: 'Electric → kW'
}
];
const meterData = [
{
name: 'Electric kW',
unit: 'Electric',
defaultGraphicUnit: 'kW',
displayable: true,
gps: undefined,
note: 'special meter',
file: 'test/web/readingsData/readings_ri_15_days_75.csv',
deleteFile: false,
readingFrequency: '15 minutes',
id: METER_ID
}
];
// Load the data into the database
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWh);
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
Expand All @@ -44,8 +93,7 @@ mocha.describe('readings API', () => {
// Check that the API reading is equal to what it is expected to equal
expectReadingToEqualExpected(res, expected);
});
*/


// Add B16 here

});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
reading,start time,end time
15301.1498675756,2022-08-28 00:00:00,2022-09-10 00:00:00
15751.2507459568,2022-09-10 00:00:00,2022-09-23 00:00:00
15351.7660820708,2022-09-23 00:00:00,2022-10-06 00:00:00
15396.6227909537,2022-10-06 00:00:00,2022-10-19 00:00:00
15560.3449027915,2022-10-19 00:00:00,2022-11-01 00:00:00

0 comments on commit d3fa940

Please sign in to comment.