Skip to content
Snippets Groups Projects
Commit 177129fd authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore: remove act warning

parent fd38dc71
No related branches found
No related tags found
1 merge request!12413.1 Release
......@@ -74,6 +74,7 @@ describe('ConsumptionView component', () => {
<ConsumptionView fluidType={FluidType.ELECTRICITY} />
</Provider>
)
await waitFor(() => null, { container })
expect(container.getElementsByTagName('mock-cozybar')[0]).toBeTruthy()
expect(container.getElementsByTagName('mock-header')[0]).toBeTruthy()
expect(container.getElementsByTagName('mock-dateNavigator')[0]).toBeTruthy()
......@@ -84,7 +85,7 @@ describe('ConsumptionView component', () => {
).toBeTruthy()
})
it('should set CurrentTimeStep to WEEK when fluid != ELECTRICITY and timeStep = HALF_AN_HOUR', () => {
it('should set CurrentTimeStep to WEEK when fluid != ELECTRICITY and timeStep = HALF_AN_HOUR', async () => {
const store = createMockEcolyoStore({
chart: {
...mockChartState,
......@@ -97,16 +98,17 @@ describe('ConsumptionView component', () => {
},
modal: mockModalState,
})
render(
const { container } = render(
<Provider store={store}>
<ConsumptionView fluidType={FluidType.GAS} />
</Provider>
)
await waitFor(() => null, { container })
expect(setCurrentTimeStepSpy).toHaveBeenCalledTimes(1)
expect(setCurrentTimeStepSpy).toHaveBeenCalledWith(TimeStep.WEEK)
})
it('should render konnector list when no fluid is connected', () => {
it('should render konnector list when no fluid is connected', async () => {
const store = createMockEcolyoStore({
chart: mockChartStateShowOffline,
global: {
......@@ -121,6 +123,7 @@ describe('ConsumptionView component', () => {
<ConsumptionView fluidType={FluidType.MULTIFLUID} />
</Provider>
)
await waitFor(() => null, { container })
expect(
container.getElementsByTagName('mock-consumptionDetails')[0]
).toBeTruthy()
......@@ -233,7 +236,7 @@ describe('ConsumptionView component', () => {
).toBeInTheDocument()
})
})
it('should show expired modal when a GRDF consent is expired', () => {
it('should show expired modal when a GRDF consent is expired', async () => {
const updatedStatus = mockInitialEcolyoState.global.fluidStatus
updatedStatus[0] = mockExpiredGas
const store = createMockEcolyoStore({
......@@ -245,14 +248,15 @@ describe('ConsumptionView component', () => {
},
modal: mockModalState,
})
render(
const { container } = render(
<Provider store={store}>
<ConsumptionView fluidType={FluidType.GAS} />
</Provider>
)
await waitFor(() => null, { container })
expect(screen.getByText('consent_outdated.title.2')).toBeInTheDocument()
})
it('should show expired modal when a Enedis consent is expired', () => {
it('should show expired modal when a Enedis consent is expired', async () => {
const updatedStatus = mockInitialEcolyoState.global.fluidStatus
updatedStatus[0] = mockExpiredElec
const store = createMockEcolyoStore({
......@@ -264,11 +268,12 @@ describe('ConsumptionView component', () => {
},
modal: mockModalState,
})
render(
const { container } = render(
<Provider store={store}>
<ConsumptionView fluidType={FluidType.ELECTRICITY} />
</Provider>
)
await waitFor(() => null, { container })
expect(screen.getByText('consent_outdated.title.0')).toBeInTheDocument()
})
it('should render customPopup Modal', async () => {
......@@ -285,11 +290,12 @@ describe('ConsumptionView component', () => {
},
})
mockUpdateProfile.mockResolvedValue(mockTestProfile1)
render(
const { container } = render(
<Provider store={store}>
<ConsumptionView fluidType={FluidType.ELECTRICITY} />
</Provider>
)
await waitFor(() => null, { container })
expect(screen.getByRole('dialog')).toBeInTheDocument()
})
it('should render releaseNotesModal if releaseNotes.show is true', async () => {
......@@ -306,11 +312,12 @@ describe('ConsumptionView component', () => {
modal: mockModalState,
})
mockUpdateProfile.mockResolvedValue(mockTestProfile1)
render(
const { container } = render(
<Provider store={store}>
<ConsumptionView fluidType={FluidType.ELECTRICITY} />
</Provider>
)
await waitFor(() => null, { container })
expect(screen.getByRole('dialog')).toBeInTheDocument()
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment