diff --git a/cozy-doctypes b/cozy-doctypes new file mode 160000 index 0000000000000000000000000000000000000000..f4d6559b8c0a764136f73271eb814187410ceebc --- /dev/null +++ b/cozy-doctypes @@ -0,0 +1 @@ +Subproject commit f4d6559b8c0a764136f73271eb814187410ceebc diff --git a/src/components/Options/ReportOptions.spec.tsx b/src/components/Options/ReportOptions.spec.tsx index 65778d6110d62c7a5ff360a3f6d12c40901a0a58..8636d80be32438a247c1339d66e8d906f86bfe30 100644 --- a/src/components/Options/ReportOptions.spec.tsx +++ b/src/components/Options/ReportOptions.spec.tsx @@ -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, }) }) }) diff --git a/src/db/profileData.json b/src/db/profileData.json index 991a1bfb43578f714bdca972ab49668b4824c919..94d627979699e33ad7e957a62978cfe6f48fc885 100644 --- a/src/db/profileData.json +++ b/src/db/profileData.json @@ -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, diff --git a/src/store/profile/profile.reducer.ts b/src/store/profile/profile.reducer.ts index 4033835e95b2ac759277869ede3f8564570a2c7b..df049b075d6e5e9913367fae158a738a12aa0e78 100644 --- a/src/store/profile/profile.reducer.ts +++ b/src/store/profile/profile.reducer.ts @@ -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, diff --git a/tests/__mocks__/store.ts b/tests/__mocks__/store.ts index c7e30e6d7fd482599decf6f6e3f8ee2b5026f007..fa8a9e56d1e879541397564ce3e0701431aeb05f 100644 --- a/tests/__mocks__/store.ts +++ b/tests/__mocks__/store.ts @@ -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,