From cce319492e85c62cd9e7b61a02331b5e15173b1c Mon Sep 17 00:00:00 2001
From: Yoan VALLET <ext.sopra.yvallet@grandlyon.com>
Date: Tue, 30 Mar 2021 17:44:04 +0200
Subject: [PATCH] feat: update ActivateHalfHourLoad

---
 .../ActivateHalfHourLoad/ActivateHalfHourLoad.spec.tsx     | 4 ++--
 .../ActivateHalfHourLoad/ActivateHalfHourLoad.tsx          | 7 ++++---
 src/locales/fr.json                                        | 5 ++++-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.spec.tsx b/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.spec.tsx
index ae28dd87d..8e8e3841c 100644
--- a/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.spec.tsx
+++ b/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.spec.tsx
@@ -6,7 +6,7 @@ import configureStore from 'redux-mock-store'
 import { globalStateData } from '../../../tests/__mocks__/globalStateData.mock'
 import * as reactRedux from 'react-redux'
 import { userChallengeExplo1OnGoing } from '../../../tests/__mocks__/userChallengeData.mock'
-import MuiButton from '@material-ui/core/Button'
+import Button from '@material-ui/core/Button'
 
 jest.mock('cozy-ui/transpiled/react/I18n', () => {
   return {
@@ -39,7 +39,7 @@ describe('ActivateHalfHourLoad component test', () => {
 
     global.open = jest.fn()
 
-    wrapper.find(MuiButton).simulate('click')
+    wrapper.find(Button).simulate('click')
     expect(global.open).toHaveBeenCalledWith(
       'https://mon-compte-particulier.enedis.fr/donnees/',
       '_blank'
diff --git a/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.tsx b/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.tsx
index 8c91e9222..6c445e602 100644
--- a/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.tsx
+++ b/src/components/ActivateHalfHourLoad/ActivateHalfHourLoad.tsx
@@ -2,7 +2,7 @@ import React from 'react'
 import { IuseI18n, useI18n } from 'cozy-ui/transpiled/react/I18n'
 
 import ConfigService from 'services/fluidConfig.service'
-import MuiButton from '@material-ui/core/Button'
+import Button from '@material-ui/core/Button'
 import StyledIcon from 'components/CommonKit/Icon/StyledIcon'
 import iconEnedisLogo from 'assets/icons/visu/enedis-logo.svg'
 import './activateHalfHourLoad.scss'
@@ -20,7 +20,8 @@ const ActivateHalfHourLoad = () => {
       <div className="activatehalfhour-box-header header-text text-16-normal">
         {t('timestep.activate.enedis.info')}
       </div>
-      <MuiButton
+      <Button
+        aria-label={t('timestep.activate.enedis.accessibility.button_activate')}
         onClick={() => {
           setValidExploration(UserExplorationID.EXPLORATION004)
           window.open(fluidConfig[0].konnectorConfig.activation, '_blank')
@@ -38,7 +39,7 @@ const ActivateHalfHourLoad = () => {
             <div> {t('timestep.activate.enedis.label1')}</div>
           </div>
         </div>
-      </MuiButton>
+      </Button>
     </div>
   )
 }
diff --git a/src/locales/fr.json b/src/locales/fr.json
index e5a5a8e7c..0974445c8 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -314,7 +314,10 @@
     "activate": {
       "enedis": {
         "info": "Pour visualiser vos consommations à la 1/2 heure, il vous faut valider l'activation de l'enregistrement de votre consommation horaire sur votre compte Enedis",
-        "label1": "Activer sur mon compte Enedis"
+        "label1": "Activer sur mon compte Enedis",
+        "accessibility": {
+          "button_activate": "Aller sur mon compte Enedis"
+        }
       }
     }
   },
-- 
GitLab