Skip to content

Commit

Permalink
feat(EMS-3587-3425): contact page - content iterations (#2742)
Browse files Browse the repository at this point in the history
* feat(EMS-3587): contact page - content iterations

* chore(EMS-3587): remove commented code

* fix(EMS-3425): password reset - update label text

* fix(EMS-3425): password reset - update label text
  • Loading branch information
ttbarnes authored Jul 16, 2024
1 parent 5d71b6a commit 7232698
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 86 deletions.
5 changes: 5 additions & 0 deletions e2e-tests/content-strings/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const CONTACT_DETAILS = {
TEXT: UKEF_CONTACT_DETAILS.EMAIL.CREDIT_INSURANCE_SUPPORT,
VALUE: `mailto:${UKEF_CONTACT_DETAILS.EMAIL.CREDIT_INSURANCE_SUPPORT}`,
},
UNDERWRITING_EMAIL: {
PREFIX: 'Email',
TEXT: UKEF_CONTACT_DETAILS.EMAIL.UNDERWRITING,
VALUE: `mailto:${UKEF_CONTACT_DETAILS.EMAIL.UNDERWRITING}`,
},
PHONE: {
PREFIX: 'Phone',
VALUE: UKEF_CONTACT_DETAILS.PHONE,
Expand Down
15 changes: 7 additions & 8 deletions e2e-tests/content-strings/fields/insurance/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { FIELD_IDS } from '../../../../constants';

const { ACCOUNT } = FIELD_IDS.INSURANCE;
const {
FIRST_NAME, LAST_NAME, EMAIL, PASSWORD, ACCESS_CODE,
FIRST_NAME,
LAST_NAME,
EMAIL,
PASSWORD,
ACCESS_CODE,
} = ACCOUNT;

const PASSWORD_HINT = {
INTRO: 'Your password must contain at least 14 characters and have:',
RULES: [
'an uppercase letter',
'a lowercase letter',
'a number',
'a special character (for example @%!?*)',
],
RULES: ['an uppercase letter', 'a lowercase letter', 'a number', 'a special character (for example @%!?*)'],
};

export const ACCOUNT_FIELDS = {
Expand Down Expand Up @@ -66,7 +65,7 @@ export const ACCOUNT_FIELDS = {
},
NEW_PASSWORD: {
[PASSWORD]: {
LABEL: 'Enter a new password',
LABEL: 'Create a password',
HINT: PASSWORD_HINT,
},
},
Expand Down
9 changes: 5 additions & 4 deletions e2e-tests/content-strings/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,16 @@ const PAGE_NOT_FOUND_PAGE = {

const CONTACT_US_PAGE = {
PAGE_TITLE: 'Contact us',
WHO_TO_CONTACT: 'Who you need to contact depends on your type of query.',
INTRO: 'Who you need to contact depends on your type of query.',
QUOTE_REFERENCE_NUMBER: 'Quote your application reference number.',
CONTACT_DETAILS,
GENERAL_ENQUIRIES: {
HEADING: "Questions about an application you're working on or technical issues with the service",
},
APPLICATION_ENQUIRES: {
HEADING: "If you have a question about an application you've submitted",
HEADING: "Questions about an application you've submitted",
CONTACT_DETAILS,
},
CONTACT_DETAILS,
QUOTE_REFERENCE_NUMBER: 'Quote your application reference number',
};

const PROBLEM_WITH_SERVICE_PAGE = {
Expand Down
41 changes: 17 additions & 24 deletions e2e-tests/insurance/cypress/e2e/journeys/contact-us.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { contactUsPage } from '../../../../pages';
import { intro } from '../../../../pages/shared';
import footer from '../../../../partials/footer';
import { PAGES } from '../../../../content-strings';
import { ROUTES } from '../../../../constants';
Expand All @@ -7,12 +8,7 @@ const { generalEnquiries, applicationEnquiries } = contactUsPage;

const CONTENT_STRINGS = PAGES.CONTACT_US_PAGE;

const {
GENERAL_ENQUIRIES,
APPLICATION_ENQUIRES,
CONTACT_DETAILS: { EMAIL },
QUOTE_REFERENCE_NUMBER,
} = CONTENT_STRINGS;
const { GENERAL_ENQUIRIES, APPLICATION_ENQUIRES, QUOTE_REFERENCE_NUMBER } = CONTENT_STRINGS;

const baseUrl = Cypress.config('baseUrl');

Expand Down Expand Up @@ -43,42 +39,39 @@ context('Contact us page - Insurance', () => {
});

it('renders an intro/description', () => {
cy.checkText(contactUsPage.whoToContactText(), CONTENT_STRINGS.WHO_TO_CONTACT);
cy.checkText(intro(), CONTENT_STRINGS.INTRO);
});

it('renders a `quote reference number` link', () => {
cy.checkText(contactUsPage.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
});

describe('`application enquiries` section', () => {
it('renders a heading', () => {
cy.checkText(generalEnquiries.heading(), GENERAL_ENQUIRIES.HEADING);
});

it('renders `email prefix` copy', () => {
cy.checkText(generalEnquiries.emailPrefix(), EMAIL.PREFIX);
});

it('renders an email link', () => {
cy.checkLink(generalEnquiries.emailLink(), EMAIL.VALUE, EMAIL.TEXT);
});

it('renders a `quote reference number` link', () => {
cy.checkText(generalEnquiries.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
it('renders a `contact details` section', () => {
cy.assertContactDetailsContent();
});
});

describe('`application enquiries` section', () => {
const {
HEADING,
CONTACT_DETAILS: { UNDERWRITING_EMAIL },
} = APPLICATION_ENQUIRES;

it('renders a heading', () => {
cy.checkText(applicationEnquiries.heading(), APPLICATION_ENQUIRES.HEADING);
cy.checkText(applicationEnquiries.heading(), HEADING);
});

it('renders `email prefix` copy', () => {
cy.checkText(applicationEnquiries.emailPrefix(), EMAIL.PREFIX);
cy.checkText(applicationEnquiries.emailPrefix(), `${UNDERWRITING_EMAIL.PREFIX}:`);
});

it('renders an email link', () => {
cy.checkLink(applicationEnquiries.emailLink(), EMAIL.VALUE, EMAIL.TEXT);
});

it('renders a `quote reference number` link', () => {
cy.checkText(applicationEnquiries.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
cy.checkLink(applicationEnquiries.emailLink(), UNDERWRITING_EMAIL.VALUE, UNDERWRITING_EMAIL.TEXT);
});
});
});
6 changes: 1 addition & 5 deletions e2e-tests/pages/contact-us.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
export const contactUsPage = {
heading: () => cy.get('[data-cy="heading"]'),
whoToContactText: () => cy.get('[data-cy="who-to-contact"]'),
quoteReferenceNumber: () => cy.get('[data-cy="general-enquiries-quote-reference-number"]'),
generalEnquiries: {
heading: () => cy.get('[data-cy="general-enquiries-heading"]'),
emailPrefix: () => cy.get('[data-cy="general-enquiries-email-prefix"]'),
emailLink: () => cy.get('[data-cy="general-enquiries-email-link"]'),
quoteReferenceNumber: () => cy.get('[data-cy="general-enquiries-quote-reference-number"]'),
},
applicationEnquiries: {
heading: () => cy.get('[data-cy="application-enquiries-heading"]'),
emailPrefix: () => cy.get('[data-cy="application-enquiries-email-prefix"]'),
emailLink: () => cy.get('[data-cy="application-enquiries-email-link"]'),
quoteReferenceNumber: () => cy.get('[data-cy="application-enquiries-quote-reference-number"]'),
},
};
41 changes: 17 additions & 24 deletions e2e-tests/quote/cypress/e2e/journeys/quote/contact-us.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { contactUsPage } from '../../../../../pages';
import { intro } from '../../../../../pages/shared';
import footer from '../../../../../partials/footer';
import { PAGES } from '../../../../../content-strings';
import { ROUTES } from '../../../../../constants';
Expand All @@ -7,12 +8,7 @@ const { generalEnquiries, applicationEnquiries } = contactUsPage;

const CONTENT_STRINGS = PAGES.CONTACT_US_PAGE;

const {
GENERAL_ENQUIRIES,
APPLICATION_ENQUIRES,
CONTACT_DETAILS: { EMAIL },
QUOTE_REFERENCE_NUMBER,
} = CONTENT_STRINGS;
const { GENERAL_ENQUIRIES, APPLICATION_ENQUIRES, QUOTE_REFERENCE_NUMBER } = CONTENT_STRINGS;

const baseUrl = Cypress.config('baseUrl');

Expand Down Expand Up @@ -44,42 +40,39 @@ context('Contact us page - Quote', () => {
});

it('renders an intro/description', () => {
cy.checkText(contactUsPage.whoToContactText(), CONTENT_STRINGS.WHO_TO_CONTACT);
cy.checkText(intro(), CONTENT_STRINGS.INTRO);
});

it('renders a `quote reference number` link', () => {
cy.checkText(contactUsPage.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
});

describe('`application enquiries` section', () => {
it('renders a heading', () => {
cy.checkText(generalEnquiries.heading(), GENERAL_ENQUIRIES.HEADING);
});

it('renders `email prefix` copy', () => {
cy.checkText(generalEnquiries.emailPrefix(), EMAIL.PREFIX);
});

it('renders an email link', () => {
cy.checkLink(generalEnquiries.emailLink(), EMAIL.VALUE, EMAIL.TEXT);
});

it('renders a `quote reference number` link', () => {
cy.checkText(generalEnquiries.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
it('renders a `contact details` section', () => {
cy.assertContactDetailsContent();
});
});

describe('`application enquiries` section', () => {
const {
HEADING,
CONTACT_DETAILS: { UNDERWRITING_EMAIL },
} = APPLICATION_ENQUIRES;

it('renders a heading', () => {
cy.checkText(applicationEnquiries.heading(), APPLICATION_ENQUIRES.HEADING);
cy.checkText(applicationEnquiries.heading(), HEADING);
});

it('renders `email prefix` copy', () => {
cy.checkText(applicationEnquiries.emailPrefix(), EMAIL.PREFIX);
cy.checkText(applicationEnquiries.emailPrefix(), `${UNDERWRITING_EMAIL.PREFIX}:`);
});

it('renders an email link', () => {
cy.checkLink(applicationEnquiries.emailLink(), EMAIL.VALUE, EMAIL.TEXT);
});

it('renders a `quote reference number` link', () => {
cy.checkText(applicationEnquiries.quoteReferenceNumber(), QUOTE_REFERENCE_NUMBER);
cy.checkLink(applicationEnquiries.emailLink(), UNDERWRITING_EMAIL.VALUE, UNDERWRITING_EMAIL.TEXT);
});
});
});
2 changes: 1 addition & 1 deletion src/api/.keystone/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/api/content-strings/fields/insurance/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ACCOUNT_FIELDS = {
},
NEW_PASSWORD: {
[PASSWORD]: {
LABEL: 'Enter a new password',
LABEL: 'Create a password',
HINT: PASSWORD_HINT,
},
},
Expand Down
5 changes: 5 additions & 0 deletions src/ui/server/content-strings/contact/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const CONTACT_DETAILS = {
TEXT: UKEF_CONTACT_DETAILS.EMAIL.CREDIT_INSURANCE_SUPPORT,
VALUE: `mailto:${UKEF_CONTACT_DETAILS.EMAIL.CREDIT_INSURANCE_SUPPORT}`,
},
UNDERWRITING_EMAIL: {
PREFIX: 'Email',
TEXT: UKEF_CONTACT_DETAILS.EMAIL.UNDERWRITING,
VALUE: `mailto:${UKEF_CONTACT_DETAILS.EMAIL.UNDERWRITING}`,
},
PHONE: {
PREFIX: 'Phone',
VALUE: UKEF_CONTACT_DETAILS.PHONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const ACCOUNT_FIELDS = {
},
NEW_PASSWORD: {
[PASSWORD]: {
LABEL: 'Enter a new password',
LABEL: 'Create a password',
HINT: PASSWORD_HINT,
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/ui/server/content-strings/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,16 @@ const PROBLEM_WITH_SERVICE_PAGE = {

const CONTACT_US_PAGE = {
PAGE_TITLE: 'Contact us',
WHO_TO_CONTACT: 'Who you need to contact depends on your type of query.',
INTRO: 'Who you need to contact depends on your type of query.',
QUOTE_REFERENCE_NUMBER: 'Quote your application reference number.',
CONTACT_DETAILS,
GENERAL_ENQUIRIES: {
HEADING: "Questions about an application you're working on or technical issues with the service",
...CONTACT_DETAILS,
},
APPLICATION_ENQUIRES: {
HEADING: "If you have a question about an application you've submitted",
...CONTACT_DETAILS,
HEADING: "Questions about an application you've submitted",
CONTACT_DETAILS,
},
QUOTE_REFERENCE_NUMBER: 'Quote your application reference number',
};

const FEEDBACK_PAGE = {
Expand Down
23 changes: 10 additions & 13 deletions src/ui/templates/contact-us.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{{ CONTENT_STRINGS.PAGE_TITLE }}
{% endblock %}

{% set GENERAL_ENQUIRIES = CONTENT_STRINGS.GENERAL_ENQUIRIES %}
{% set APPLICATION_ENQUIRES = CONTENT_STRINGS.APPLICATION_ENQUIRES %}

{% block content %}

{{ govukBackLink({
Expand All @@ -20,27 +23,21 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters-from-desktop">

<p class="govuk-body" data-cy="who-to-contact">{{ CONTENT_STRINGS.WHO_TO_CONTACT }}</p>
<p class="govuk-body" data-cy="intro">{{ CONTENT_STRINGS.INTRO }}</p>

<h2 class="govuk-heading-m govuk-!-margin-top-9" data-cy="general-enquiries-heading">{{ CONTENT_STRINGS.GENERAL_ENQUIRIES.HEADING }}</h2>
<p data-cy="general-enquiries-quote-reference-number">{{ CONTENT_STRINGS.QUOTE_REFERENCE_NUMBER }}</p>

<p class="govuk-body">
<span data-cy="general-enquiries-email-prefix">{{ CONTENT_STRINGS.GENERAL_ENQUIRIES.EMAIL.PREFIX }} </span>
<h2 class="govuk-heading-m govuk-!-margin-top-9" data-cy="general-enquiries-heading">{{ GENERAL_ENQUIRIES.HEADING }}</h2>

<a class="govuk-link" href="{{ CONTENT_STRINGS.GENERAL_ENQUIRIES.EMAIL.VALUE }}" data-cy="general-enquiries-email-link">{{ CONTENT_STRINGS.GENERAL_ENQUIRIES.EMAIL.TEXT }}</a>
</p>
{% include "partials/contact-details.njk" %}

<p data-cy="general-enquiries-quote-reference-number">{{ CONTENT_STRINGS.QUOTE_REFERENCE_NUMBER }}</p>

<h2 class="govuk-heading-m govuk-!-margin-top-9" data-cy="application-enquiries-heading">{{ CONTENT_STRINGS.APPLICATION_ENQUIRES.HEADING }}</h2>
<h2 class="govuk-heading-m govuk-!-margin-top-9" data-cy="application-enquiries-heading">{{ APPLICATION_ENQUIRES.HEADING }}</h2>

<p class="govuk-body">
<span data-cy="application-enquiries-email-prefix">{{ CONTENT_STRINGS.APPLICATION_ENQUIRES.EMAIL.PREFIX }} </span>
<span data-cy="application-enquiries-email-prefix">{{ APPLICATION_ENQUIRES.CONTACT_DETAILS.UNDERWRITING_EMAIL.PREFIX }}: </span>

<a class="govuk-link" href="{{ CONTENT_STRINGS.APPLICATION_ENQUIRES.EMAIL.VALUE }}" data-cy="application-enquiries-email-link">{{ CONTENT_STRINGS.APPLICATION_ENQUIRES.EMAIL.TEXT }}</a>
<a class="govuk-link" href="{{ APPLICATION_ENQUIRES.CONTACT_DETAILS.UNDERWRITING_EMAIL.VALUE }}" data-cy="application-enquiries-email-link">{{ APPLICATION_ENQUIRES.CONTACT_DETAILS.UNDERWRITING_EMAIL.TEXT }}</a>
</p>

<p class="govuk-body" data-cy="application-enquiries-quote-reference-number">{{ CONTENT_STRINGS.QUOTE_REFERENCE_NUMBER }}</p>
</div>
</div>

Expand Down

0 comments on commit 7232698

Please sign in to comment.