From 53c2d8f78aeb7ffc408af3238eafeae9a92438ce Mon Sep 17 00:00:00 2001 From: Pierre Ecarlat <pecarlat@grandlyon.com> Date: Wed, 4 Dec 2024 15:14:09 +0000 Subject: [PATCH] fix: Updated snapshots --- .../MaxConsumptionCard.spec.tsx.snap | 2 +- ...ataloadConsumptionVisualizer.spec.tsx.snap | 2 +- .../DataloadSectionDetail.spec.tsx.snap | 2 +- .../TotalConsumption.spec.tsx | 2 +- .../TotalConsumption.spec.tsx.snap | 2 +- src/services/consumption.service.spec.ts | 50 +++++++++---------- .../performanceIndicator.service.spec.ts | 24 ++++----- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap b/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap index 4839bb349..ec5022b01 100644 --- a/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap +++ b/src/components/Analysis/MaxConsumptionCard/__snapshots__/MaxConsumptionCard.spec.tsx.snap @@ -102,7 +102,7 @@ exports[`MaxConsumptionCard component should be rendered correctly 1`] = ` <div class="dataloadvisualizer-euro text-16-normal electricity" > - 12,04 € + 17,41 € </div> </div> </div> diff --git a/src/components/ConsumptionVisualizer/__snapshots__/DataloadConsumptionVisualizer.spec.tsx.snap b/src/components/ConsumptionVisualizer/__snapshots__/DataloadConsumptionVisualizer.spec.tsx.snap index d6b5dfbc1..2f716a5db 100644 --- a/src/components/ConsumptionVisualizer/__snapshots__/DataloadConsumptionVisualizer.spec.tsx.snap +++ b/src/components/ConsumptionVisualizer/__snapshots__/DataloadConsumptionVisualizer.spec.tsx.snap @@ -24,7 +24,7 @@ exports[`Dataload consumption visualizer component should render with single flu <div class="dataloadvisualizer-euro text-16-normal electricity" > - 2,09 € + 3,02 € </div> </div> </div> diff --git a/src/components/ConsumptionVisualizer/__snapshots__/DataloadSectionDetail.spec.tsx.snap b/src/components/ConsumptionVisualizer/__snapshots__/DataloadSectionDetail.spec.tsx.snap index 485dca8a0..9605815ea 100644 --- a/src/components/ConsumptionVisualizer/__snapshots__/DataloadSectionDetail.spec.tsx.snap +++ b/src/components/ConsumptionVisualizer/__snapshots__/DataloadSectionDetail.spec.tsx.snap @@ -53,7 +53,7 @@ exports[`DataloadSectionDetail component should render correctly 1`] = ` <div class="dataloadvisualizer-euro text-16-normal electricity" > - 2,09 € + 3,02 € </div> </div> `; diff --git a/src/components/TotalConsumption/TotalConsumption.spec.tsx b/src/components/TotalConsumption/TotalConsumption.spec.tsx index de4e50f33..9e5904f57 100644 --- a/src/components/TotalConsumption/TotalConsumption.spec.tsx +++ b/src/components/TotalConsumption/TotalConsumption.spec.tsx @@ -22,7 +22,7 @@ describe('TotalConsumption component', () => { ) await waitFor(() => null, { container }) expect(container).toMatchSnapshot() - expect(screen.getByText('22,77')).toBeInTheDocument() + expect(screen.getByText('32,92')).toBeInTheDocument() }) it('should format multifluid value', async () => { diff --git a/src/components/TotalConsumption/__snapshots__/TotalConsumption.spec.tsx.snap b/src/components/TotalConsumption/__snapshots__/TotalConsumption.spec.tsx.snap index 307e79239..5c794cddd 100644 --- a/src/components/TotalConsumption/__snapshots__/TotalConsumption.spec.tsx.snap +++ b/src/components/TotalConsumption/__snapshots__/TotalConsumption.spec.tsx.snap @@ -19,7 +19,7 @@ exports[`TotalConsumption component should be rendered correctly and render euro <span class="euro-value" > - 22,77 + 32,92 </span> <span class="euro-symbol" diff --git a/src/services/consumption.service.spec.ts b/src/services/consumption.service.spec.ts index 49815f316..a9dd16f3b 100644 --- a/src/services/consumption.service.spec.ts +++ b/src/services/consumption.service.spec.ts @@ -158,22 +158,22 @@ describe('Consumption service', () => { actualData: [ { date: DateTime.fromISO('2020-08-01T00:00:00.000Z'), - value: 84.44375099999999, + value: 118.07354999999998, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 50.79059999999999, state: DataloadState.VALID }, - { value: 0.931161, state: DataloadState.VALID }, - { value: 32.72199, state: DataloadState.VALID }, + { value: 73.44203999999999, state: DataloadState.VALID }, + { value: 1.0187309999999998, state: DataloadState.VALID }, + { value: 43.612778999999996, state: DataloadState.VALID }, ], }, { date: DateTime.fromISO('2020-08-02T00:00:00.000Z'), - value: 75.2587935, + value: 105.23067499999999, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 45.266099999999994, state: DataloadState.VALID }, - { value: 0.8298785, state: DataloadState.VALID }, - { value: 29.162815, state: DataloadState.VALID }, + { value: 65.45374, state: DataloadState.VALID }, + { value: 0.9079234999999999, state: DataloadState.VALID }, + { value: 38.86901149999999, state: DataloadState.VALID }, ], }, { @@ -186,22 +186,22 @@ describe('Consumption service', () => { comparisonData: [ { date: DateTime.fromISO('2020-07-01T00:00:00.000Z'), - value: 66.0246567, + value: 92.31903499999999, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 39.712019999999995, state: DataloadState.VALID }, - { value: 0.7280537, state: DataloadState.VALID }, - { value: 25.584583, state: DataloadState.VALID }, + { value: 57.422667999999994, state: DataloadState.VALID }, + { value: 0.7965227, state: DataloadState.VALID }, + { value: 34.099844299999994, state: DataloadState.VALID }, ], }, { date: DateTime.fromISO('2020-07-02T00:00:00.000Z'), - value: 69.05641589999999, + value: 96.558195, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 41.53554, state: DataloadState.VALID }, - { value: 0.7614849, state: DataloadState.VALID }, - { value: 26.759391, state: DataloadState.VALID }, + { value: 60.059436, state: DataloadState.VALID }, + { value: 0.8330979000000001, state: DataloadState.VALID }, + { value: 35.6656611, state: DataloadState.VALID }, ], }, { @@ -227,22 +227,22 @@ describe('Consumption service', () => { actualData: [ { date: DateTime.fromISO('2020-08-01T00:00:00.000Z'), - value: 84.44375099999999, + value: 118.07354999999998, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 50.79059999999999, state: DataloadState.VALID }, - { value: 0.931161, state: DataloadState.VALID }, - { value: 32.72199, state: DataloadState.VALID }, + { value: 73.44203999999999, state: DataloadState.VALID }, + { value: 1.0187309999999998, state: DataloadState.VALID }, + { value: 43.612778999999996, state: DataloadState.VALID }, ], }, { date: DateTime.fromISO('2020-08-02T00:00:00.000Z'), - value: 75.2587935, + value: 105.23067499999999, state: DataloadState.AGGREGATED_VALID, valueDetail: [ - { value: 45.266099999999994, state: DataloadState.VALID }, - { value: 0.8298785, state: DataloadState.VALID }, - { value: 29.162815, state: DataloadState.VALID }, + { value: 65.45374, state: DataloadState.VALID }, + { value: 0.9079234999999999, state: DataloadState.VALID }, + { value: 38.86901149999999, state: DataloadState.VALID }, ], }, { @@ -305,7 +305,7 @@ describe('Consumption service', () => { mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual) mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison) } - const expectedResult = 84.44375099999999 + const expectedResult = 118.07354999999998 const result = await consumptionDataManager.getMaxLoad({ maxTimePeriod: mockTimePeriod, timeStep: TimeStep.DAY, diff --git a/src/services/performanceIndicator.service.spec.ts b/src/services/performanceIndicator.service.spec.ts index e73c56e12..ae4b9b6a3 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.7911, - compareValue: 7.84615, - percentageVariation: -0.26191826564620857, + value: 7.88495, + compareValue: 11.03678, + percentageVariation: -0.28557514057542144, } let result = performanceIndicatorService.aggregatePerformanceIndicators( @@ -48,9 +48,9 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 1.8675999999999997, - compareValue: 5.26785, - percentageVariation: -0.6454720616570329, + value: 2.6556, + compareValue: 7.60035, + percentageVariation: -0.6505950383863901, } result = performanceIndicatorService.aggregatePerformanceIndicators( @@ -77,9 +77,9 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - compareValue: 7.84615, - percentageVariation: -0.48368308023680406, - value: 4.0511, + compareValue: 11.03678, + percentageVariation: -0.5135401811035466, + value: 5.368949999999999, } result = performanceIndicatorService.aggregatePerformanceIndicators( @@ -106,7 +106,7 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 9.2711, + value: 12.91695, compareValue: 0, percentageVariation: Infinity, } @@ -125,7 +125,7 @@ describe('performanceIndicator service', () => { }, ] expectedResult = { - value: 5.22, + value: 7.548, compareValue: 0, percentageVariation: Infinity, } @@ -145,7 +145,7 @@ describe('performanceIndicator service', () => { ] expectedResult = { value: 0, - compareValue: 2.61, + compareValue: 3.774, percentageVariation: -1, } result = -- GitLab