Skip to content

Commit

Permalink
Merge branch '10339-story' into 10339-test
Browse files Browse the repository at this point in the history
  • Loading branch information
nechama-krigsman committed Aug 14, 2024
2 parents bde9001 + 545e93e commit a4f969a
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,32 @@ describe('File a petition - Step 6 Review & Submit Case', () => {
fillIrsNoticeInformation(VALID_FILE);
fillCaseProcedureInformation();
fillStinInformation(VALID_FILE);
cy.get('[data-testid="petition-preview-button"]').should(
'have.text',
'sample.pdf',
);
cy.get(`[data-testid="irs-notice-info-${0}"]`).within(() => {
cy.contains('IRS notice 1').should('exist');
cy.contains('Notice of Deficiency').should('exist');
cy.get('[data-testid="atp-preview-button"]').should(
'have.text',
'sample.pdf',
);
});
cy.get(`[data-testid="irs-notice-info-${1}"]`).should('not.exist');
});

it('should display IRS notice information for a disclosure case type', () => {
fillIrsNoticeInformation(VALID_FILE, 'Disclosure2');
fillCaseProcedureInformation();
fillStinInformation(VALID_FILE);
cy.get(`[data-testid="irs-notice-info-${0}"]`).within(() => {
cy.contains('IRS notice 1').should('exist');
cy.contains(
'Notice - We Are Going To Make Your Determination Letter Available for Public Inspection',
).should('exist');
cy.get('[data-testid="atp-preview-button"]').should(
'have.text',
'sample.pdf',
);
});
cy.get(`[data-testid="irs-notice-info-${1}"]`).should('not.exist');
});
it('should display IRS notice information for multiple IRS notices', () => {
fillMultipleIRSNotices(VALID_FILE);
Expand All @@ -47,6 +69,7 @@ describe('File a petition - Step 6 Review & Submit Case', () => {

cy.get(`[data-testid="irs-notice-info-${0}"]`).within(() => {
cy.contains('IRS notice 1').should('exist');
cy.contains('Notice of Deficiency').should('exist');
cy.contains('2024').should('exist');
cy.contains('05/02/24').should('exist');
cy.contains('Jackson, NJ').should('exist');
Expand All @@ -58,6 +81,9 @@ describe('File a petition - Step 6 Review & Submit Case', () => {

cy.get(`[data-testid="irs-notice-info-${1}"]`).within(() => {
cy.contains('IRS notice 2').should('exist');
cy.contains(
'Notice of Determination Concerning Collection Action',
).should('exist');
cy.contains('2023').should('exist');
cy.contains('05/02/23').should('exist');
cy.contains('New York, NY').should('exist');
Expand Down
12 changes: 1 addition & 11 deletions shared/src/business/useCases/generatePetitionPdfInteractor.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import {
CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE,
CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE,
} from '@shared/business/entities/EntityConstants';
import { CreateCaseIrsForm } from '@web-client/presenter/state';
import {
ROLE_PERMISSIONS,
isAuthorized,
} from '@shared/authorization/authorizationClientService';
import { UnauthorizedError } from '@web-api/errors/errors';
import { UnknownAuthUser } from '@shared/business/entities/authUser/AuthUser';
import { getCaseDescription } from '@shared/business/utilities/getCaseDescription';

export type IrsNotice = CreateCaseIrsForm & {
noticeIssuedDateFormatted: string;
Expand Down Expand Up @@ -136,10 +133,3 @@ export const generatePetitionPdfInteractor = async (

return { fileId };
};

function getCaseDescription(hasIrsNotice: boolean, caseType: string) {
if (hasIrsNotice) {
return CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE[caseType];
}
return CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE[caseType];
}
107 changes: 107 additions & 0 deletions shared/src/business/utilities/getCaseDescription.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import { getCaseDescription } from '@shared/business/utilities/getCaseDescription';

const caseTypesWithIrsNotice = [
{
description: 'Notice of Deficiency',
type: 'Deficiency',
},
{
description: 'Notice of Determination Concerning Collection Action',
type: 'CDP (Lien/Levy)',
},
{
description: 'Other',
type: 'Other',
},
{
description: 'Adjustment of Partnership Items Code Section 6228',
type: 'Partnership (Section 6228)',
},
{
description:
'Notice - We Are Going To Make Your Determination Letter Available for Public Inspection',
type: 'Disclosure2',
},
{
description:
'Notice of Certification of Your Seriously Delinquent Federal Tax Debt to the Department of State',
type: 'Passport',
},
{
description:
'Notice of Determination Concerning Relief From Joint and Several Liability Under Section 6015',
type: 'Innocent Spouse',
},
{
description: 'Notice of Determination of Worker Classification',
type: 'Worker Classification',
},
{
description:
'Notice of Determination Under Section 7623 Concerning Whistleblower Action',
type: 'Whistleblower',
},
{
description:
'Notice of Final Determination for Full or Partial Disallowance of Interest Abatement Claim',
type: 'Interest Abatement',
},
{
description: 'Notice of Intention to Disclose',
type: 'Disclosure1',
},
{
description: 'Partnership Action Under BBA Section 1101',
type: 'Partnership (BBA Section 1101)',
},
{
description: 'Readjustment of Partnership Items Code Section 6226',
type: 'Partnership (Section 6226)',
},
];

const caseTypesWithoutIrsNotice = [
{ description: 'Deficiency', type: 'Deficiency' },
{ description: 'Collection (Lien/Levy)', type: 'CDP (Lien/Levy)' },
{ description: 'Passport', type: 'Passport' },
{ description: 'Innocent Spouse', type: 'Innocent Spouse' },
{ description: 'Whistleblower', type: 'Whistleblower' },
{ description: 'Worker Classification', type: 'Worker Classification' },
{
description: 'Declaratory Judgment (Retirement Plan)',
type: 'Declaratory Judgment (Retirement Plan)',
},
{
description: 'Declaratory Judgment (Exempt Organization)',
type: 'Declaratory Judgment (Exempt Organization)',
},
{ description: 'Disclosure', type: 'Disclosure' },
{
description:
'Interest Abatement - Failure of IRS to Make Final Determination Within 180 Days After Claim for Abatement',
type: 'Interest Abatement',
},
{ description: 'Other', type: 'Other' },
];

describe('getCaseDescription', () => {
describe('With IRS notices', () => {
const hasIrsNotice = true;
caseTypesWithIrsNotice.forEach(caseType => {
it(`should return case description for ${caseType.type}`, () => {
const caseDescription = getCaseDescription(hasIrsNotice, caseType.type);
expect(caseDescription).toEqual(caseType.description);
});
});
});

describe('Without IRS notices', () => {
const hasIrsNotice = false;
caseTypesWithoutIrsNotice.forEach(caseType => {
it(`should return case description for ${caseType.type}`, () => {
const caseDescription = getCaseDescription(hasIrsNotice, caseType.type);
expect(caseDescription).toEqual(caseType.description);
});
});
});
});
14 changes: 14 additions & 0 deletions shared/src/business/utilities/getCaseDescription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE,
CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE,
} from '../entities/EntityConstants';

export const getCaseDescription = (
hasIrsNotice: boolean,
originalCaseType: string,
) => {
if (hasIrsNotice) {
return CASE_TYPE_DESCRIPTIONS_WITH_IRS_NOTICE[originalCaseType];
}
return CASE_TYPE_DESCRIPTIONS_WITHOUT_IRS_NOTICE[originalCaseType];
};
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ export const Petition = ({
{contactPrimary.countryType === COUNTRY_TYPES.INTERNATIONAL && (
<div>{contactPrimary.country}</div>
)}
<div>{contactPrimary.phone}</div>
<div>
<b>Phone: </b>
{contactPrimary.phone}
</div>
{contactPrimary.placeOfLegalResidence && (
<div>
{BUSINESS_TYPE_VALUES.includes(partyType) ? (
Expand Down Expand Up @@ -240,6 +243,7 @@ export const Petition = ({
<div>{contactSecondary.country}</div>
)}
<div>
<b>Phone: </b>
{contactSecondary.phone
? contactSecondary.phone
: 'Phone number not provided'}
Expand Down
5 changes: 5 additions & 0 deletions web-client/src/views/CaseDetail/AddressDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const AddressDisplay = connect<
nameOverride?: string;
noMargin?: boolean;
showEmail?: boolean;
showPhoneLabel?: boolean;
showSealAddressLink?: boolean;
},
typeof addessDisplayDeps
Expand All @@ -33,6 +34,7 @@ export const AddressDisplay = connect<
noMargin,
openSealAddressModalSequence,
showEmail,
showPhoneLabel,
showSealAddressLink,
}) {
return (
Expand Down Expand Up @@ -95,6 +97,7 @@ export const AddressDisplay = connect<
noMargin={noMargin}
openSealAddressModalSequence={openSealAddressModalSequence}
showEmail={showEmail}
showPhoneLabel={showPhoneLabel}
showSealAddressLink={showSealAddressLink}
/>
)}
Expand All @@ -112,6 +115,7 @@ function ContactDetails({
noMargin,
openSealAddressModalSequence,
showEmail,
showPhoneLabel,
showSealAddressLink,
}) {
return (
Expand Down Expand Up @@ -144,6 +148,7 @@ function ContactDetails({
)}
data-testid="contact-info-phone-number"
>
{showPhoneLabel && <span className="text-semibold">Phone: </span>}
{contact.phone}
</span>
)}
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/PetitionWelcomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const PetitionWelcomePage = ({
<h2 data-testid="petition-welcome-text">Welcome to DAWSON!</h2>
<div className="petitioner-flow-text">
{`DAWSON (Docket Access Within a Secure Online Network) is the U.S. Tax
Court's electronic filing and case management system. The Court encourages all petitioners to file documents electronically.`}
Court's electronic filing and case management system.`}
</div>
<div className="petitioner-flow-text">DAWSON allows you to:</div>
<div className="petitioner-flow-text">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function CounselInformation({ userInfo }) {
<address aria-labelledby="filing-contact-primary">
<AddressDisplay
displayFirmNameOnNewLine
noMargin
showEmail
contact={{
...userInfo.contact,
Expand Down
13 changes: 11 additions & 2 deletions web-client/src/views/StartCaseUpdated/IRSNoticeInformation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button } from '@web-client/ustc-ui/Button/Button';
import { CardHeader } from './CardHeader';
import { getCaseDescription } from '@shared/business/utilities/getCaseDescription';
import React from 'react';
import classNames from 'classnames';

Expand All @@ -16,7 +17,10 @@ export function IRSNoticeInformation({ petitionFormatted }) {
Type of notice/case
</div>
<div className="margin-bottom-2px">
{petitionFormatted.caseType}
{getCaseDescription(
petitionFormatted.hasIrsNotice,
petitionFormatted.originalCaseType,
)}
</div>
</div>
</div>
Expand All @@ -37,7 +41,12 @@ export function IRSNoticeInformation({ petitionFormatted }) {
<div className="margin-bottom-1 semi-bold">
IRS notice {index + 1}
</div>
<div className="margin-bottom-2px">{irsNotice.caseType}</div>
<div className="margin-bottom-2px">
{getCaseDescription(
petitionFormatted.hasIrsNotice,
irsNotice.originalCaseType,
)}
</div>
{irsNotice.taxYear && (
<div className="margin-bottom-2px">{irsNotice.taxYear}</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function PetitionerInformation({ isPetitioner, petitionFormatted }) {
<address aria-labelledby="filing-contact-primary">
<AddressDisplay
noMargin
showPhoneLabel
contact={petitionFormatted.contactPrimary}
/>
{petitionFormatted.contactPrimary.placeOfLegalResidence && (
Expand Down Expand Up @@ -111,6 +112,7 @@ export function PetitionerInformation({ isPetitioner, petitionFormatted }) {
<address aria-labelledby="filing-contact-secondary">
<AddressDisplay
noMargin
showPhoneLabel
contact={{
...petitionFormatted.contactSecondary,
email:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const UpdatedFilePetitionStep3 = connect(
<WarningNotificationComponent
alertWarning={{
message:
'Ensure that personal information (such as Social Security Numbers, Taxpayer Identification Numbers, Employer Identification Numbers) has been removed or blocked out (redacted) of every form except the Statement of Taxpayer Identification Number.',
'Ensure that personal information (such as Social Security Numbers, Taxpayer Identification Numbers, Employer Identification Numbers) has been removed or blocked out (redacted) from every form except the Statement of Taxpayer Identification Number.',
}}
dismissible={false}
scrollToTop={false}
Expand Down

0 comments on commit a4f969a

Please sign in to comment.