diff --git a/src/components/TotalConsumption/TotalConsumption.spec.tsx b/src/components/TotalConsumption/TotalConsumption.spec.tsx index c5aa1270abe5361ffa6dfd22d39301f315252431..2d0f7e44959c60cc57f70512bfcaf54a777644c8 100644 --- a/src/components/TotalConsumption/TotalConsumption.spec.tsx +++ b/src/components/TotalConsumption/TotalConsumption.spec.tsx @@ -79,7 +79,7 @@ describe('TotalConsumption component', () => { .find('.euro-value') .first() .text() - ).toEqual('20,38') + ).toEqual('22,77') }) it('should format multifluid value', async () => { const component = mount( diff --git a/src/components/TotalConsumption/TotalConsumption.tsx b/src/components/TotalConsumption/TotalConsumption.tsx index 5c40c4833e5f340da4eb67b08e40f76bf3c8a942..53fcde843a814f94bb656306306725b15bc0ec68 100644 --- a/src/components/TotalConsumption/TotalConsumption.tsx +++ b/src/components/TotalConsumption/TotalConsumption.tsx @@ -42,8 +42,6 @@ const TotalConsumption: React.FC<TotalConsumptionProps> = ({ actualData.forEach(data => { if (data.value !== -1) { total += data.value - } - if (data.price) { totalPrice += converterService.LoadToEuro( data.value, fluidType, diff --git a/src/constants/config.json b/src/constants/config.json index d72bba6bcf30260ac6dcf84c9896b97eccd9f43e..74719b52c7278646b9367eda91cc48a933aad2f4 100644 --- a/src/constants/config.json +++ b/src/constants/config.json @@ -3,7 +3,7 @@ { "fluidTypeId": 0, "name": "enedis", - "coefficient": 0.1558, + "coefficient": 0.174, "startDate": "2021-08-01T00:00:00.000", "dataDelayOffset": 3, diff --git a/src/services/consumption.service.spec.ts b/src/services/consumption.service.spec.ts index 120fd6bee740232f84d1f69563f504487cf80d45..51ac9fccd2e58c20460287472f48fae02e6d3834 100644 --- a/src/services/consumption.service.spec.ts +++ b/src/services/consumption.service.spec.ts @@ -8,7 +8,6 @@ import { ENEDIS_MINUTE_DOCTYPE } from 'doctypes' import { fluidPrices } from '../../tests/__mocks__/fluidPrice.mock' import { QueryResult } from 'cozy-client' import { loadDayData } from '../../tests/__mocks__/loadDayData.mock' -import { baseDataLoad } from '../../tests/__mocks__/datachartData.mock' const mockFetchFluidData = jest.fn() const mockFetchFluidMaxData = jest.fn() @@ -131,13 +130,13 @@ describe('Consumption service', () => { actualData: [ { date: DateTime.fromISO('2020-10-01T00:00:00.000Z'), - value: 79.131171, - valueDetail: [45.478019999999994, 0.931161, 32.72199], + value: 84.44375099999999, + valueDetail: [50.79059999999999, 0.931161, 32.72199], }, { date: DateTime.fromISO('2020-10-02T00:00:00.000Z'), - value: 70.5240635, - valueDetail: [40.531369999999995, 0.8298785, 29.162815], + value: 75.2587935, + valueDetail: [45.266099999999994, 0.8298785, 29.162815], }, { date: DateTime.fromISO('2020-10-03T00:00:00.000Z'), @@ -148,13 +147,13 @@ describe('Consumption service', () => { comparisonData: [ { date: DateTime.fromISO('2020-09-01T00:00:00.000Z'), - value: 61.8708707, - valueDetail: [35.558234, 0.7280537, 25.584583], + value: 66.0246567, + valueDetail: [39.712019999999995, 0.7280537, 25.584583], }, { date: DateTime.fromISO('2020-09-02T00:00:00.000Z'), - value: 64.7118939, - valueDetail: [37.191018, 0.7614849, 26.759391], + value: 69.05641589999999, + valueDetail: [41.53554, 0.7614849, 26.759391], }, { date: DateTime.fromISO('2020-09-03T00:00:00.000Z'), @@ -177,13 +176,13 @@ describe('Consumption service', () => { actualData: [ { date: DateTime.fromISO('2020-10-01T00:00:00.000Z'), - value: 79.131171, - valueDetail: [45.478019999999994, 0.931161, 32.72199], + value: 84.44375099999999, + valueDetail: [50.79059999999999, 0.931161, 32.72199], }, { date: DateTime.fromISO('2020-10-02T00:00:00.000Z'), - value: 70.5240635, - valueDetail: [40.531369999999995, 0.8298785, 29.162815], + value: 75.2587935, + valueDetail: [45.266099999999994, 0.8298785, 29.162815], }, { date: DateTime.fromISO('2020-10-03T00:00:00.000Z'), @@ -235,7 +234,7 @@ describe('Consumption service', () => { mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual) mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison) } - const expectedResult = 79.131171 + const expectedResult = 84.44375099999999 const result = await consumptionDataManager.getMaxLoad( mockTimePeriod, TimeStep.DAY, diff --git a/src/services/performanceIndicator.service.spec.ts b/src/services/performanceIndicator.service.spec.ts index f68b1d16f0ff3753fc23a7a85234b8d4f329a859..c3cac0a58e72ea131dbe30369473f6b8aecc2bb7 100644 --- a/src/services/performanceIndicator.service.spec.ts +++ b/src/services/performanceIndicator.service.spec.ts @@ -24,9 +24,9 @@ describe('performanceIndicator service', () => { it('should return the current timePeriod and the comparison timePeriod for all timeStep', () => { let expectedResult: PerformanceIndicator = { - value: 5.6091, - compareValue: 7.30015, - percentageVariation: 0.23164592508373127, + value: 5.7911, + compareValue: 7.84615, + percentageVariation: 0.26191826564620857, } let result = performanceIndicatorService.aggregatePerformanceIndicators( performanceIndicator @@ -47,9 +47,9 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 1.6855999999999998, - compareValue: 4.72185, - percentageVariation: 0.6430212734415537, + value: 1.8675999999999997, + compareValue: 5.26785, + percentageVariation: 0.6454720616570329, } result = performanceIndicatorService.aggregatePerformanceIndicators( performanceIndicator @@ -75,8 +75,8 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - compareValue: 7.30015, - percentageVariation: 0.44506619726991914, + compareValue: 7.84615, + percentageVariation: 0.48368308023680406, value: 4.0511, } result = performanceIndicatorService.aggregatePerformanceIndicators( @@ -103,7 +103,7 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 8.7251, + value: 9.2711, compareValue: 0, percentageVariation: -Infinity, } @@ -121,7 +121,7 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 4.6739999999999995, + value: 5.22, compareValue: 0, percentageVariation: -Infinity, } @@ -140,7 +140,7 @@ describe('performanceIndicator service', () => { ] expectedResult = { value: 0, - compareValue: 2.3369999999999997, + compareValue: 2.61, percentageVariation: 1, } result = performanceIndicatorService.aggregatePerformanceIndicators( diff --git a/tests/__mocks__/profileType.mock.ts b/tests/__mocks__/profileType.mock.ts index 9493b055be5ba6b775c56814887155f5ebe63553..52197f89c178db115de01ef5dae64f43f7f60d36 100644 --- a/tests/__mocks__/profileType.mock.ts +++ b/tests/__mocks__/profileType.mock.ts @@ -168,7 +168,7 @@ export const mockMonthlyForecastJanuaryTestProfile1: MonthlyForecast = { }, fluidType: 0, load: 4340, - value: 676.17, + value: 755.16, }, { detailsMonthlyForecast: { @@ -196,7 +196,7 @@ export const mockMonthlyForecastJanuaryTestProfile1: MonthlyForecast = { }, ], month: 1, - totalValue: 765.774, + totalValue: 844.764, } export const mockTestProfile2: ProfileType = { @@ -233,7 +233,7 @@ export const mockMonthlyForecastJanuaryTestProfile2: MonthlyForecast = { }, fluidType: 0, load: 1670, - value: 260.19, + value: 290.58, }, { detailsMonthlyForecast: { @@ -261,7 +261,7 @@ export const mockMonthlyForecastJanuaryTestProfile2: MonthlyForecast = { }, ], month: 1, - totalValue: 287.286, + totalValue: 317.676, } export const mockTestProfile3: ProfileType = { @@ -298,7 +298,7 @@ export const mockMonthlyForecastJanuaryTestProfile3: MonthlyForecast = { }, fluidType: 0, load: 194, - value: 30.225, + value: 33.756, }, { detailsMonthlyForecast: { @@ -326,7 +326,7 @@ export const mockMonthlyForecastJanuaryTestProfile3: MonthlyForecast = { }, ], month: 1, - totalValue: 57.321, + totalValue: 60.852000000000004, } export const mockProfileTypeAnswers: ProfileTypeAnswer[] = [ @@ -434,7 +434,7 @@ export const mockMonthlyForecastJanuaryTest1WithFullArrays: MonthlyForecast = { }, fluidType: 0, load: 2745, - value: 427.67, + value: 477.63, }, { detailsMonthlyForecast: { @@ -462,5 +462,5 @@ export const mockMonthlyForecastJanuaryTest1WithFullArrays: MonthlyForecast = { }, ], month: 1, - totalValue: 517.274, + totalValue: 567.234, }