Skip to content

Commit

Permalink
VAGOV-TEAM-97974: Add Statement of Truth to forms rendered by Form Re…
Browse files Browse the repository at this point in the history
…nderer (#33316)

Adds a "Statement of truth" to all forms rendered by the Form Renderer.
  • Loading branch information
derekhouck authored Dec 5, 2024
1 parent efeac22 commit affdab6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { render } from '@testing-library/react';
import * as digitalFormPatterns from '../../../utils/digitalFormPatterns';
import * as IntroductionPage from '../../../containers/IntroductionPage';
import { normalizedForm } from '../../../_config/formConfig';
import { createFormConfig, formatPages } from '../../../utils/formConfig';
import {
createFormConfig,
formatPages,
statementOfTruthBody,
} from '../../../utils/formConfig';

const [
yourPersonalInfo,
Expand Down Expand Up @@ -86,6 +90,13 @@ describe('createFormConfig', () => {
`resBurden: ${normalizedForm.ombInfo.resBurden}`,
);
});

it('includes a statement of truth', () => {
const statementOfTruth = formConfig.preSubmitInfo.statementOfTruth;

expect(statementOfTruth.body).to.eq(statementOfTruthBody);
expect(statementOfTruth.fullNamePath).to.eq('fullName');
});
});

describe('formatPages', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,33 @@ const formatChapters = chapters =>
{},
);

export const statementOfTruthBody =
'I confirm that the identifying information in this form is accurate and ' +
'has been represented correctly.';

/** @returns {FormConfig} */
export const createFormConfig = (form, options) => {
const { chapters, formId, ombInfo, title } = form;
const { rootUrl, trackingPrefix } = options;
const subTitle = `VA Form ${formId}`;

return {
preSubmitInfo: {
statementOfTruth: {
body: statementOfTruthBody,
messageAriaDescribedby: statementOfTruthBody,
fullNamePath: 'fullName',
},
},
rootUrl,
urlPrefix: '/',
trackingPrefix,
// eslint-disable-next-line no-console
submit: () => console.log(`Submitted ${subTitle}`),
introduction: props => <IntroductionPage {...props} ombInfo={ombInfo} />,
confirmation: ConfirmationPage,
formId,
saveInProgress: {},
trackingPrefix,
version: 0,
prefillEnabled: true,
savedFormMessages: {
Expand Down

0 comments on commit affdab6

Please sign in to comment.