Skip to content

Commit

Permalink
Updated name and references (#11098)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
AShukla-GSA authored Aug 19, 2024
1 parent c3225b4 commit 8632b33
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -53,7 +53,7 @@ function DocumentCaptureReviewIssues({
{isSelfieCaptureEnabled && (
<DocumentCaptureSubheaderOne isSelfieCaptureEnabled={isSelfieCaptureEnabled} />
)}
<UnknownError
<GeneralError
unknownFieldErrors={unknownFieldErrors}
isFailedDocType={isFailedDocType}
isFailedSelfie={isFailedSelfie}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FormStepError } from '@18f/identity-form-steps';
import type { I18n } from '@18f/identity-i18n';
import Warning from './warning';
import DocumentCaptureTroubleshootingOptions from './document-capture-troubleshooting-options';
import UnknownError from './unknown-error';
import GeneralError from './general-error';
import { InPersonContext } from '../context';
import AnalyticsContext from '../context/analytics';
import SelfieCaptureContext from '../context/selfie-capture';
Expand Down Expand Up @@ -124,7 +124,7 @@ function DocumentCaptureWarning({
>
<div ref={subheadingRef}>{!!subheading && subheading}</div>
<div ref={errorMessageDisplayedRef}>
<UnknownError
<GeneralError
unknownFieldErrors={unknownFieldErrors}
isFailedDocType={isFailedDocType}
isFailedSelfie={isFailedSelfie}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Link } from '@18f/identity-components';
import formatHTML from '@18f/identity-react-i18n/format-html';
import MarketingSiteContext from '../context/marketing-site';

interface UnknownErrorProps extends ComponentProps<'p'> {
interface GeneralErrorProps extends ComponentProps<'p'> {
unknownFieldErrors: FormStepError<{ front: string; back: string }>[];
isFailedDocType: boolean;
isFailedSelfie: boolean;
Expand Down Expand Up @@ -40,15 +40,15 @@ function getError({ unknownFieldErrors }: GetErrorArguments) {
return err;
}

function UnknownError({
function GeneralError({
unknownFieldErrors = [],
isFailedDocType = false,
isFailedSelfie = false,
isFailedSelfieLivenessOrQuality = false,
altFailedDocTypeMsg = null,
altIsFailedSelfieDontIncludeAttempts = false,
hasDismissed,
}: UnknownErrorProps) {
}: GeneralErrorProps) {
const { t } = useI18n();
const { getHelpCenterURL } = useContext(MarketingSiteContext);
const helpCenterLink = getHelpCenterURL({
Expand Down Expand Up @@ -107,4 +107,4 @@ function UnknownError({
return <p />;
}

export default UnknownError;
export default GeneralError;
2 changes: 1 addition & 1 deletion scripts/enforce-typescript-files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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(
<UnknownError unknownFieldErrors={[]} isFailedDocType={false} />,
<GeneralError unknownFieldErrors={[]} isFailedDocType={false} />,
);
expect(container.querySelector('p')).to.be.ok();
});

context('hasDismissed is true', () => {
it('renders error message with errors and a help center link', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -36,7 +36,7 @@ describe('UnknownError', () => {
context('hasDismissed is false', () => {
it('renders error message with errors but no link', () => {
const { container, queryByRole } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -62,7 +62,7 @@ describe('UnknownError', () => {
context('there is a doc type failure', () => {
it('renders error message with errors and is a doc type failure', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -78,7 +78,7 @@ describe('UnknownError', () => {

it('renders alternative error message with errors and is a doc type failure', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -97,7 +97,7 @@ describe('UnknownError', () => {
context('there is a selfie quality/liveness failure', () => {
it('renders error message with errors', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -112,7 +112,7 @@ describe('UnknownError', () => {

it('renders alternative error message without retry information', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -130,7 +130,7 @@ describe('UnknownError', () => {
context('there is a selfie facematch failure', () => {
it('renders error message with errors', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand All @@ -145,7 +145,7 @@ describe('UnknownError', () => {

it('renders alternative error message without retry information', () => {
const { container } = render(
<UnknownError
<GeneralError
unknownFieldErrors={[
{
field: 'general',
Expand Down

0 comments on commit 8632b33

Please sign in to comment.