From 8632b33196be29de14ddff326e03277e55061497 Mon Sep 17 00:00:00 2001 From: A Shukla Date: Mon, 19 Aug 2024 11:21:19 -0500 Subject: [PATCH] Updated name and references (#11098) * Updated name and refrences * Reverting changes on non front end compnenet * Renamed file resolving PR comment * changelog: internal, code format, change name of class and refrences * Reverting to Unknown error to resolve PR comment * Adding new line to pass lint --- .../document-capture-review-issues.tsx | 4 ++-- .../components/document-capture-warning.tsx | 4 ++-- .../{unknown-error.tsx => general-error.tsx} | 8 +++---- scripts/enforce-typescript-files.mjs | 2 +- ...-error-spec.jsx => general-error-spec.jsx} | 22 +++++++++---------- 5 files changed, 20 insertions(+), 20 deletions(-) rename app/javascript/packages/document-capture/components/{unknown-error.tsx => general-error.tsx} (96%) rename spec/javascript/packages/document-capture/components/{unknown-error-spec.jsx => general-error-spec.jsx} (93%) diff --git a/app/javascript/packages/document-capture/components/document-capture-review-issues.tsx b/app/javascript/packages/document-capture/components/document-capture-review-issues.tsx index 3ccbe0454cf..1b74567c6a8 100644 --- a/app/javascript/packages/document-capture/components/document-capture-review-issues.tsx +++ b/app/javascript/packages/document-capture/components/document-capture-review-issues.tsx @@ -4,7 +4,7 @@ import { FormStepsButton } from '@18f/identity-form-steps'; import { Cancel } from '@18f/identity-verify-flow'; import { useI18n, HtmlTextWithStrongNoWrap } from '@18f/identity-react-i18n'; import type { FormStepComponentProps } from '@18f/identity-form-steps'; -import UnknownError from './unknown-error'; +import GeneralError from './general-error'; import TipList from './tip-list'; import { SelfieCaptureContext } from '../context'; import { @@ -53,7 +53,7 @@ function DocumentCaptureReviewIssues({ {isSelfieCaptureEnabled && ( )} -
{!!subheading && subheading}
- { +interface GeneralErrorProps extends ComponentProps<'p'> { unknownFieldErrors: FormStepError<{ front: string; back: string }>[]; isFailedDocType: boolean; isFailedSelfie: boolean; @@ -40,7 +40,7 @@ function getError({ unknownFieldErrors }: GetErrorArguments) { return err; } -function UnknownError({ +function GeneralError({ unknownFieldErrors = [], isFailedDocType = false, isFailedSelfie = false, @@ -48,7 +48,7 @@ function UnknownError({ altFailedDocTypeMsg = null, altIsFailedSelfieDontIncludeAttempts = false, hasDismissed, -}: UnknownErrorProps) { +}: GeneralErrorProps) { const { t } = useI18n(); const { getHelpCenterURL } = useContext(MarketingSiteContext); const helpCenterLink = getHelpCenterURL({ @@ -107,4 +107,4 @@ function UnknownError({ return

; } -export default UnknownError; +export default GeneralError; diff --git a/scripts/enforce-typescript-files.mjs b/scripts/enforce-typescript-files.mjs index 6496502e94d..f77f6d396a0 100755 --- a/scripts/enforce-typescript-files.mjs +++ b/scripts/enforce-typescript-files.mjs @@ -55,7 +55,7 @@ const LEGACY_FILE_EXCEPTIONS = [ 'spec/javascript/packages/document-capture/components/submission-spec.jsx', 'spec/javascript/packages/document-capture/components/suspense-error-boundary-spec.jsx', 'spec/javascript/packages/document-capture/components/tip-list-spec.jsx', - 'spec/javascript/packages/document-capture/components/unknown-error-spec.jsx', + 'spec/javascript/packages/document-capture/components/general-error-spec.jsx', 'spec/javascript/packages/document-capture/components/warning-spec.jsx', 'spec/javascript/packages/document-capture/context/acuant-spec.jsx', 'spec/javascript/packages/document-capture/context/device-spec.jsx', diff --git a/spec/javascript/packages/document-capture/components/unknown-error-spec.jsx b/spec/javascript/packages/document-capture/components/general-error-spec.jsx similarity index 93% rename from spec/javascript/packages/document-capture/components/unknown-error-spec.jsx rename to spec/javascript/packages/document-capture/components/general-error-spec.jsx index 5da9baebea5..647442fef3b 100644 --- a/spec/javascript/packages/document-capture/components/unknown-error-spec.jsx +++ b/spec/javascript/packages/document-capture/components/general-error-spec.jsx @@ -1,13 +1,13 @@ -import UnknownError from '@18f/identity-document-capture/components/unknown-error'; +import GeneralError from '@18f/identity-document-capture/components/general-error'; import { toFormEntryError } from '@18f/identity-document-capture/services/upload'; import { within } from '@testing-library/dom'; import { render } from '../../../support/document-capture'; -describe('UnknownError', () => { +describe('GeneralError', () => { context('there is no doc type failure', () => { it('render an empty paragraph when no errors', () => { const { container } = render( - , + , ); expect(container.querySelector('p')).to.be.ok(); }); @@ -15,7 +15,7 @@ describe('UnknownError', () => { context('hasDismissed is true', () => { it('renders error message with errors and a help center link', () => { const { container } = render( - { context('hasDismissed is false', () => { it('renders error message with errors but no link', () => { const { container, queryByRole } = render( - { context('there is a doc type failure', () => { it('renders error message with errors and is a doc type failure', () => { const { container } = render( - { it('renders alternative error message with errors and is a doc type failure', () => { const { container } = render( - { context('there is a selfie quality/liveness failure', () => { it('renders error message with errors', () => { const { container } = render( - { it('renders alternative error message without retry information', () => { const { container } = render( - { context('there is a selfie facematch failure', () => { it('renders error message with errors', () => { const { container } = render( - { it('renders alternative error message without retry information', () => { const { container } = render( -