Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10339: test - feedback #5331

Merged
merged 20 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5fffa2d
10339: remove "A minor or legally incompetent person" filing option f…
nechama-krigsman Sep 3, 2024
069ed64
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Sep 3, 2024
94dee40
10339: fix type errors; remove getCurrentUser;
nechama-krigsman Sep 4, 2024
410fc91
10339: add types;
nechama-krigsman Sep 4, 2024
7641de4
10339: update test around minor/incompetent option for private practi…
nechama-krigsman Sep 4, 2024
1728ea9
10339: text updates for private practitioner; ux feedback updates;
nechama-krigsman Sep 4, 2024
2b921f5
10339: update tests that were using getCurrentUser; update petition g…
nechama-krigsman Sep 4, 2024
626f5e8
10339: add email field for primary contact when filing as private pra…
nechama-krigsman Sep 4, 2024
b3f055c
10339: add user to tests;
nechama-krigsman Sep 4, 2024
cdad8f9
Merge branch 'staging' into 10339-story
nechama-krigsman Sep 4, 2024
35bc338
Merge branch 'staging' into 10365-bug
Mwindo Sep 4, 2024
60b7c75
10339: save petitioner email as paperPetitionEmail since its not use…
nechama-krigsman Sep 5, 2024
62ebe70
Merge pull request #5324 from flexion/10365-bug
jimlerza Sep 5, 2024
f299df9
10339: display email field on petitions clerk review screen for elect…
nechama-krigsman Sep 5, 2024
41f173c
10339: add test around email field; fix type error;
nechama-krigsman Sep 5, 2024
a66d891
10339: fix test;
nechama-krigsman Sep 5, 2024
78ad67f
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Sep 5, 2024
11bb9f9
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 1033…
nechama-krigsman Sep 5, 2024
39c1f7c
10339: fix missing focus state onother filing fee accordion;
nechama-krigsman Sep 5, 2024
ee9b29b
Merge branch '10339-story' into 10339-test-feedback
nechama-krigsman Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ describe('File a petition', () => {
"Petitioner's contact information: John Cruz 123 Test Drive Boulder, CO 12345 Phone: Test Phone",
);
expect(text).to.include(
"Counsel's contact information: Test Private Practitioner Bogus Barristers 234 Main St Apartment 4 Under the stairs Chicago, IL 61234 +1 (555) 555-5555 [email protected] Tax Court Bar No.: PT5432",
"Counsel's contact information: Test Private Practitioner Bogus Barristers 234 Main St Apartment 4 Under the stairs Chicago, IL 61234 Phone: +1 (555) 555-5555 Email: [email protected] Tax Court Bar No.: PT5432",
);
expect(text).not.to.include('Service Email');
expect(text).not.to.include(
'Register for electronic filing and service',
);
},
);
});

// should not display Service Email
// should not display Register for electronic filing and service:
// should display counsel contact information
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
);
});

it('should not display email field', () => {
cy.get('[data-testid="filing-type-0"]').click();
cy.get('[data-testid="contact-primary-paper-petition-email"]').should(
'not.exist',
);
});
it('should display validation error messages to all required fields left empty', () => {
const ERROR_MESSAGES_DATA_TEST_ID = [
'primary-contact-name-error-message',
Expand Down Expand Up @@ -201,6 +207,12 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
'Petitioner’s full name',
);
});
it('should display email field', () => {
cy.get('[data-testid="filing-type-0"]').click();
cy.get('[data-testid="contact-primary-paper-petition-email"]').should(
'exist',
);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -687,21 +687,28 @@ describe('File a petition: Step 1 - Petitioner Information', () => {
});

describe('Practitioner', () => {
beforeEach(() => {
loginAsPrivatePractitioner();
cy.visit('/file-a-petition/new');
cy.get('[data-testid="step-indicator-current-step-1-icon"]');
cy.get('[data-testid="filing-type-3"').click();
});
describe('Other', () => {
describe('A minor or legally incompetent person', () => {
it('should display correct other type title', () => {
cy.get('[data-testid="other-type-radio-option-1"]').click();
cy.get('[data-testid="estate-type-legend"]').should(
'have.text',
'What is the petitioner’s role in filing for this minor or legally incompetent person?',
);
});
describe('Other Filing Options', () => {
it('should display other filing options', () => {
loginAsPrivatePractitioner();
cy.visit('/file-a-petition/new');
cy.get('[data-testid="filing-type-3"').click();

cy.get('[data-testid="other-type-radio-option-0"]').should(
'have.text',
'An estate or trust',
);
cy.get('[data-testid="other-type-radio-option-1"]').should(
'have.text',
'Donor',
);
cy.get('[data-testid="other-type-radio-option-2"]').should(
'have.text',
'Transferee',
);
cy.get('[data-testid="other-type-radio-option-3"]').should(
'have.text',
'Deceased Spouse',
);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BusinessContact } from './BusinessContact';
import { CONTACT_TYPES, PARTY_TYPES } from '../EntityConstants';
import { CONTACT_TYPES, FilingType, PARTY_TYPES } from '../EntityConstants';
import { ContactUpdated } from '@shared/business/entities/contacts/ContactUpdated';
import { DeceasedSpouseContact } from '@shared/business/entities/contacts/DeceasedSpouseContact';
import { OtherContact } from '@shared/business/entities/contacts/OtherContact';
Expand All @@ -15,7 +15,7 @@ export function ContactFactoryUpdated({
}: {
contactInfoPrimary: {};
contactInfoSecondary: {};
filingType: string;
filingType: FilingType;
partyType: string;
petitionType: string;
hasSpouseConsent: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface Contact {
address2?: string;
address3?: string;
city: string;
paperPetitionEmail?: string;
postalCode: string;
phone: string;
state: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ export const Petition = ({
<b>Phone: </b>
{contactPrimary.phone}
</div>
{!isPetitioner && (
<div>
<b>Email: </b>
{contactPrimary.paperPetitionEmail || 'Email not provided'}
</div>
)}
{contactPrimary.placeOfLegalResidence && (
<div>
{BUSINESS_TYPE_VALUES.includes(partyType) ? (
Expand Down Expand Up @@ -288,8 +294,14 @@ export const Petition = ({
{contactCounsel.city}, {contactCounsel.state}{' '}
{contactCounsel.postalCode}
</div>
<div>{contactCounsel.phone}</div>
<div>{contactCounsel.email}</div>
<div>
<b>Phone: </b>
{contactCounsel.phone}
</div>
<div>
<b>Email: </b>
{contactCounsel.email}
</div>

<div>
<b>Tax Court Bar No.: </b>
Expand Down
7 changes: 4 additions & 3 deletions web-api/src/business/useCases/createCaseInteractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ describe('createCaseInteractor', () => {
stinFile: new File([], 'test.pdf'),
stinFileSize: 1,
},
stinFileId: '96759830-8970-486f-916b-23439a8ebb70',
stinFileId: '413f62ce-7c8d-446e-aeda-14a2a625a611',
},
user,
);
Expand Down Expand Up @@ -398,7 +398,7 @@ describe('createCaseInteractor', () => {
stinFile: new File([], 'test.pdf'),
stinFileSize: 1,
},
stinFileId: '96759830-8970-486f-916b-23439a8ebb70',
stinFileId: '413f62ce-7c8d-446e-aeda-14a2a625a611',
},
user,
);
Expand Down Expand Up @@ -548,7 +548,7 @@ describe('createCaseInteractor', () => {
});
});

it('should set serviceIndicator to none for petitioner when case is created by a private petitioner', async () => {
it('should remove email and serviceIndicator for petitioner when case is created by a private petitioner', async () => {
user = new PrivatePractitioner({
barNumber: 'BN1234',
email: '[email protected]',
Expand Down Expand Up @@ -594,6 +594,7 @@ describe('createCaseInteractor', () => {

result.petitioners.forEach(p => {
expect(p.serviceIndicator).toBe(SERVICE_INDICATOR_TYPES.SI_NONE);
expect(p.email).toBeUndefined();
});
});
});
4 changes: 3 additions & 1 deletion web-api/src/business/useCases/createCaseInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export const createCaseInteractor = async (
);
}

// remove the email from contactPrimary since the practitioners array should have a service email
// remove the email from contactPrimary
// since the practitioners array should have a service email
// and paperPetitionEmail is used as email for the petitioner
delete petitionEntity.getContactPrimary().email;
delete petitionEntity.getContactPrimary().serviceIndicator;

Expand Down
57 changes: 47 additions & 10 deletions web-client/src/presenter/actions/formatPetitionAction.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
CASE_TYPES_MAP,
ROLES,
} from '@shared/business/entities/EntityConstants';
import { CASE_TYPES_MAP } from '@shared/business/entities/EntityConstants';
import { applicationContextForClient as applicationContext } from '@web-client/test/createClientTestApplicationContext';
import { formatPetitionAction } from '@web-client/presenter/actions/formatPetitionAction';
import { mockPetitionerUser } from '@shared/test/mockAuthUsers';
import {
mockPetitionerUser,
mockPrivatePractitionerUser,
} from '@shared/test/mockAuthUsers';
import { presenter } from '../presenter-mock';
import { runAction } from '@web-client/presenter/test.cerebral';

Expand Down Expand Up @@ -170,6 +170,7 @@ describe('formatPetitionAction', () => {
state: {
petitionFormatted: undefined,
user: {
...mockPrivatePractitionerUser,
barNumber: 'TEST_barNumber',
contact: {
address1: 'TEST_address1',
Expand All @@ -180,10 +181,7 @@ describe('formatPetitionAction', () => {
postalCode: 'TEST_postalCode',
state: 'TEST_state',
},
email: TEST_EMAIL,
firmName: 'TEST_firmName',
name: 'TEST_Name',
role: ROLES.privatePractitioner,
},
},
});
Expand All @@ -194,12 +192,51 @@ describe('formatPetitionAction', () => {
address3: 'TEST_address3',
barNumber: 'TEST_barNumber',
city: 'TEST_city',
email: 'TEST_EMAIL',
email: '[email protected]',
firmName: 'TEST_firmName',
name: 'TEST_Name',
name: 'Reginald Barclay',
phone: 'TEST_phone',
postalCode: 'TEST_postalCode',
state: 'TEST_state',
});
});

it('should set primary contact email to user email when the user is a petitioner', async () => {
const results = await runAction(formatPetitionAction, {
modules: {
presenter,
},
props: PROPS,
state: {
petitionFormatted: undefined,
user: mockPetitionerUser,
},
});

expect(results.state.petitionFormatted?.contactPrimary?.email).toEqual(
'[email protected]',
);
});

it('should not set primary contact email to user email when the user is a private practitioner', async () => {
const results = await runAction(formatPetitionAction, {
modules: {
presenter,
},
props: {
...PROPS,
createPetitionStep1Data: {
contactPrimary: { email: '[email protected]' },
},
},
state: {
petitionFormatted: undefined,
user: mockPrivatePractitionerUser,
},
});

expect(results.state.petitionFormatted?.contactPrimary?.email).toEqual(
'[email protected]',
);
});
});
1 change: 1 addition & 0 deletions web-client/src/presenter/actions/formatPetitionAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const formatPetitionAction = ({
const { contactPrimary, irsNotices } = petitionInfo;

const user = get(state.user);

contactPrimary.email = user.email;

const irsNoticesWithCaseTypes = irsNotices.map(irsNotice => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PETITION_TYPES } from '@shared/business/entities/EntityConstants';
import { applicationContextForClient as applicationContext } from '@web-client/test/createClientTestApplicationContext';
import { mockPetitionerUser } from '@shared/test/mockAuthUsers';
import { presenter } from '@web-client/presenter/presenter-mock';
import { runAction } from '@web-client/presenter/test.cerebral';
import { saveAndSubmitCaseAction } from '@web-client/presenter/actions/saveAndSubmitCaseAction';
Expand Down Expand Up @@ -68,6 +69,7 @@ describe('saveAndSubmitCaseAction', () => {
petitionFormatted: 'petitionFormattedData',
petitionType: PETITION_TYPES.userUploaded,
},
user: mockPetitionerUser,
},
});

Expand Down Expand Up @@ -150,6 +152,7 @@ describe('saveAndSubmitCaseAction', () => {
petitionFormatted: 'petitionFormattedData',
petitionType: PETITION_TYPES.autoGenerated,
},
user: mockPetitionerUser,
},
});

Expand Down Expand Up @@ -234,6 +237,7 @@ describe('saveAndSubmitCaseAction', () => {
petitionFormatted: 'petitionFormattedData',
petitionType: PETITION_TYPES.autoGenerated,
},
user: mockPetitionerUser,
},
});

Expand Down
10 changes: 7 additions & 3 deletions web-client/src/presenter/actions/saveAndSubmitCaseAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
FileUploadProgressType,
FileUploadProgressValueType,
PETITION_TYPES,
ROLES,
} from '@shared/business/entities/EntityConstants';
import { state } from '@web-client/presenter/app.cerebral';

Expand Down Expand Up @@ -82,11 +83,14 @@ export const saveAndSubmitCaseAction = async ({

await Promise.all(documentsThatNeedCoverSheet.map(addCoversheet));

const isPetitioner = user.role === ROLES.petitioner;
const successTitle = `${isPetitioner ? 'Your' : 'The'} case has been assigned docket number ${caseDetail.docketNumberWithSuffix || caseDetail.docketNumber}`;
const successMessage = `${isPetitioner ? 'Your' : 'The'} case has been created and ${isPetitioner ? 'your' : ''} documents sent to the U.S. Tax Court.`;

return path.success({
alertSuccess: {
message:
'Your case has been created and your documents sent to the U.S. Tax Court.',
title: `Your case has been assigned docket number ${caseDetail.docketNumberWithSuffix || caseDetail.docketNumber}`,
message: successMessage,
title: successTitle,
},
caseDetail,
});
Expand Down
Loading
Loading