Skip to content

Commit

Permalink
started meter field comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendenHaskins committed Nov 27, 2024
1 parent 1202b56 commit e16bd15
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions src/server/test/web/obviusTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,42 @@ mocha.describe('Obvius API', () => {
//the third line of the response should be the config file
expect(res.text.split("\n")[2]).equals(response);


//mb-001.ini should make 28 meters (obvius uses submeters to describe traits of a meter)
expect(allMeters.length).to.equal(28);

//config file uploads should create accurate meters
const allMeters = await Meter.getAll(conn);
//combine each field into different arrays for one assertion
//these arrays should vary for different submeters
const meterNames = [];
const meterIDs = [];
//these arrays should not vary for different submeters
const meterTypes = [];
const meterIsDisplayable = [];
const meterIsEnabled = [];

let count = 0;
allMeters.forEach((meter) => {
expect(meter.type).to.equal('obvius');
meterNames[count] = meter.name;
meterIDs[count] = meter.id;
meterTypes[count] = meter.type;
meterIsDisplayable[count] = meter.displayable;
meterIsEnabled[count] = meter.enabled;
count++;
})

//mb-001.ini should make 28 meters (obvius uses submeters to describe traits of a meter)
expect(allMeters.length).to.equal(28);
const allMetersAreNotDisplayable =
/**You can keep the current PR and update if you want.
I think it is important that the meter has:
displayable as false
enabled as false
name to be correct (varies for each one)
identifier to be correct (varies for each one)
I think I have this correct but did not double check the details.
The name & identifier are constructed by OED per our conversation yesterday.
You will probably need to create a list in the test code to compare against.
I hope this helps. */
});
});
});
});
});

0 comments on commit e16bd15

Please sign in to comment.