From 3fca1a17d4d360ddbcc8feb01c98143fcbef5f95 Mon Sep 17 00:00:00 2001
From: "guilhem.carron" <gcarron@grandlyon.com>
Date: Thu, 1 Jul 2021 17:57:55 +0200
Subject: [PATCH] Fix date issue

---
 src/components/Analysis/MonthlyAnalysis.spec.tsx     |  6 +++++-
 .../__snapshots__/MonthlyAnalysis.spec.tsx.snap      |  2 +-
 src/components/DateNavigator/DateNavigator.spec.tsx  | 12 ++++++++++--
 .../__snapshots__/DateNavigator.spec.tsx.snap        |  2 +-
 4 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/components/Analysis/MonthlyAnalysis.spec.tsx b/src/components/Analysis/MonthlyAnalysis.spec.tsx
index 4071f3e07..fc432cab6 100644
--- a/src/components/Analysis/MonthlyAnalysis.spec.tsx
+++ b/src/components/Analysis/MonthlyAnalysis.spec.tsx
@@ -35,7 +35,11 @@ describe('MonthlyAnalysis component', () => {
     })
     const wrapper = mount(
       <Provider store={store}>
-        <MonthlyAnalysis analysisDate={DateTime.now()} />
+        <MonthlyAnalysis
+          analysisDate={DateTime.fromISO('2021-07-01T00:00:00.000Z', {
+            zone: 'utc',
+          })}
+        />
       </Provider>
     ).getElement()
     expect(wrapper).toMatchSnapshot()
diff --git a/src/components/Analysis/__snapshots__/MonthlyAnalysis.spec.tsx.snap b/src/components/Analysis/__snapshots__/MonthlyAnalysis.spec.tsx.snap
index 118820c61..983549448 100644
--- a/src/components/Analysis/__snapshots__/MonthlyAnalysis.spec.tsx.snap
+++ b/src/components/Analysis/__snapshots__/MonthlyAnalysis.spec.tsx.snap
@@ -14,7 +14,7 @@ exports[`MonthlyAnalysis component should be rendered correctly 1`] = `
   }
 >
   <MonthlyAnalysis
-    analysisDate={"2021-07-01T16:56:01.139+02:00"}
+    analysisDate={"2021-07-01T00:00:00.000Z"}
   />
 </Provider>
 `;
diff --git a/src/components/DateNavigator/DateNavigator.spec.tsx b/src/components/DateNavigator/DateNavigator.spec.tsx
index 621cc60f6..ade638c42 100644
--- a/src/components/DateNavigator/DateNavigator.spec.tsx
+++ b/src/components/DateNavigator/DateNavigator.spec.tsx
@@ -36,7 +36,11 @@ describe('DateNavigator component', () => {
     })
     const wrapper = mount(
       <Provider store={store}>
-        <DateNavigator currentAnalysisDate={DateTime.now()} />
+        <DateNavigator
+          currentAnalysisDate={DateTime.fromISO('2021-07-01T00:00:00.000Z', {
+            zone: 'utc',
+          })}
+        />
       </Provider>
     ).getElement()
     expect(wrapper).toMatchSnapshot()
@@ -50,7 +54,11 @@ describe('DateNavigator component', () => {
     })
     const wrapper = mount(
       <Provider store={store}>
-        <DateNavigator currentAnalysisDate={DateTime.now()} />
+        <DateNavigator
+          currentAnalysisDate={DateTime.fromISO('2021-07-01T00:00:00.000Z', {
+            zone: 'utc',
+          })}
+        />
       </Provider>
     )
     await act(async () => {
diff --git a/src/components/DateNavigator/__snapshots__/DateNavigator.spec.tsx.snap b/src/components/DateNavigator/__snapshots__/DateNavigator.spec.tsx.snap
index a7b34dfbf..e58a9227a 100644
--- a/src/components/DateNavigator/__snapshots__/DateNavigator.spec.tsx.snap
+++ b/src/components/DateNavigator/__snapshots__/DateNavigator.spec.tsx.snap
@@ -14,7 +14,7 @@ exports[`DateNavigator component should be rendered correctly 1`] = `
   }
 >
   <DateNavigator
-    currentAnalysisDate={"2021-07-01T16:57:12.679+02:00"}
+    currentAnalysisDate={"2021-07-01T00:00:00.000Z"}
   />
 </Provider>
 `;
-- 
GitLab