Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(EMS-3631): declaration - Use of declaration constant in controllers #2804

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions e2e-tests/content-strings/fields/insurance/declarations/index.js

This file was deleted.

1 change: 0 additions & 1 deletion e2e-tests/content-strings/fields/insurance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export * from './business';
export * from './export-contract';
export * from './policy';
export * from './your-buyer';
export * from './declarations';
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { SHARED } from '../shared';
import { LINKS } from '../../../../links';

export const ANTI_BRIBERY_CODE_OF_CONDUCT = {
...SHARED,
PAGE_TITLE:
'Do you have in place a code of conduct and written procedures of the type contemplated by Section(2) of the Bribery Act to discourage and prevent corrupt activity?',
VERSIONS: [
{
VERSION: 1,
...SHARED,
PAGE_TITLE:
'Do you have in place a code of conduct and written procedures of the type contemplated by Section(2) of the Bribery Act to discourage and prevent corrupt activity?',
HINT: {
INTRO: 'If no, your attention is drawn to',
LINK: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SHARED } from '../shared';

export const ANTI_BRIBERY_EXPORTING_WITH_CODE_OF_CONDUCT = {
...SHARED,
PAGE_TITLE: 'Will you use your anti-bribery code of conduct to win or carry out the exports you want to insure?',
VERSIONS: [
{
VERSION: 1,
...SHARED,
PAGE_TITLE: 'Will you use your anti-bribery code of conduct to win or carry out the exports you want to insure?',
},
],
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const ANTI_BRIBERY = {
...SHARED,
PAGE_TITLE: 'Anti-bribery and corruption',
VERSIONS: [
{
VERSION: 1,
...SHARED,
PAGE_TITLE: 'Anti-bribery and corruption',
LABEL: `${CONFIRM_READ_AND_AGREE} the anti-bribery and corruption declaration`,
OPTION: {
TEXT: `${HAVE_READ_AND_AGREED} the anti-bribery and corruption declaration`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const CONFIDENTIALITY = {
...SHARED,
PAGE_TITLE: 'Confidentiality',
VERSIONS: [
{
VERSION: 1,
...SHARED,
PAGE_TITLE: 'Confidentiality',
LABEL: `${CONFIRM_READ_AND_AGREE} the confidentiality declaration`,
OPTION: {
TEXT: `${HAVE_READ_AND_AGREED} the confidentiality declaration`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const CONFIRMATION_AND_ACKNOWLEDGEMENTS = {
...SHARED,
PAGE_TITLE: 'Confirmation and acknowledgements',
VERSIONS: [
{
VERSION: 1,
...SHARED,
PAGE_TITLE: 'Confirmation and acknowledgements',
LABEL: `${CONFIRM_READ_AND_AGREE} the confirmation and acknowledgements`,
OPTION: {
TEXT: `${HAVE_READ_AND_AGREED} the confirmation and acknowledgements`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance';

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY.VERSIONS[0];

const {
ROOT: INSURANCE_ROOT,
Expand All @@ -16,7 +16,7 @@ const {

const { expandable } = antiBriberyPage;

const { INTRO, TABLE } = CONTENT_STRINGS.VERSIONS[0].EXPANDABLE;
const { INTRO, TABLE } = CONTENT_STRINGS.EXPANDABLE;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { headingCaption, singleInputField } from '../../../../../../pages/shared
import { antiBriberyPage } from '../../../../../../pages/insurance/declarations';
import partials from '../../../../../../partials';
import { PAGES, ERROR_MESSAGES } from '../../../../../../content-strings';
import { DECLARATIONS_FIELDS as FIELDS } from '../../../../../../content-strings/fields/insurance/declarations';
import { FIELD_IDS } from '../../../../../../constants';
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance';

Expand All @@ -11,7 +10,7 @@ import flattenKeystoneDocument from '../../../../../../commands/flatten-keystone

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY.VERSIONS[0];

const {
ROOT: INSURANCE_ROOT,
Expand Down Expand Up @@ -125,7 +124,7 @@ context(
const { expandable } = antiBriberyPage;

it('should render summary text with collapsed conditional `details` content', () => {
cy.checkText(expandable.summary(), CONTENT_STRINGS.VERSIONS[0].EXPANDABLE.INTRO);
cy.checkText(expandable.summary(), CONTENT_STRINGS.EXPANDABLE.INTRO);

expandable.details().should('not.have.attr', 'open');
});
Expand All @@ -140,7 +139,7 @@ context(
});

it("renders `I've read and agree` legend and input", () => {
cy.checkText(field.legend(), FIELDS[FIELD_ID].LABEL);
cy.checkText(field.legend(), CONTENT_STRINGS.LABEL);

field.input().should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { headingCaption, yesRadio, noRadio } from '../../../../../../../pages/sh
import { codeOfConductPage } from '../../../../../../../pages/insurance/declarations';
import partials from '../../../../../../../partials';
import { PAGES, LINKS, ERROR_MESSAGES } from '../../../../../../../content-strings';
import { DECLARATIONS_FIELDS as FIELDS } from '../../../../../../../content-strings/fields/insurance/declarations';
import { FIELD_IDS, FIELD_VALUES } from '../../../../../../../constants';
import { INSURANCE_ROUTES } from '../../../../../../../constants/routes/insurance';

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY_CODE_OF_CONDUCT;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY_CODE_OF_CONDUCT.VERSIONS[0];

const {
ROOT: INSURANCE_ROOT,
Expand Down Expand Up @@ -71,9 +70,9 @@ context(
});

it('renders a hint', () => {
cy.checkText(codeOfConductPage.hint.intro(), FIELDS[FIELD_ID].HINT.INTRO);
cy.checkText(codeOfConductPage.hint.intro(), CONTENT_STRINGS.HINT.INTRO);

cy.checkLink(codeOfConductPage.hint.link(), LINKS.EXTERNAL.BRIBERY_ACT_2010_GUIDANCE, FIELDS[FIELD_ID].HINT.LINK.TEXT);
cy.checkLink(codeOfConductPage.hint.link(), LINKS.EXTERNAL.BRIBERY_ACT_2010_GUIDANCE, CONTENT_STRINGS.HINT.LINK.TEXT);
});

it('renders `yes` radio button', () => {
Expand Down Expand Up @@ -105,7 +104,7 @@ context(

codeOfConductPage.revealText().should('be.visible');

cy.checkText(codeOfConductPage.revealText(), FIELDS[FIELD_ID].ANSWER_YES_REVEAL.TEXT);
cy.checkText(codeOfConductPage.revealText(), CONTENT_STRINGS.ANSWER_YES_REVEAL.TEXT);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { INSURANCE_ROUTES } from '../../../../../../../constants/routes/insuranc

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY_EXPORTING_WITH_CODE_OF_CONDUCT;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.ANTI_BRIBERY_EXPORTING_WITH_CODE_OF_CONDUCT.VERSIONS[0];

const {
ROOT: INSURANCE_ROOT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ import { headingCaption, singleInputField } from '../../../../../../pages/shared
import { confidentialityPage } from '../../../../../../pages/insurance/declarations';
import partials from '../../../../../../partials';
import { PAGES, ERROR_MESSAGES } from '../../../../../../content-strings';
import { DECLARATIONS_FIELDS as FIELDS } from '../../../../../../content-strings/fields/insurance/declarations';
import { FIELD_IDS } from '../../../../../../constants';
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance';

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.CONFIDENTIALITY;

const [LATEST_VERSION] = CONTENT_STRINGS.VERSIONS;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.CONFIDENTIALITY.VERSIONS[0];

const {
ROOT: INSURANCE_ROOT,
Expand Down Expand Up @@ -77,12 +74,12 @@ context(
});

describe('latest confidentiality content', () => {
const listContent = LATEST_VERSION.LIST;
const listContent = CONTENT_STRINGS.LIST;

const { intro, level1, level2, level3 } = confidentialityPage.listItems;

it('renders an intro paragraph', () => {
cy.checkText(intro(), LATEST_VERSION.INTRO);
cy.checkText(intro(), CONTENT_STRINGS.INTRO);
});

it('renders level 1 list items', () => {
Expand Down Expand Up @@ -111,7 +108,7 @@ context(
});

it('renders a `confirm` legend and input', () => {
cy.checkText(field.legend(), FIELDS[FIELD_ID].LABEL);
cy.checkText(field.legend(), CONTENT_STRINGS.LABEL);

field.input().should('exist');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { headingCaption, singleInputField } from '../../../../../../pages/shared
import { confirmationAndAcknowledgementsPage } from '../../../../../../pages/insurance/declarations';
import partials from '../../../../../../partials';
import { PAGES, ERROR_MESSAGES } from '../../../../../../content-strings';
import { DECLARATIONS_FIELDS as FIELDS } from '../../../../../../content-strings/fields/insurance/declarations';
import { FIELD_IDS } from '../../../../../../constants';
import { INSURANCE_ROUTES } from '../../../../../../constants/routes/insurance';

Expand All @@ -11,7 +10,7 @@ import flattenKeystoneDocument from '../../../../../../commands/flatten-keystone

const { taskList } = partials.insurancePartials;

const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.CONFIRMATION_AND_ACKNOWLEDGEMENTS;
const CONTENT_STRINGS = PAGES.INSURANCE.DECLARATIONS.CONFIRMATION_AND_ACKNOWLEDGEMENTS.VERSIONS[0];

const {
APPLICATION_SUBMITTED,
Expand Down Expand Up @@ -110,7 +109,7 @@ context(
});

it("renders `I've read and agree` legend and input", () => {
cy.checkText(field.legend(), FIELDS[FIELD_ID].LABEL);
cy.checkText(field.legend(), CONTENT_STRINGS.LABEL);

field.input().should('exist');
});
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/ui/server/content-strings/fields/insurance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from './export-contract';
export * from './policy';
export * from './your-business';
export * from './your-buyer';
export * from './declarations';

export const REFERENCE_NUMBER = {
SUMMARY: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { SHARED } from '../shared';
import { LINKS } from '../../../../links';

export const ANTI_BRIBERY_CODE_OF_CONDUCT = {
...SHARED,
PAGE_TITLE:
'Do you have in place a code of conduct and written procedures of the type contemplated by Section(2) of the Bribery Act to discourage and prevent corrupt activity?',
VERSIONS: [
{
VERSION: '1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { SHARED } from '../shared';

export const ANTI_BRIBERY_EXPORTING_WITH_CODE_OF_CONDUCT = {
...SHARED,
PAGE_TITLE: 'Will you use your anti-bribery code of conduct to win or carry out the exports you want to insure?',
VERSIONS: [
{
VERSION: '1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const ANTI_BRIBERY = {
...SHARED,
PAGE_TITLE: 'Anti-bribery and corruption',
VERSIONS: [
{
VERSION: '1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const CONFIDENTIALITY = {
...SHARED,
PAGE_TITLE: 'Confidentiality',
VERSIONS: [
{
VERSION: '1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { SHARED, CONFIRM_READ_AND_AGREE, HAVE_READ_AND_AGREED } from '../shared';

export const CONFIRMATION_AND_ACKNOWLEDGEMENTS = {
...SHARED,
PAGE_TITLE: 'Confirmation and acknowledgements',
VERSIONS: [
{
VERSION: '1',
Expand Down
Loading
Loading