Commit 11196170 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Merge branch 'fix/default-mail-notification' into 'dev'

fix defalut value for analysis notif

See merge request web-et-numerique/llle_project/ecolyo!400
parents cf35a355 fa88c874
cozy-doctypes @ f4d6559b
Subproject commit f4d6559b8c0a764136f73271eb814187410ceebc
......@@ -38,16 +38,16 @@ describe('ReportOptions component', () => {
updateProfileSpy.mockClear()
})
it('should be rendered with sendAnalysisNotification to false', () => {
it('should be rendered with sendAnalysisNotification to true', () => {
const wrapper = mount(
<Provider store={store}>
<ReportOptions />
</Provider>
)
expect(wrapper.find(Button).text()).toBe('profile.report.activate')
expect(wrapper.find(Button).text()).toBe('profile.report.deactivate')
})
it('should update the profile with sendAnalysisNotification to true', () => {
it('should update the profile with sendAnalysisNotification to false', () => {
const wrapper = mount(
<Provider store={store}>
<ReportOptions />
......@@ -59,11 +59,11 @@ describe('ReportOptions component', () => {
.simulate('click')
expect(updateProfileSpy).toBeCalledTimes(1)
expect(updateProfileSpy).toHaveBeenCalledWith({
sendAnalysisNotification: true,
sendAnalysisNotification: false,
})
})
it('should be rendered with sendAnalysisNotification true and toggle it to false', () => {
mockInitialEcolyoState.profile.sendAnalysisNotification = true
it('should be rendered with sendAnalysisNotification false and toggle it to true', () => {
mockInitialEcolyoState.profile.sendAnalysisNotification = false
store = createMockStore(mockInitialEcolyoState)
const wrapper = mount(
......@@ -77,7 +77,7 @@ describe('ReportOptions component', () => {
.simulate('click')
expect(updateProfileSpy).toBeCalledTimes(1)
expect(updateProfileSpy).toHaveBeenCalledWith({
sendAnalysisNotification: false,
sendAnalysisNotification: true,
})
})
})
......@@ -9,7 +9,7 @@
"lastConnectionDate": "0000-01-01T00:00:00.000Z",
"haveSeenOldFluidModal": false,
"haveSeenLastAnalysis": true,
"sendAnalysisNotification": false,
"sendAnalysisNotification": true,
"monthlyAnalysisDate": "0000-01-01T00:00:00.000Z",
"isLastTermAccepted": false,
"isProfileTypeCompleted": false,
......
......@@ -17,7 +17,7 @@ const initialState: Profile = {
lastConnectionDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
haveSeenOldFluidModal: true,
haveSeenLastAnalysis: true,
sendAnalysisNotification: false,
sendAnalysisNotification: true,
mailToken: '',
monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
isProfileTypeCompleted: false,
......
......@@ -108,7 +108,7 @@ export const mockInitialProfileState: Profile = {
lastConnectionDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
haveSeenOldFluidModal: true,
haveSeenLastAnalysis: true,
sendAnalysisNotification: false,
sendAnalysisNotification: true,
mailToken: '',
monthlyAnalysisDate: DateTime.fromISO('0000-01-01T00:00:00.000Z'),
isProfileTypeCompleted: false,
......
Supports Markdown
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