diff --git a/src/App.test.tsx b/src/App.test.tsx index 0818bef..f1bdf0a 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -5,21 +5,21 @@ import App from './App' describe('App routing', () => { it('renders the Home page at /', async () => { render() - expect(await screen.findByText(/your hair, your crown/i)).toBeInTheDocument() + expect(await screen.findByText(/vos cheveux, votre couronne/i)).toBeInTheDocument() }) it('renders the Shop page at /shop', () => { render() - expect(screen.getByRole('heading', { name: /shop/i })).toBeInTheDocument() + expect(screen.getByRole('heading', { name: /boutique/i })).toBeInTheDocument() }) it('renders the Book page at /book', () => { render() - expect(screen.getByRole('heading', { name: /book an appointment/i })).toBeInTheDocument() + expect(screen.getByRole('heading', { name: /réserver un rendez-vous/i })).toBeInTheDocument() }) it('renders the Rules page at /rules', () => { render() - expect(screen.getByRole('heading', { name: /salon rules/i })).toBeInTheDocument() + expect(screen.getByRole('heading', { name: /règlements/i })).toBeInTheDocument() }) }) diff --git a/src/components/Footer.test.tsx b/src/components/Footer.test.tsx index 8b1e26c..2f6c0fe 100644 --- a/src/components/Footer.test.tsx +++ b/src/components/Footer.test.tsx @@ -7,7 +7,7 @@ describe('Footer', () => { it('renders contact info and quick links', () => { render(
) expect(screen.getAllByText(/braids by mira/i).length).toBeGreaterThan(0) - expect(screen.getByRole('link', { name: /shop/i })).toHaveAttribute('href', '/shop') - expect(screen.getByRole('link', { name: /rules/i })).toHaveAttribute('href', '/rules') + expect(screen.getByRole('link', { name: /boutique/i })).toHaveAttribute('href', '/shop') + expect(screen.getByRole('link', { name: /règlements/i })).toHaveAttribute('href', '/rules') }) }) diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index a4e14c0..ccd046a 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -7,27 +7,27 @@ function Footer() {

Braids by Mira

-

Your hair, your crown

+

Vos cheveux, votre couronne

Contact

hello@braidsbymira.com -

Tue–Sat, 9am–6pm

+

Mar–Sam, 9h à 18h

-

Navigate

+

Navigation

    -
  • Home
  • -
  • Shop
  • -
  • Book
  • -
  • Rules
  • +
  • Accueil
  • +
  • Boutique
  • +
  • Réserver
  • +
  • Règlements
-

© {new Date().getFullYear()} Braids by Mira. All rights reserved.

+

© {new Date().getFullYear()} Braids by Mira. Tous droits réservés.

) } diff --git a/src/components/InquiryModal.test.tsx b/src/components/InquiryModal.test.tsx index 85d7103..dc65bc4 100644 --- a/src/components/InquiryModal.test.tsx +++ b/src/components/InquiryModal.test.tsx @@ -12,24 +12,24 @@ const product: Product = { describe('InquiryModal', () => { it('shows a validation error when submitting without a name or valid email', async () => { render() - await userEvent.click(screen.getByRole('button', { name: /send inquiry/i })) - expect(screen.getByText(/name is required/i)).toBeInTheDocument() - expect(screen.getByText(/valid email is required/i)).toBeInTheDocument() + await userEvent.click(screen.getByRole('button', { name: /envoyer la demande/i })) + expect(screen.getByText(/nom est requis/i)).toBeInTheDocument() + expect(screen.getByText(/adresse courriel valide est requise/i)).toBeInTheDocument() }) it('shows a confirmation after a valid submit', async () => { render() - await userEvent.type(screen.getByLabelText(/name/i), 'Jane Doe') - await userEvent.type(screen.getByLabelText(/email/i), 'jane@example.com') - await userEvent.click(screen.getByRole('button', { name: /send inquiry/i })) + await userEvent.type(screen.getByLabelText(/nom/i), 'Jane Doe') + await userEvent.type(screen.getByLabelText(/courriel/i), 'jane@example.com') + await userEvent.click(screen.getByRole('button', { name: /envoyer la demande/i })) expect(screen.getByText(/silk edge control/i)).toBeInTheDocument() - expect(screen.getByText(/mira will get back to you/i)).toBeInTheDocument() + expect(screen.getByText(/mira vous recontactera/i)).toBeInTheDocument() }) it('calls onClose when Close is clicked', async () => { const onClose = vi.fn() render() - await userEvent.click(screen.getByRole('button', { name: /close/i })) + await userEvent.click(screen.getByRole('button', { name: /fermer/i })) expect(onClose).toHaveBeenCalled() }) @@ -42,7 +42,7 @@ describe('InquiryModal', () => { it('exposes an accessible dialog labelled by its heading', () => { render() - const dialog = screen.getByRole('dialog', { name: /ask about silk edge control/i }) + const dialog = screen.getByRole('dialog', { name: /une question sur silk edge control/i }) expect(dialog).toHaveAttribute('aria-modal', 'true') }) }) diff --git a/src/components/InquiryModal.tsx b/src/components/InquiryModal.tsx index c0681c7..04ab6bf 100644 --- a/src/components/InquiryModal.tsx +++ b/src/components/InquiryModal.tsx @@ -38,8 +38,8 @@ function InquiryModal({ product, onClose }: InquiryModalProps) { function handleSubmit(e: FormEvent) { e.preventDefault() const nextErrors: Errors = {} - if (!name.trim()) nextErrors.name = 'Name is required.' - if (!isValidEmail(email)) nextErrors.email = 'A valid email is required.' + if (!name.trim()) nextErrors.name = 'Le nom est requis.' + if (!isValidEmail(email)) nextErrors.email = 'Une adresse courriel valide est requise.' setErrors(nextErrors) if (Object.keys(nextErrors).length === 0) { setSubmitted(true) @@ -61,14 +61,14 @@ function InquiryModal({ product, onClose }: InquiryModalProps) { > {submitted ? ( <> -

Thanks — Mira will get back to you about {product.name} soon.

- +

Merci — Mira vous recontactera bientôt au sujet de {product.name}.

+ ) : (
-

Ask about {product.name}

+

Une question sur {product.name}

- + {errors.name}}
- + setEmail(e.target.value)} /> {errors.email && {errors.email}}
@@ -86,8 +86,8 @@ function InquiryModal({ product, onClose }: InquiryModalProps) {