diff --git a/e2e-tests/email.spec.ts b/e2e-tests/email.spec.ts index 251e383b..bb60dd3c 100644 --- a/e2e-tests/email.spec.ts +++ b/e2e-tests/email.spec.ts @@ -1,4 +1,5 @@ import { expect, type Page, test } from "@playwright/test"; +import contactTranslations from "../public/locales/en/contact.json"; const goToContactAndFillForm = async ( page: Page, @@ -42,9 +43,7 @@ test("invalid email", async ({ page }) => { await page.click("button[type=submit]"); // Check the error element - expect( - ( - await page.waitForSelector('p[data-testId="email error message"]') - ).isVisible(), - ).toBeTruthy(); + await expect( + page.getByText(contactTranslations["invalid email"]), + ).toBeVisible(); }); diff --git a/src/pages/contact/index.tsx b/src/pages/contact/index.tsx index 81fc54dd..3b36acde 100644 --- a/src/pages/contact/index.tsx +++ b/src/pages/contact/index.tsx @@ -80,7 +80,9 @@ const ContactUs = () => {
{errors.firstName.message}
++ {errors.firstName.message} +
)}{errors.lastName.message}
++ {errors.lastName.message} +
)}+
{errors.email.message}
)} @@ -124,7 +128,9 @@ const ContactUs = () => {{errors.message.message}
++ {errors.message.message} +
)}