();
@@ -33,8 +33,8 @@ export function ContactForm() {
!isMutating && data && data.createWebformSubmission?.submission
? [
intl.formatMessage({
- defaultMessage: 'The contact has been submitted.',
- id: 'gD5ZU1',
+ defaultMessage: 'The inquiry has been submitted.',
+ id: 'SEJ9ng',
}),
]
: null;
@@ -48,7 +48,7 @@ export function ContactForm() {
className="mt-5 sm:items-center"
onSubmit={handleSubmit((values) => {
trigger({
- webformId: 'contact',
+ webformId: 'inquiry',
submittedData: JSON.stringify(values),
});
})}
@@ -102,18 +102,18 @@ export function ContactForm() {
/>
-
diff --git a/packages/ui/src/components/Organisms/Contact.tsx b/packages/ui/src/components/Organisms/Contact.tsx
deleted file mode 100644
index 22a40d0ab..000000000
--- a/packages/ui/src/components/Organisms/Contact.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-
-import { ContactForm } from '../Molecules/ContactForm';
-
-export function Contact() {
- return (
-
-
-
- );
-}
diff --git a/packages/ui/src/components/Organisms/Inquiry.tsx b/packages/ui/src/components/Organisms/Inquiry.tsx
new file mode 100644
index 000000000..6a5bb6404
--- /dev/null
+++ b/packages/ui/src/components/Organisms/Inquiry.tsx
@@ -0,0 +1,11 @@
+import React from 'react';
+
+import { InquiryForm } from '../Molecules/InquiryForm';
+
+export function Inquiry() {
+ return (
+
+
+
+ );
+}
diff --git a/packages/ui/src/components/Routes/Contact.tsx b/packages/ui/src/components/Routes/Inquiry.tsx
similarity index 67%
rename from packages/ui/src/components/Routes/Contact.tsx
rename to packages/ui/src/components/Routes/Inquiry.tsx
index 1a3963ced..5476fc91d 100644
--- a/packages/ui/src/components/Routes/Contact.tsx
+++ b/packages/ui/src/components/Routes/Inquiry.tsx
@@ -3,18 +3,18 @@ import React from 'react';
import { useTranslations } from '../../utils/translations';
import { PageTransition } from '../Molecules/PageTransition';
-import { Contact as ContactOrganism } from '../Organisms/Contact';
+import { Inquiry as InquiryOrganism } from '../Organisms/Inquiry';
-export function Contact() {
- // Initialize the contact page in each language.
+export function Inquiry() {
+ // Initialize the inquiry page in each language.
useTranslations(
Object.fromEntries(
- Object.values(Locale).map((locale) => [locale, `/${locale}/contact`]),
+ Object.values(Locale).map((locale) => [locale, `/${locale}/inquiry`]),
),
);
return (
-
+
);
}
diff --git a/tests/e2e/specs/contact.spec.ts b/tests/e2e/specs/drupal/inquiry.spec.ts
similarity index 70%
rename from tests/e2e/specs/contact.spec.ts
rename to tests/e2e/specs/drupal/inquiry.spec.ts
index 1a38fb1ab..828db25f9 100644
--- a/tests/e2e/specs/contact.spec.ts
+++ b/tests/e2e/specs/drupal/inquiry.spec.ts
@@ -1,35 +1,35 @@
import { expect, test } from '@playwright/test';
-import { websiteUrl } from '../helpers/url';
+import { websiteUrl } from '../../helpers/url';
-test.describe('contact (mutation example)', () => {
- test('succesfull contact submission', async ({ page }) => {
- await page.goto(websiteUrl('/en/contact'));
+test.describe('inquiry (mutation example)', () => {
+ test('succesfull inquiry submission', async ({ page }) => {
+ await page.goto(websiteUrl('/en/inquiry'));
const content = await page.getByRole('main');
await content.getByPlaceholder('Name').fill('John Doe');
await content.getByPlaceholder('Email').fill('john@doe.com');
await content.getByPlaceholder('Subject').fill('Lorem ipsum');
await content
- .getByPlaceholder('Message')
+ .getByPlaceholder('Question')
.fill(
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna.',
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna?',
);
await content.getByText('Submit').click();
await expect(
- content.getByText('The contact has been submitted.'),
+ content.getByText('The inquiry has been submitted.'),
).toBeVisible();
});
test('invalid e-mail address', async ({ page }) => {
- await page.goto(websiteUrl('/en/contact'));
+ await page.goto(websiteUrl('/en/inquiry'));
const content = await page.getByRole('main');
await content.getByPlaceholder('Name').fill('John Doe');
await content.getByPlaceholder('Email').fill('john');
await content.getByPlaceholder('Subject').fill('Lorem ipsum');
await content
- .getByPlaceholder('Message')
+ .getByPlaceholder('Question')
.fill(
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna.',
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna?',
);
await content.getByText('Submit').click();
await expect(
diff --git a/tests/schema/specs/contact.spec.ts b/tests/schema/specs/inquiry.spec.ts
similarity index 74%
rename from tests/schema/specs/contact.spec.ts
rename to tests/schema/specs/inquiry.spec.ts
index c0e7efe88..e280e8c06 100644
--- a/tests/schema/specs/contact.spec.ts
+++ b/tests/schema/specs/inquiry.spec.ts
@@ -3,13 +3,13 @@ import { describe, expect, it } from 'vitest';
import { fetch } from '../lib.js';
-describe('create contact', () => {
- it('creates a new contact using a graphql mutation', async () => {
+describe('create inquiry', () => {
+ it('creates a new inquiry using a graphql mutation', async () => {
const result = await fetch(gql`
mutation {
createWebformSubmission(
- webformId: "contact"
- submittedData: "{\\"name\\": \\"John Doe\\", \\"email\\": \\"john@doe.com\\", \\"message\\": \\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna.\\", \\"subject\\": \\"Lorem ipsum\\"}"
+ webformId: "inquiry"
+ submittedData: "{\\"name\\": \\"John Doe\\", \\"email\\": \\"john@doe.com\\", \\"question\\": \\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna?\\", \\"subject\\": \\"Lorem ipsum\\"}"
) {
errors {
key
@@ -24,20 +24,20 @@ describe('create contact', () => {
result.data.createWebformSubmission.submission,
);
expect(submission.email).toEqual('john@doe.com');
- expect(submission.message).toEqual(
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna.',
+ expect(submission.question).toEqual(
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In pretium aliquam magna?',
);
expect(submission.name).toEqual('John Doe');
expect(submission.subject).toEqual('Lorem ipsum');
expect(result.data.createWebformSubmission.errors).toBeNull();
});
- it('tries to create a new contact with an invalid e-mail address', async () => {
+ it('tries to create a new inquiry with an invalid e-mail address', async () => {
const result = await fetch(gql`
mutation {
createWebformSubmission(
- webformId: "contact"
- submittedData: "{\\"name\\": \\"Jane\\",\\"email\\": \\"invalid_email\\",\\"message\\": \\"Test message.\\",\\"subject\\": \\"Test subject\\"}"
+ webformId: "inquiry"
+ submittedData: "{\\"name\\": \\"Jane\\",\\"email\\": \\"invalid_email\\",\\"question\\": \\"Is this a test?\\",\\"subject\\": \\"Test subject\\"}"
) {
errors {
key