Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
LLLE_Project
Ecolyo
Commits
832d0d93
Commit
832d0d93
authored
May 09, 2022
by
Guilhem CARRON
Browse files
Revert "Merge branch 'feat/us675-matomo' into 'dev'"
parent
1a96e58c
Changes
35
Expand all
Hide whitespace changes
Inline
Side-by-side
app.config.environment.alpha.js
View file @
832d0d93
...
...
@@ -17,8 +17,6 @@ module.exports = {
__DEVELOPMENT__
:
false
,
__DEVTOOLS__
:
false
,
__STACK_ASSETS__
:
target
!==
'
mobile
'
,
__PIWIK_TRACKER_URL__
:
JSON
.
stringify
(
'
https://statweb.grandlyon.com/
'
),
__PIWIK_SITEID__
:
117
,
}),
],
optimization
:
{
...
...
app.config.environment.dev.js
View file @
832d0d93
...
...
@@ -20,8 +20,6 @@ const stackProvidedLibsConfig = {
'
process.env.NODE_ENV
'
:
JSON
.
stringify
(
'
development
'
),
__IS_ALPHA__
:
true
,
__STACK_ASSETS__
:
true
,
__PIWIK_TRACKER_URL__
:
JSON
.
stringify
(
'
http://localhost:9800/
'
),
__PIWIK_SITEID__
:
1
,
}),
],
module
:
{
...
...
app.config.environment.prod.js
View file @
832d0d93
...
...
@@ -17,8 +17,6 @@ module.exports = {
__DEVELOPMENT__
:
false
,
__DEVTOOLS__
:
false
,
__STACK_ASSETS__
:
target
!==
'
mobile
'
,
__PIWIK_TRACKER_URL__
:
JSON
.
stringify
(
'
https://statweb.grandlyon.com/
'
),
__PIWIK_SITEID__
:
118
,
}),
],
optimization
:
{
...
...
docker/docker-compose.matomo.yml
deleted
100644 → 0
View file @
1a96e58c
version
:
'
3.8'
services
:
db
:
image
:
mariadb
command
:
--max-allowed-packet=64MB
restart
:
always
environment
:
-
MYSQL_ROOT_PASSWORD=root
-
MYSQL_PASSWORD=password
-
MYSQL_DATABASE=matomo
-
MYSQL_USER=matomo
volumes
:
-
db:/var/lib/mysql
app
:
image
:
matomo:latest
restart
:
always
depends_on
:
-
db
environment
:
-
MATOMO_DATABASE_HOST=db
-
MATOMO_DATABASE_ADAPTER=mysql
-
MATOMO_DATABASE_TABLES_PREFIX=matomo_
-
MATOMO_DATABASE_USERNAME=matomo
-
MATOMO_DATABASE_PASSWORD=password
-
MATOMO_DATABASE_DBNAME=matomo
-
PHP_MEMORY_LIMIT=2048M
volumes
:
# - ./config:/var/www/html/config:rw
# - ./logs:/var/www/html/logs
-
matomo:/var/www/html
ports
:
-
9800:80
volumes
:
db
:
matomo
:
src/components/Action/ActionView.spec.tsx
View file @
832d0d93
...
...
@@ -21,9 +21,6 @@ jest.mock('cozy-ui/transpiled/react/I18n', () => {
}),
}
})
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
const
mockStore
=
configureStore
([])
describe
(
'
ActionView component
'
,
()
=>
{
...
...
@@ -37,7 +34,7 @@ describe('ActionView component', () => {
}
const
store
=
mockStore
({
ecolyo
:
{
challenge
:
{
currentChallenge
:
userChallenge
}
,
challenge
:
userChallenge
,
global
:
{
...
globalStateData
,
fluidTypes
:
[
0
,
1
,
2
]
},
profile
:
profileData
,
modal
:
modalStateData
,
...
...
@@ -48,7 +45,7 @@ describe('ActionView component', () => {
<
ActionView
/>
</
Provider
>
)
expect
(
wrapper
.
find
(
ActionChoose
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ActionChoose
).
exists
())
expect
(
wrapper
).
toMatchSnapshot
()
})
it
(
'
should render ActionDone component
'
,
()
=>
{
...
...
@@ -61,7 +58,7 @@ describe('ActionView component', () => {
}
const
store
=
mockStore
({
ecolyo
:
{
challenge
:
{
currentChallenge
:
userChallenge
}
,
challenge
:
userChallenge
,
global
:
{
...
globalStateData
,
fluidTypes
:
[
0
,
1
,
2
]
},
profile
:
profileData
,
modal
:
modalStateData
,
...
...
@@ -72,7 +69,7 @@ describe('ActionView component', () => {
<
ActionView
/>
</
Provider
>
)
expect
(
wrapper
.
find
(
ActionDone
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ActionDone
).
exists
())
})
it
(
'
should render ActionOnGoing component
'
,
()
=>
{
const
userChallenge
=
{
...
...
@@ -84,7 +81,7 @@ describe('ActionView component', () => {
}
const
store
=
mockStore
({
ecolyo
:
{
challenge
:
{
currentChallenge
:
userChallenge
}
,
challenge
:
userChallenge
,
global
:
{
...
globalStateData
,
fluidTypes
:
[
0
,
1
,
2
]
},
modal
:
modalStateData
,
profile
:
profileData
,
...
...
@@ -95,6 +92,6 @@ describe('ActionView component', () => {
<
ActionView
/>
</
Provider
>
)
expect
(
wrapper
.
find
(
ActionOnGoing
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ActionOnGoing
).
exists
())
})
})
src/components/Analysis/AnalysisView.spec.tsx
View file @
832d0d93
/* eslint-disable react/display-name */
import
React
from
'
react
'
import
{
mount
}
from
'
enzyme
'
import
*
as
reactRedux
from
'
react-redux
'
...
...
src/components/App.tsx
View file @
832d0d93
/* eslint-disable @typescript-eslint/no-explicit-any */
import
React
,
{
useEffect
}
from
'
react
'
import
React
from
'
react
'
import
{
HashRouter
}
from
'
react-router-dom
'
import
{
createBrowserHistory
}
from
'
history
'
import
{
Layout
,
Main
,
Content
}
from
'
cozy-ui/transpiled/react/Layout
'
import
{
useSelector
}
from
'
react-redux
'
import
{
AppStore
}
from
'
store
'
...
...
@@ -11,30 +12,14 @@ import SplashRoot from 'components/Splash/SplashRoot'
import
SplashScreen
from
'
components/Splash/SplashScreen
'
import
SplashScreenError
from
'
components/Splash/SplashScreenError
'
import
WelcomeModal
from
'
components/Onboarding/WelcomeModal
'
import
MatomoTracker
from
'
utils/matomoTracker
'
import
EnvironmentService
from
'
services/environment.service
'
interface
AppProps
{
tracker
:
MatomoTracker
}
export
const
history
=
createBrowserHistory
()
export
const
App
=
(
{
tracker
}:
AppProps
)
=>
{
export
const
App
=
()
=>
{
const
{
onboarding
,
isProfileEcogestureCompleted
}
=
useSelector
(
(
state
:
AppStore
)
=>
state
.
ecolyo
.
profile
)
const
{
termsStatus
}
=
useSelector
((
state
:
AppStore
)
=>
state
.
ecolyo
.
global
)
const
isDev
=
new
EnvironmentService
().
isDev
()
useEffect
(()
=>
{
if
(
tracker
&&
!
isDev
)
{
if
(
termsStatus
.
accepted
)
{
tracker
.
connectToHistory
()
}
return
()
=>
{
tracker
.
disconnectFromHistory
()
}
}
},
[
termsStatus
.
accepted
,
tracker
])
return
(
<
HashRouter
{
...
history
}
>
...
...
src/components/Challenge/ChallengeView.spec.tsx
View file @
832d0d93
import
React
from
'
react
'
import
{
mount
}
from
'
enzyme
'
import
toJson
from
'
enzyme-to-json
'
import
{
shallow
}
from
'
enzyme
'
import
ChallengeView
from
'
components/Challenge/ChallengeView
'
import
*
as
reactRedux
from
'
react-redux
'
import
{
challengeStateDataFull
}
from
'
../../../tests/__mocks__/challengeStateData.mock
'
import
{
createMockStore
,
mockInitialEcolyoState
,
}
from
'
../../../tests/__mocks__/store
'
const
mockUseSelector
=
jest
.
spyOn
(
reactRedux
,
'
useSelector
'
)
...
...
@@ -21,28 +16,10 @@ jest.mock('cozy-ui/transpiled/react/I18n', () => {
}
})
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
jest
.
mock
(
'
components/Challenge/ChallengeCard
'
,
()
=>
'
mock-challengecard
'
)
const
useSelectorSpy
=
jest
.
spyOn
(
reactRedux
,
'
useSelector
'
)
describe
(
'
ChallengeView component
'
,
()
=>
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let
store
:
any
beforeEach
(()
=>
{
store
=
createMockStore
(
mockInitialEcolyoState
)
useSelectorSpy
.
mockClear
()
})
it
(
'
should be rendered correctly
'
,
()
=>
{
mockUseSelector
.
mockReturnValue
(
challengeStateDataFull
)
const
wrapper
=
mount
(
<
reactRedux
.
Provider
store
=
{
store
}
>
<
ChallengeView
/>
</
reactRedux
.
Provider
>
)
expect
(
toJson
(
wrapper
)).
toMatchSnapshot
()
const
component
=
shallow
(<
ChallengeView
/>).
getElement
()
expect
(
component
).
toMatchSnapshot
()
})
})
src/components/Challenge/__snapshots__/ChallengeView.spec.tsx.snap
View file @
832d0d93
This diff is collapsed.
Click to expand it.
src/components/Content/Content.tsx
View file @
832d0d93
import
React
,
{
useCallback
,
useEffect
}
from
'
react
'
import
'
./content.scss
'
import
{
history
}
from
'
components/App
'
import
{
useSelector
,
useDispatch
}
from
'
react-redux
'
import
{
AppStore
}
from
'
store
'
import
{
changeScreenType
}
from
'
store/global/global.actions
'
import
{
updateModalIsFeedbacksOpen
}
from
'
store/modal/modal.actions
'
import
{
ScreenType
}
from
'
enum/screen.enum
'
import
FeedbackModal
from
'
components/Feedback/FeedbackModal
'
import
{
useHistory
}
from
'
react-router-dom
'
interface
ContentProps
{
children
?:
React
.
ReactNode
height
?:
number
...
...
@@ -19,7 +20,6 @@ const Content: React.FC<ContentProps> = ({
background
=
'
inherit
'
,
}:
ContentProps
)
=>
{
const
dispatch
=
useDispatch
()
const
history
=
useHistory
()
const
{
screenType
}
=
useSelector
((
state
:
AppStore
)
=>
state
.
ecolyo
.
global
)
const
{
isFeedbacksOpen
}
=
useSelector
(
(
state
:
AppStore
)
=>
state
.
ecolyo
.
modal
...
...
@@ -38,10 +38,10 @@ const Content: React.FC<ContentProps> = ({
/**
* Handle Desktop scroll
*/
const
handleWindowScroll
=
useCallback
(
()
=>
{
const
handleWindowScroll
=
()
=>
{
app
&&
app
.
scrollTo
(
0
,
0
)
window
.
scrollTo
(
0
,
0
)
}
,
[
app
])
}
// Set listners for scroll
useEffect
(()
=>
{
...
...
@@ -50,7 +50,7 @@ const Content: React.FC<ContentProps> = ({
// remove listner subscription
listner
()
}
},
[
handleWindowScroll
,
history
])
},
[])
useEffect
(()
=>
{
function
handleResize
()
{
...
...
src/components/Duel/DuelView.spec.tsx
View file @
832d0d93
...
...
@@ -10,10 +10,6 @@ import DuelUnlocked from './DuelUnlocked'
import
DuelOngoing
from
'
./DuelOngoing
'
import
{
UserDuelState
}
from
'
enum/userDuel.enum
'
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
const
mockUseSelector
=
jest
.
spyOn
(
reactRedux
,
'
useSelector
'
)
describe
(
'
DuelView component
'
,
()
=>
{
...
...
src/components/Ecogesture/EcogestureView.spec.tsx
View file @
832d0d93
/* eslint-disable react/display-name */
import
React
from
'
react
'
import
{
mount
}
from
'
enzyme
'
import
{
Provider
}
from
'
react-redux
'
...
...
src/components/Exploration/ExplorationView.spec.tsx
View file @
832d0d93
...
...
@@ -8,39 +8,19 @@ import { challengeStateData } from '../../../tests/__mocks__/challengeStateData.
import
ExplorationFinished
from
'
./ExplorationFinished
'
import
ExplorationError
from
'
./ExplorationError
'
import
ExplorationOngoing
from
'
./ExplorationOngoing
'
import
{
UserExplorationState
}
from
'
enum/userExploration.enum
'
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
const
mockUseSelector
=
jest
.
spyOn
(
reactRedux
,
'
useSelector
'
)
describe
(
'
ExplorationView
'
,
()
=>
{
it
(
'
should be rendered with ExplorationError component when unknown exploration state
'
,
()
=>
{
const
updatedUserChallenge
=
{
...
userChallengeData
[
0
],
exploration
:
{
...
userChallengeData
[
0
].
exploration
,
state
:
99
,
},
}
const
updatedChallengeState
=
{
...
challengeStateData
,
currentChallenge
:
updatedUserChallenge
,
}
mockUseSelector
.
mockReturnValue
(
updatedChallengeState
)
it
(
'
should be rendered with ExplorationView component when no exploration state
'
,
()
=>
{
mockUseSelector
.
mockReturnValue
(
challengeStateData
)
const
wrapper
=
shallow
(<
ExplorationView
/>)
expect
(
wrapper
.
find
(
ExplorationError
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ExplorationError
).
exists
())
})
it
(
'
should be rendered with ExplorationOngoing component when exploration state = unlocked
'
,
()
=>
{
it
(
'
should be rendered with ExplorationView component when exploration state = unlocked
'
,
()
=>
{
const
updatedUserChallenge
=
{
...
userChallengeData
[
0
],
exploration
:
{
...
userChallengeData
[
0
].
exploration
,
state
:
UserExplorationState
.
UNLOCKED
,
},
quiz
:
{
...
userChallengeData
[
0
].
quiz
,
state
:
UserQuizState
.
UNLOCKED
},
}
const
updatedChallengeState
=
{
...
challengeStateData
,
...
...
@@ -48,16 +28,12 @@ describe('ExplorationView', () => {
}
mockUseSelector
.
mockReturnValue
(
updatedChallengeState
)
const
wrapper
=
shallow
(<
ExplorationView
/>)
expect
(
wrapper
.
find
(
ExplorationOngoing
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ExplorationOngoing
).
exists
())
})
it
(
'
should be rendered with ExplorationOngoing component when exploration state = ongoing
'
,
()
=>
{
it
(
'
should be rendered with ExplorationView component when exploration state = ongoing
'
,
()
=>
{
const
updatedUserChallenge
=
{
...
userChallengeData
[
0
],
exploration
:
{
...
userChallengeData
[
0
].
exploration
,
state
:
UserExplorationState
.
ONGOING
,
},
quiz
:
{
...
userChallengeData
[
0
].
quiz
,
state
:
UserQuizState
.
ONGOING
},
}
const
updatedChallengeState
=
{
...
challengeStateData
,
...
...
@@ -65,16 +41,12 @@ describe('ExplorationView', () => {
}
mockUseSelector
.
mockReturnValue
(
updatedChallengeState
)
const
wrapper
=
shallow
(<
ExplorationView
/>)
expect
(
wrapper
.
find
(
ExplorationOngoing
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ExplorationOngoing
).
exists
())
})
it
(
'
should be rendered with ExplorationFinished component when exploration state = Done
'
,
()
=>
{
it
(
'
should be rendered with ExplorationView component when exploration state = Done
'
,
()
=>
{
const
updatedUserChallenge
=
{
...
userChallengeData
[
0
],
exploration
:
{
...
userChallengeData
[
0
].
exploration
,
state
:
UserExplorationState
.
DONE
,
},
quiz
:
{
...
userChallengeData
[
0
].
quiz
,
state
:
UserQuizState
.
DONE
},
}
const
updatedChallengeState
=
{
...
challengeStateData
,
...
...
@@ -82,6 +54,6 @@ describe('ExplorationView', () => {
}
mockUseSelector
.
mockReturnValue
(
updatedChallengeState
)
const
wrapper
=
shallow
(<
ExplorationView
/>)
expect
(
wrapper
.
find
(
ExplorationFinished
).
exists
())
.
toBeTruthy
()
expect
(
wrapper
.
find
(
ExplorationFinished
).
exists
())
})
})
src/components/FAQ/FAQView.spec.tsx
View file @
832d0d93
...
...
@@ -11,9 +11,6 @@ jest.mock('cozy-ui/transpiled/react/I18n', () => {
}),
}
})
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
describe
(
'
FAQView component
'
,
()
=>
{
it
(
'
should render only the parent component
'
,
()
=>
{
...
...
src/components/FAQ/__snapshots__/FAQView.spec.tsx.snap
View file @
832d0d93
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`FAQView component should render only the parent component 1`] = `
<React.Fragment>
<
mock-c
ozy
b
ar
displayBackArrow={true}
titleKey="common.title_faq"
/>
<
mock-h
eader
desktopTitleKey="common.title_faq"
displayBackArrow={true}
setHeaderHeight={[Function]}
/>
<
mock-c
ontent
height={0}
>
<FAQContent />
</
mock-c
ontent>
</React.Fragment>
`;
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`FAQView component should render only the parent component 1`] = `
<React.Fragment>
<
C
ozy
B
ar
displayBackArrow={true}
titleKey="common.title_faq"
/>
<
H
eader
desktopTitleKey="common.title_faq"
displayBackArrow={true}
setHeaderHeight={[Function]}
/>
<
C
ontent
height={0}
>
<FAQContent />
</
C
ontent>
</React.Fragment>
`;
src/components/GCU/GCUView.spec.tsx
View file @
832d0d93
...
...
@@ -2,10 +2,6 @@ import React from 'react'
import
{
shallow
}
from
'
enzyme
'
import
GCUView
from
'
components/GCU/GCUView
'
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
describe
(
'
GCUView component
'
,
()
=>
{
it
(
'
should be rendered correctly
'
,
()
=>
{
const
component
=
shallow
(<
GCUView
/>).
getElement
()
...
...
src/components/GCU/__snapshots__/GCUView.spec.tsx.snap
View file @
832d0d93
...
...
@@ -2,19 +2,19 @@
exports[`GCUView component should be rendered correctly 1`] = `
<React.Fragment>
<
mock-c
ozy
b
ar
<
C
ozy
B
ar
displayBackArrow={true}
titleKey="common.title_gcu"
/>
<
mock-h
eader
<
H
eader
desktopTitleKey="common.title_gcu"
displayBackArrow={true}
setHeaderHeight={[Function]}
/>
<
mock-c
ontent
<
C
ontent
height={0}
>
<GCUContent />
</
mock-c
ontent>
</
C
ontent>
</React.Fragment>
`;
src/components/Home/ConsumptionView.spec.tsx
View file @
832d0d93
/* eslint-disable react/display-name */
import
React
from
'
react
'
import
{
mount
}
from
'
enzyme
'
import
{
Provider
}
from
'
react-redux
'
...
...
@@ -11,8 +12,6 @@ import * as chartActions from 'store/chart/chart.actions'
import
{
FluidState
,
FluidType
}
from
'
enum/fluid.enum
'
import
{
TimeStep
}
from
'
enum/timeStep.enum
'
import
StyledSpinner
from
'
components/CommonKit/Spinner/StyledSpinner
'
import
FluidButtons
from
'
components/Home/FluidButtons
'
import
KonnectorViewerList
from
'
components/Konnector/KonnectorViewerList
'
import
ConsumptionView
from
'
./ConsumptionView
'
import
{
FluidStatus
}
from
'
models
'
import
{
mockTestProfile1
}
from
'
../../../tests/__mocks__/profileType.mock
'
...
...
@@ -78,7 +77,6 @@ describe('ConsumptionView component', () => {
loading
:
false
,
fluidStatus
:
mockFluidStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
...
...
@@ -102,7 +100,6 @@ describe('ConsumptionView component', () => {
loading
:
true
,
fluidStatus
:
mockFluidStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
...
...
@@ -121,7 +118,6 @@ describe('ConsumptionView component', () => {
loading
:
true
,
fluidStatus
:
mockInitialEcolyoState
.
global
.
fluidStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
mount
(
<
Provider
store
=
{
store
}
>
...
...
@@ -131,14 +127,12 @@ describe('ConsumptionView component', () => {
expect
(
setCurrentTimeStepSpy
).
toBeCalledTimes
(
1
)
expect
(
setCurrentTimeStepSpy
).
toHaveBeenCalledWith
(
TimeStep
.
WEEK
)
})
it
(
'
should render konnector list when no fluid is connected
'
,
()
=>
{
useSelectorSpy
.
mockReturnValue
({
currentTimeStep
:
TimeStep
.
WEEK
,
loading
:
true
,
fluidStatus
:
mockInitialEcolyoState
.
global
.
fluidStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
...
...
@@ -147,7 +141,6 @@ describe('ConsumptionView component', () => {
)
expect
(
wrapper
.
find
(
'
mock-consumptiondetails
'
).
exists
()).
toBeTruthy
()
})
it
(
'
should render mutlifluid consumption if at least one fluid is connected
'
,
()
=>
{
const
updatedStatus
:
FluidStatus
[]
=
mockInitialEcolyoState
.
global
.
fluidStatus
...
...
@@ -158,7 +151,6 @@ describe('ConsumptionView component', () => {
loading
:
true
,
fluidStatus
:
updatedStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
...
...
@@ -167,7 +159,6 @@ describe('ConsumptionView component', () => {
)
expect
(
wrapper
.
find
(
'
.consumptionview-content
'
).
exists
()).
toBeTruthy
()
})
it
(
'
should render Electricity when elec is connected
'
,
()
=>
{
const
updatedStatus
:
FluidStatus
[]
=
mockInitialEcolyoState
.
global
.
fluidStatus
...
...
@@ -177,7 +168,6 @@ describe('ConsumptionView component', () => {
loading
:
true
,
fluidStatus
:
updatedStatus
,
releaseNotes
:
mockInitialEcolyoState
.
global
.
releaseNotes
,
openPartnersIssueModal
:
false
,
})
const
wrapper
=
mount
(
<
Provider
store
=
{
store
}
>
...
...
src/components/LegalNotice/LegalNoticeView.spec.tsx
View file @
832d0d93
...
...
@@ -2,10 +2,6 @@ import React from 'react'
import
{
shallow
}
from
'
enzyme
'
import
LegalNoticeView
from
'
components/LegalNotice/LegalNoticeView
'
jest
.
mock
(
'
components/Header/CozyBar
'
,
()
=>
'
mock-cozybar
'
)
jest
.
mock
(
'
components/Header/Header
'
,
()
=>
'
mock-header
'
)
jest
.
mock
(
'
components/Content/Content
'
,
()
=>
'
mock-content
'
)
describe
(
'
LegalNoticeView component
'
,
()
=>
{
it
(
'
should be rendered correctly
'
,
()
=>
{
const
component
=
shallow
(<
LegalNoticeView
/>).
getElement
()
...
...
src/components/LegalNotice/__snapshots__/LegalNoticeView.spec.tsx.snap
View file @
832d0d93
...
...
@@ -2,19 +2,19 @@
exports[`LegalNoticeView component should be rendered correctly 1`] = `
<React.Fragment>
<
mock-c
ozy
b
ar
<
C
ozy
B
ar
displayBackArrow={true}
titleKey="common.title_legal_notice"
/>
<
mock-h
eader
<
H
eader
desktopTitleKey="common.title_legal_notice"
displayBackArrow={true}
setHeaderHeight={[Function]}
/>
<
mock-c
ontent
<
C
ontent
height={0}
>
<LegalNoticeContent />
</
mock-c
ontent>
</
C
ontent>
</React.Fragment>
`;
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment