Commit 7faa1c13 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: tu

parent 3f9923bd
......@@ -95,7 +95,7 @@ describe('TotalAnalysisChart component', () => {
analysisDate={DateTime.fromISO('2021-07-01T00:00:00.000Z', {
zone: 'utc',
})}
fluidTypes={[FluidType.ELECTRICITY]}
fluidTypes={[FluidType.ELECTRICITY, FluidType.WATER]}
/>
</Provider>
)
......@@ -105,4 +105,38 @@ describe('TotalAnalysisChart component', () => {
})
expect(wrapper.find('.fluidconso').text()).toBe('--- €')
})
it('should render empty price for one fluid', async () => {
const store = mockStore({
ecolyo: {
global: globalStateData,
},
})
const emptyData = {
actualData: [
{
date: DateTime.fromISO('2020-09-01T00:00:00.000Z', {
zone: 'utc',
}),
value: 69.18029999999999,
valueDetail: [-1],
},
],
}
mockgetGraphData.mockResolvedValueOnce(emptyData)
const wrapper = mount(
<Provider store={store}>
<TotalAnalysisChart
analysisDate={DateTime.fromISO('2021-07-01T00:00:00.000Z', {
zone: 'utc',
})}
fluidTypes={[FluidType.ELECTRICITY]}
/>
</Provider>
)
await act(async () => {
await new Promise(resolve => setTimeout(resolve))
wrapper.update()
})
expect(wrapper.find('.fluidconso').exists()).toBe(false)
})
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment