Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
177129fd
Commit
177129fd
authored
11 months ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
chore: remove act warning
parent
fd38dc71
No related branches found
No related tags found
1 merge request
!1241
3.1 Release
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Consumption/ConsumptionView.spec.tsx
+16
-9
16 additions, 9 deletions
src/components/Consumption/ConsumptionView.spec.tsx
with
16 additions
and
9 deletions
src/components/Consumption/ConsumptionView.spec.tsx
+
16
−
9
View file @
177129fd
...
...
@@ -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
()
})
})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment