From e024a3cf64d76dfd0dc988e71c5035bcae05e091 Mon Sep 17 00:00:00 2001 From: Bastien Dumont <bdumont@grandlyon.com> Date: Tue, 5 Sep 2023 16:21:42 +0200 Subject: [PATCH] chore: fix type errors --- .../ProfileComparator/ProfileComparator.spec.tsx | 8 -------- src/components/CommonKit/Card/StyledCard.spec.tsx | 12 +++++++++--- .../Card/__snapshots__/StyledCard.spec.tsx.snap | 12 +++++++++--- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/components/Analysis/ProfileComparator/ProfileComparator.spec.tsx b/src/components/Analysis/ProfileComparator/ProfileComparator.spec.tsx index 6f8997cf4..e3d8ffd7a 100644 --- a/src/components/Analysis/ProfileComparator/ProfileComparator.spec.tsx +++ b/src/components/Analysis/ProfileComparator/ProfileComparator.spec.tsx @@ -46,7 +46,6 @@ const store = createMockEcolyoStore({ analysis: mockAnalysisState, }) -const allFluids = [FluidType.ELECTRICITY, FluidType.GAS, FluidType.MULTIFLUID] const performanceIndicator = { compareValue: 160.42797399999998, percentageVariation: 0.026592126632478563, @@ -77,7 +76,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={performanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -97,7 +95,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={mockAggregatedPerformanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -116,7 +113,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={mockAggregatedPerformanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -131,7 +127,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={performanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -161,7 +156,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={performanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -188,7 +182,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={performanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) @@ -207,7 +200,6 @@ describe('AnalysisConsumption component', () => { <ProfileComparator aggregatedPerformanceIndicator={performanceIndicator} performanceIndicators={performanceIndicators} - fluidsWithData={allFluids} /> </Provider> ) diff --git a/src/components/CommonKit/Card/StyledCard.spec.tsx b/src/components/CommonKit/Card/StyledCard.spec.tsx index 26d2bc83d..0ef9813d2 100644 --- a/src/components/CommonKit/Card/StyledCard.spec.tsx +++ b/src/components/CommonKit/Card/StyledCard.spec.tsx @@ -5,17 +5,23 @@ import StyledCard from './StyledCard' describe('StyledCard component test', () => { it('should render correctly Electricity StyledCard', () => { - const wrapper = mount(<StyledCard fluidType={FluidType.ELECTRICITY} />) + const wrapper = mount( + <StyledCard fluidType={FluidType.ELECTRICITY}>children</StyledCard> + ) expect(wrapper.getElement()).toMatchSnapshot() }) it('should render correctly Water StyledCard', () => { - const wrapper = mount(<StyledCard fluidType={FluidType.WATER} />) + const wrapper = mount( + <StyledCard fluidType={FluidType.WATER}>children</StyledCard> + ) expect(wrapper.getElement()).toMatchSnapshot() }) it('should render correctly Gas StyledCard', () => { - const wrapper = mount(<StyledCard fluidType={FluidType.GAS} />) + const wrapper = mount( + <StyledCard fluidType={FluidType.GAS}>children</StyledCard> + ) expect(wrapper.getElement()).toMatchSnapshot() }) }) diff --git a/src/components/CommonKit/Card/__snapshots__/StyledCard.spec.tsx.snap b/src/components/CommonKit/Card/__snapshots__/StyledCard.spec.tsx.snap index 52bb45d8b..520b00750 100644 --- a/src/components/CommonKit/Card/__snapshots__/StyledCard.spec.tsx.snap +++ b/src/components/CommonKit/Card/__snapshots__/StyledCard.spec.tsx.snap @@ -3,17 +3,23 @@ exports[`StyledCard component test should render correctly Electricity StyledCard 1`] = ` <StyledCard fluidType={0} -/> +> + children +</StyledCard> `; exports[`StyledCard component test should render correctly Gas StyledCard 1`] = ` <StyledCard fluidType={2} -/> +> + children +</StyledCard> `; exports[`StyledCard component test should render correctly Water StyledCard 1`] = ` <StyledCard fluidType={1} -/> +> + children +</StyledCard> `; -- GitLab