Skip to content

Commit

Permalink
Merge branch 'main' into 1013-institution_profile-language_and_error
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia authored Oct 31, 2024
2 parents ba68692 + 535bda6 commit 1a0537d
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 48 deletions.
15 changes: 9 additions & 6 deletions e2e/fixtures/testFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type SBLPlaywrightTest = TestType<
navigateToReviewWarningsAfterOnlyWarningsUpload: Page;
navigateToSyntaxErrorsAfterSyntaxErrorsUpload: Page;
navigateToLogicErrorsAfterLogicErrorsUpload: Page;
navigateToProvidePointOfContact: Page;
navigateToProvideFilingDetails: Page;
navigateToSignAndSubmit: Page;
},
PlaywrightWorkerArgs & PlaywrightWorkerOptions
Expand All @@ -51,7 +51,7 @@ export const test = baseTest.extend<{
navigateToReviewWarningsAfterOnlyWarningsUpload: Page;
navigateToSyntaxErrorsAfterSyntaxErrorsUpload: Page;
navigateToLogicErrorsAfterLogicErrorsUpload: Page;
navigateToProvidePointOfContact: Page;
navigateToProvideFilingDetails: Page;
navigateToSignAndSubmit: Page;
}>({
isNonAssociatedUser: [false, { option: true }], // Default is 'false'
Expand Down Expand Up @@ -317,7 +317,7 @@ export const test = baseTest.extend<{
});
},

navigateToProvidePointOfContact: async (
navigateToProvideFilingDetails: async (
{ page, navigateToReviewWarningsAfterOnlyWarningsUpload },
use,
) => {
Expand All @@ -331,12 +331,15 @@ export const test = baseTest.extend<{
},

navigateToSignAndSubmit: async (
{ page, navigateToProvidePointOfContact },
{ page, navigateToProvideFilingDetails },
use,
) => {
navigateToProvidePointOfContact;
navigateToProvideFilingDetails;
await test.step('Provide filing details: navigate to Sign and submit', async () => {
await test.step('Provide filing details: fill out form', async () => {
await test.step('Provide filing details: fill out voluntary reporter', async () => {
await page.getByText('Voluntary reporter', { exact: true }).click();
});
await test.step('Provide filing details: fill out contact', async () => {
await page.getByLabel('First name').fill(pointOfContactJson.first_name);
await page.getByLabel('Last name').fill(pointOfContactJson.last_name);
await page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { clickContinueNext } from '../../../utils/navigation.utils';

test('Point of Contact: Checking for form errors based on user input', async ({
page,
navigateToProvidePointOfContact,
navigateToProvideFilingDetails,
}) => {
navigateToProvidePointOfContact;
navigateToProvideFilingDetails;

await test.step('Point of Contact: Check that the error header render when no input is filled', async () => {
await clickContinueNext(test, page);
Expand Down Expand Up @@ -50,9 +50,9 @@ test('Point of Contact: Checking for form errors based on user input', async ({

test('Point of Contact: Checking for unicode tolerance based on user input', async ({
page,
navigateToProvidePointOfContact,
navigateToProvideFilingDetails,
}) => {
navigateToProvidePointOfContact;
navigateToProvideFilingDetails;

await test.step('Point of Contact: Check that the error header render when no input is filled', async () => {
await clickContinueNext(test, page);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const testLabel = 'Filing step routing (Errors: Logic)';

const currentStepPath = '/error';

const userShouldNotAccess = ['/warnings', '/contact', '/submit'];
const userShouldNotAccess = ['/warnings', '/details', '/submit'];

const afterRedirectHeading = 'Resolve errors (syntax)';
const afterRedirectURL = /.*errors\/errors-syntax$/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const currentStepPath = '/error';
const userShouldNotAccess = [
'/errors/errors-logic',
'/warnings',
'/contact',
'/details',
'/submit',
];

Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/filing-app/filing-step-routing/noUpload.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const testLabel = 'Filing step routing (Upload)';

const currentStepPath = '/upload';

const userShouldNotAccess = ['/errors', '/warnings', '/contact', '/submit'];
const userShouldNotAccess = ['/errors', '/warnings', '/details', '/submit'];

const afterRedirectHeading = 'Upload file';
const afterRedirectURL = /.*\/upload$/;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { verifyRedirects } from './_shared';

const testLabel = 'Filing step routing (Point of Contact)';

const currentStepPath = '/contact';
const currentStepPath = '/details';

const userShouldNotAccess = ['/submit'];

const afterRedirectHeading = 'Provide filing details';
const afterRedirectURL = /.*\/contact$/;
const afterRedirectURL = /.*\/details$/;

test(testLabel, async ({ page, navigateToProvidePointOfContact }) => {
navigateToProvidePointOfContact;
test(testLabel, async ({ page, navigateToProvideFilingDetails }) => {
navigateToProvideFilingDetails;

await verifyRedirects({
testLabel,
Expand Down
2 changes: 1 addition & 1 deletion e2e/pages/filing-app/filing-step-routing/warnings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const testLabel = 'Filing step routing (Warnings)';

const currentStepPath = '/warnings';

const userShouldNotAccess = ['/contact', '/submit'];
const userShouldNotAccess = ['/details', '/submit'];

const afterRedirectHeading = 'Review warnings';
const afterRedirectURL = /.*\/warnings$/;
Expand Down
6 changes: 3 additions & 3 deletions e2e/pages/filing-app/formAlerts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ test('Form Alerts', async ({
await clickContinueNext(test, page);
});

// Point of contact page
await test.step('Point of contact page', async () => {
// Filing details page
await test.step('Filing details page', async () => {
await expect(page.locator('h1'), 'h1 is correct').toContainText(
'Provide filing details',
);
Expand All @@ -199,7 +199,7 @@ test('Form Alerts', async ({
page.locator('.m-notification__error'),
'Error alert is visible',
).toContainText(
'There was a problem updating your filing detailsEnter the first name of the point of contactEnter the last name of the point of contactEnter the phone number of the point of contactEnter the email address of the point of contactEnter the street address of the point of contactEnter the city of the point of contactSelect the state or territory of the point of contactEnter the ZIP code of the point of contact',
'There was a problem updating your filing detailsIndicate your voluntary reporter statusEnter the first name of the point of contactEnter the last name of the point of contactEnter the phone number of the point of contactEnter the email address of the point of contactEnter the street address of the point of contactEnter the city of the point of contactSelect the state or territory of the point of contactEnter the ZIP code of the point of contact',
);
});

Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Error500 from 'pages/Error/Error500';
import { NotFound404 } from 'pages/Error/NotFound404';
import FileSubmission from 'pages/Filing/FilingApp/FileSubmission';
import FilingComplete from 'pages/Filing/FilingApp/FilingComplete';
import FilingContact from 'pages/Filing/FilingApp/FilingContact';
import FilingDetails from 'pages/Filing/FilingApp/FilingDetails';
import FilingErrors from 'pages/Filing/FilingApp/FilingErrors';
import FilingOverview from 'pages/Filing/FilingApp/FilingOverviewPage';
import FilingProtectedRoute from 'pages/Filing/FilingApp/FilingProtectedRoute';
Expand Down Expand Up @@ -308,13 +308,13 @@ export default function App(): ReactElement {
}
/>
<Route
path='/filing/:year/:lei/contact'
path='/filing/:year/:lei/details'
element={
// @ts-expect-error Part of code cleanup for post-mvp see: https://github.com/cfpb/sbl-frontend/issues/717
<ProtectedRoute {...ProtectedRouteAuthorizations}>
<InstitutionProtectedRoute>
<FilingProtectedRoute>
<FilingContact />
<FilingDetails />
</FilingProtectedRoute>
</InstitutionProtectedRoute>
</ProtectedRoute>
Expand Down
12 changes: 6 additions & 6 deletions src/components/CommonLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ function UpdateInstitutionProfile({

UpdateInstitutionProfile.defaultProps = { isCallToAction: false };

interface UpdatePointOfContactProperties {
interface UpdateFilingDetailsProperties {
// eslint-disable-next-line react/require-default-props
label?: string;
// eslint-disable-next-line react/require-default-props, react/no-unused-prop-types
className?: string;
}

function UpdatePointOfContact({
function UpdateFilingDetails({
label = 'update your filing details',
className = 'font-normal',
}: UpdatePointOfContactProperties): ReactElement {
}: UpdateFilingDetailsProperties): ReactElement {
const { lei, year } = useParams();
const navigate = useNavigate();

const onClick = (): void => navigate(`/filing/${year}/${lei}/contact`);
const onClick = (): void => navigate(`/filing/${year}/${lei}/details`);
return (
<Button className={className} asLink onClick={onClick} label={label} />
);
Expand All @@ -65,7 +65,7 @@ function UpdatePointOfContact({
function UploadANewFile({
label = 'upload a new file',
className = 'font-normal',
}: UpdatePointOfContactProperties): ReactElement {
}: UpdateFilingDetailsProperties): ReactElement {
const { lei, year } = useParams();
const navigate = useNavigate();

Expand Down Expand Up @@ -136,6 +136,6 @@ export default {
GetAnLEI,
NIC,
UpdateInstitutionProfile,
UpdatePointOfContact,
UpdateFilingDetails,
UploadANewFile,
};
7 changes: 0 additions & 7 deletions src/pages/Filing/FilingApp/FilingContact.tsx

This file was deleted.

7 changes: 7 additions & 0 deletions src/pages/Filing/FilingApp/FilingDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import FilingDetailsComponent from 'pages/FilingDetails';

function FilingDetails(): JSX.Element {
return <FilingDetailsComponent />;
}

export default FilingDetails;
2 changes: 1 addition & 1 deletion src/pages/Filing/FilingApp/FilingSteps.helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const getFilingSteps = (
{
status: getContactStatus(currentSubmission, currentFiling),
label: 'Provide filing details',
isCurrent: isStepCurrent('/contact'),
isCurrent: isStepCurrent('/details'),
},
{
status: getSubmissionStatus(currentSubmission),
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Filing/FilingApp/FilingSubmit.helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getDescriptionForSignAndSubmitSection(
type?: string,
): JSX.Element {
const getLink = (): JSX.Element => {
if (type === 'poc') return <Links.UpdatePointOfContact />;
if (type === 'details') return <Links.UpdateFilingDetails />;
if (type === 'institution') return <Links.UpdateInstitutionProfile />;
if (type === 'file')
return (
Expand All @@ -34,7 +34,7 @@ export function getDescriptionForSignAndSubmitSection(
export function PointOfContactConfirm({
data,
heading = 'Confirm the point of contact for your filing',
description = getDescriptionForSignAndSubmitSection('poc'),
description = getDescriptionForSignAndSubmitSection('details'),
}: {
data: FilingType;
// eslint-disable-next-line react/require-default-props
Expand Down Expand Up @@ -128,7 +128,7 @@ export function FileInformation({
export function VoluntaryReportingStatus({
data,
heading = 'Confirm voluntary reporter status',
description = getDescriptionForSignAndSubmitSection('poc'),
description = getDescriptionForSignAndSubmitSection('details'),
}: {
data: FilingType;
// eslint-disable-next-line react/require-default-props
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Filing/FilingApp/FilingSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function FilingSubmit(): JSX.Element {
// const onClear = (): void => setCheckboxValues({ ...initState });
const onSubmit = (): void => setSubmitted(!submitted);
const onPreviousClick = (): void =>
navigate(`/filing/${year}/${lei}/contact`);
navigate(`/filing/${year}/${lei}/details`);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Filing/FilingApp/FilingWarnings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function FilingWarnings(): JSX.Element {
});

const onFormSubmit = async (): Promise<void> => {
const nextPage = `/filing/${year}/${lei}/contact`;
const nextPage = `/filing/${year}/${lei}/details`;

// Submission already accepted so no API call required, just navigate
if (isSubmissionAccepted(submission)) {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/Filing/FilingApp/InstitutionCard.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import type {
StatusCardType,
} from './InstitutionCard.types';

const POINT_OF_CONTACT = 'POINT_OF_CONTACT';
const FILING_DETAILS = 'FILING_DETAILS';
const SIGN_SUBMIT = 'SIGN_SUBMIT';

export const UI_STEPS = [
FilingStatusAsString.SUBMISSION_STARTED,
FilingStatusAsString.VALIDATION_WITH_ERRORS,
FilingStatusAsString.VALIDATION_WITH_WARNINGS,
POINT_OF_CONTACT,
FILING_DETAILS,
SIGN_SUBMIT,
];

Expand Down Expand Up @@ -108,13 +108,13 @@ export function deriveCardContent({
}

// Latest submission has no point of contact info populated
case POINT_OF_CONTACT: {
case FILING_DETAILS: {
title = 'Provide filing details';
description =
'You have completed the validation steps. Next, provide the contact information of a person that the Bureau or other regulators may contact with questions about your filing.';

mainButtonLabel = 'Continue filing';
mainButtonDestination = `/filing/${filingPeriod}/${lei}/contact`;
mainButtonDestination = `/filing/${filingPeriod}/${lei}/details`;

break;
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ export const FILING_PAGE_ORDER = [
'upload',
'errors',
'warnings',
'contact',
'details',
'submit',
];

0 comments on commit 1a0537d

Please sign in to comment.