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

Issue #962, Test Case CG6 #1412

Merged
merged 7 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ services:
"${install_args:-}"
]
# Use this if you are using a docker-compose that is earlier than version 2 and comment out the one above.
# command: ["bash", "./src/scripts/installOED.sh"]
# command: ["bash", "./src/scripts/installOED.sh"]
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"start": "node ./src/bin/www",
"start:dev": "nodemon --legacy-watch --inspect=0.0.0.0 ./src/bin/www",
"checkWebsiteStatus": "node src/server/services/checkWebsiteStatus.js",
"webpack:dev": "webpack watch --color --progress --mode development",
"webpack:build": "webpack build --node-env production",
"webpack": "webpack build --color --progress --mode development",
Expand Down Expand Up @@ -43,7 +44,8 @@
"generateCosineSquaredTestingData": "node -e 'require(\"./src/server/data/automatedTestingData\").generateCosineSquaredTestingData(2.5)'",
"generateTestingData": "node -e 'require(\"./src/server/data/automatedTestingData\").generateTestingData()'",
"testData": "node -e 'require(\"./src/server/data/automatedTestingData.js\").insertSpecialUnitsConversionsMetersGroups()'",
"webData": "node -e 'require(\"./src/server/data/websiteData.js\").insertWebsiteData()'"
"webData": "node -e 'require(\"./src/server/data/websiteData.js\").insertWebsiteData()'",
"addLogMsg": "node -e 'require(\"./src/server/services/addLogMsg.js\").addLogMsgToDB()'"
},
"nodemonConfig": {
"watch": [
Expand Down Expand Up @@ -135,4 +137,4 @@
"webpack": "~5.76.0",
"webpack-cli": "~5.1.4"
}
}
}
18 changes: 17 additions & 1 deletion src/server/test/web/readingsCompareGroupQuantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,23 @@ mocha.describe('readings API', () => {

// Add CG5 here

// Add CG6 here
mocha.it('CG6: 28 day shift end 2022-10-31 17:12:34 (partial hour) for 15 minute reading intervals and quantity units & kWh as kWh', async () => { //test description
await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWhGroups, groupDatakWh); // prepare test environment
// Get the unit ID since the DB could use any value.
const unitId = await getUnitId('kWh');
const expected = [189951.689612281, 190855.90449004]; // expected results
// 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-09 00:00:00',
curr_end: '2022-10-31 17:12:34',
shift: 'P28D', // 28-day shift
graphicUnitId: unitId // Unit ID for kWh
});

expectCompareToEqualExpected(res, expected, GROUP_ID); // confirm the results match with expected results
});


// Add CG8 here

Expand Down
Loading