diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx
index d40fd9bdb..e95423a72 100644
--- a/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx
+++ b/src/screens/OfferEducational/OfferEducationalForm/FormContact/FormContact.tsx
@@ -2,6 +2,7 @@ import React from 'react'
import { TextInput } from 'ui-kit'
+import { EMAIL_LABEL, PHONE_LABEL } from '../../constants/labels'
import FormSection from '../FormSection'
import styles from './FormContact.module.scss'
@@ -14,13 +15,13 @@ const FormContact = (): JSX.Element => {
>
diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx
index 6f55906c3..9b9df924e 100644
--- a/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx
+++ b/src/screens/OfferEducational/OfferEducationalForm/FormType/FormType.tsx
@@ -3,6 +3,12 @@ import React from 'react'
import { Category, SubCategory } from 'custom_types/categories'
import { Select, TextArea, TextInput } from 'ui-kit'
+import {
+ CATEGORY_LABEL,
+ DESCRIPTION_LABEL,
+ SUBCATEGORY_LABEL,
+ TITLE_LABEL,
+} from '../../constants/labels'
import FormSection from '../FormSection'
import styles from './FormType.module.scss'
@@ -29,27 +35,27 @@ const EACOfferCreationType = ({
>
diff --git a/src/screens/OfferEducational/OfferEducationalForm/FormVenue/FormVenue.tsx b/src/screens/OfferEducational/OfferEducationalForm/FormVenue/FormVenue.tsx
index 648844ecc..419876faf 100644
--- a/src/screens/OfferEducational/OfferEducationalForm/FormVenue/FormVenue.tsx
+++ b/src/screens/OfferEducational/OfferEducationalForm/FormVenue/FormVenue.tsx
@@ -2,6 +2,7 @@ import React from 'react'
import { Select } from 'ui-kit'
+import { OFFERER_LABEL, VENUE_LABEL } from '../../constants/labels'
import FormSection from '../FormSection'
import styles from './FormVenue.module.scss'
@@ -15,14 +16,14 @@ const FormVenue = (): JSX.Element => {
diff --git a/src/screens/OfferEducational/__specs__/OfferEducationalDefaultValues.spec.tsx b/src/screens/OfferEducational/__specs__/OfferEducationalDefaultValues.spec.tsx
index d0bbc1a8f..a89291f31 100644
--- a/src/screens/OfferEducational/__specs__/OfferEducationalDefaultValues.spec.tsx
+++ b/src/screens/OfferEducational/__specs__/OfferEducationalDefaultValues.spec.tsx
@@ -6,6 +6,19 @@ import { Router } from 'react-router'
import { getCategoriesSelect, getSubcategoriesSelect } from '../__tests-utils__/eacOfferCreationUtils'
import setDefaultProps from '../__tests-utils__/setDefaultProps'
+import {
+ DESCRIPTION_LABEL,
+ EMAIL_LABEL,
+ NOTIFICATIONS_EMAIL_LABEL,
+ NOTIFICATIONS_LABEL,
+ OFFERER_LABEL,
+ OFFER_VENUE_OFFERER_LABEL,
+ OFFER_VENUE_OTHER_LABEL,
+ OFFER_VENUE_SCHOOL_LABEL,
+ PHONE_LABEL,
+ TITLE_LABEL,
+ VENUE_LABEL,
+} from '../constants/labels'
import OfferEducational, { IOfferEducationalProps } from '../OfferEducational'
import { accessibilityOptions } from '../OfferEducationalForm/FormAccessibility/accessibilityOptions'
import { participantsOptions } from '../OfferEducationalForm/FormParticipants/participantsOptions'
@@ -39,21 +52,21 @@ describe('screens | OfferEducational', () => {
const subCategoriesSelect = getSubcategoriesSelect()
expect(subCategoriesSelect.value).toBe('')
- const titleInput = screen.getByLabelText("Titre de l'offre") as HTMLInputElement
+ const titleInput = screen.getByLabelText(TITLE_LABEL) as HTMLInputElement
expect(titleInput.value).toBe('')
- const descriptionTextArea = screen.getByLabelText('Description') as HTMLTextAreaElement
+ const descriptionTextArea = screen.getByLabelText(DESCRIPTION_LABEL) as HTMLTextAreaElement
expect(descriptionTextArea.value).toBe('')
- const offererSelect = screen.getByLabelText('Structure') as HTMLSelectElement
+ const offererSelect = screen.getByLabelText(OFFERER_LABEL) as HTMLSelectElement
expect(offererSelect.value).toBe('')
- const venueSelect = screen.getByLabelText('Lieu qui percevra le remboursement') as HTMLSelectElement
+ const venueSelect = screen.getByLabelText(VENUE_LABEL) as HTMLSelectElement
expect(venueSelect.value).toBe('')
- const offerVenueRadio1 = screen.getByLabelText('Dans votre établissement') as HTMLInputElement
- const offerVenueRadio2 = screen.getByLabelText("Dans l'établissement scolaire") as HTMLInputElement
- const offerVenueRadio3 = screen.getByLabelText('Autre') as HTMLInputElement
+ const offerVenueRadio1 = screen.getByLabelText(OFFER_VENUE_OFFERER_LABEL) as HTMLInputElement
+ const offerVenueRadio2 = screen.getByLabelText(OFFER_VENUE_SCHOOL_LABEL) as HTMLInputElement
+ const offerVenueRadio3 = screen.getByLabelText(OFFER_VENUE_OTHER_LABEL) as HTMLInputElement
[offerVenueRadio1, offerVenueRadio2, offerVenueRadio3].forEach(radio => {
expect(radio.checked).toBe(false)
})
@@ -68,16 +81,16 @@ describe('screens | OfferEducational', () => {
expect(accessibilityCheckbox.checked).toBe(false)
})
- const phoneInput = screen.getByLabelText('Téléphone') as HTMLInputElement
+ const phoneInput = screen.getByLabelText(PHONE_LABEL) as HTMLInputElement
expect(phoneInput.value).toBe('')
- const emailInput = screen.getByLabelText('Email') as HTMLInputElement
+ const emailInput = screen.getByLabelText(EMAIL_LABEL) as HTMLInputElement
expect(emailInput.value).toBe('')
- const notificationsCheckbox = screen.getByLabelText('Être notifié par email des réservations') as HTMLInputElement
+ const notificationsCheckbox = screen.getByLabelText(NOTIFICATIONS_LABEL) as HTMLInputElement
expect(notificationsCheckbox.checked).toBe(false)
- const notificationEmailInput = screen.getByLabelText('Email auquel envoyer les notifications') as HTMLInputElement
+ const notificationEmailInput = screen.getByLabelText(NOTIFICATIONS_EMAIL_LABEL) as HTMLInputElement
expect(notificationEmailInput.value).toBe('')
})
})
diff --git a/src/screens/OfferEducational/__tests-utils__/eacOfferCreationUtils.ts b/src/screens/OfferEducational/__tests-utils__/eacOfferCreationUtils.ts
index 48e14acd1..551c66268 100644
--- a/src/screens/OfferEducational/__tests-utils__/eacOfferCreationUtils.ts
+++ b/src/screens/OfferEducational/__tests-utils__/eacOfferCreationUtils.ts
@@ -1,7 +1,9 @@
import { screen } from '@testing-library/react'
+import { CATEGORY_LABEL, SUBCATEGORY_LABEL } from 'screens/OfferEducational/constants/labels'
+
export const getCategoriesSelect = (): HTMLSelectElement =>
- screen.getByLabelText('Domaine') as HTMLSelectElement
+ screen.getByLabelText(CATEGORY_LABEL) as HTMLSelectElement
export const getSubcategoriesSelect = (): HTMLSelectElement =>
- screen.getByLabelText('Sous Domaine') as HTMLSelectElement
+ screen.getByLabelText(SUBCATEGORY_LABEL) as HTMLSelectElement
diff --git a/src/screens/OfferEducational/constants/labels.ts b/src/screens/OfferEducational/constants/labels.ts
new file mode 100644
index 000000000..deeacbdaa
--- /dev/null
+++ b/src/screens/OfferEducational/constants/labels.ts
@@ -0,0 +1,13 @@
+export const CATEGORY_LABEL = "Domaine"
+export const SUBCATEGORY_LABEL = "Sous Domaine"
+export const TITLE_LABEL = "Titre de l'offre"
+export const DESCRIPTION_LABEL = "Description"
+export const OFFERER_LABEL = "Structure"
+export const VENUE_LABEL = "Lieu qui percevra le remboursement"
+export const OFFER_VENUE_OFFERER_LABEL = "Dans notre établissement"
+export const OFFER_VENUE_SCHOOL_LABEL = "Dans l'établissement scolaire"
+export const OFFER_VENUE_OTHER_LABEL = "Autre"
+export const PHONE_LABEL = "Téléphone"
+export const EMAIL_LABEL = "Email"
+export const NOTIFICATIONS_LABEL = "Être notifié par email des réservations"
+export const NOTIFICATIONS_EMAIL_LABEL = "Email auquel envoyer les notifications"