From dd93f6e39f0e5defc8face81e1981a19cf6b6dcc Mon Sep 17 00:00:00 2001 From: Unknown31414652 <67784900+Unknown31414652@users.noreply.github.com> Date: Fri, 6 Dec 2024 03:48:45 +0000 Subject: [PATCH] Added test case CG3 --- .../test/web/readingsCompareGroupQuantity.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/server/test/web/readingsCompareGroupQuantity.js b/src/server/test/web/readingsCompareGroupQuantity.js index 41b9277de..39ab5ab2a 100644 --- a/src/server/test/web/readingsCompareGroupQuantity.js +++ b/src/server/test/web/readingsCompareGroupQuantity.js @@ -53,7 +53,21 @@ mocha.describe('readings API', () => { }); // Add CG3 here - + mocha.it('CG3: 28 day shift end 2022-10-31 17:00:00 for 15 minute reading intervals and quantity units & kWh as kWh ', async () => { + await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWhGroups, groupDatakWh); + // Get the unit ID since the DB could use any value. + const unitId = await getUnitId('kWh'); + const expected = [189951.689612281, 190855.90449004]; + // 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:00:00', + shift: 'P28D', + graphicUnitId: unitId + }); + expectCompareToEqualExpected(res, expected, GROUP_ID); + }); // Add CG4 here // Add CG5 here