Skip to content

Commit

Permalink
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 5512…
Browse files Browse the repository at this point in the history
…-test
  • Loading branch information
nechama-krigsman committed Jul 19, 2024
2 parents a196a5b + 09e8b82 commit c044d3a
Show file tree
Hide file tree
Showing 151 changed files with 6,115 additions and 1,146 deletions.
10 changes: 10 additions & 0 deletions cypress/helpers/authentication/login-as-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ export function loginAsAdmissionsClerk(
cy.get('[data-testid="inbox-tab-content"]').should('exist');
}

export function loginAsDojPractitioner(
dojPractitionerUser:
| 'dojPractitioner1'
| 'dojPractitioner2'
| 'dojPractitioner3' = 'dojPractitioner1',
) {
cy.login(dojPractitionerUser);
cy.get('[data-testid="search-for-a-case-card"]').should('exist');
}

export function loginAsPrivatePractitioner(
practitionerUser:
| 'privatePractitioner1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export function updateCaseStatus(status: string, judge: string) {
export function updateCaseStatus(status: string, judge?: string) {
cy.get('[data-testid="tab-case-information"]').click();
cy.get('[data-testid="menu-edit-case-context-button"]').click();
cy.get('[data-testid="case-status-select"]').select(status);
cy.get('[data-testid="associated-judge-select"]').select(judge);
if (judge) cy.get('[data-testid="associated-judge-select"]').select(judge);
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="success-alert"]').should('be.visible');
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ function petitionerCreatesElectronicCaseOld(primaryFilerName = 'John') {
}

export function petitionerCreatesElectronicCaseForBusiness() {
return cy
.task('getFeatureFlagValue', { flag: 'updated-petition-flow' })
.then(updatedFlow => {
if (updatedFlow) {
return petitionerCreatesElectronicCaseForBusinessUpdated();
} else {
return petitionerCreatesElectronicCaseForBusinessOld();
}
});
}

export function petitionerCreatesElectronicCaseForBusinessOld() {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();
uploadFile('stin-file');
Expand Down Expand Up @@ -135,6 +147,49 @@ export function petitionerCreatesElectronicCaseForBusiness() {
});
}

export function petitionerCreatesElectronicCaseForBusinessUpdated() {
cy.get('[data-testid="file-a-petition"]').click();
cy.get('[data-testid="go-to-step-1"]').click();
cy.get('[data-testid="filing-type-2"]').click();
cy.get('#is-business-type-0').click();
cy.get('[data-testid="contact-primary-name"]').type('awd');
cy.get('[data-testid="contactPrimary.address1"]').type('awd');
cy.get('[data-testid="contactPrimary.city"]').type('awd');
cy.get('[data-testid="contactPrimary.state"]').select('AK');
cy.get('[data-testid="contactPrimary.postalCode"]').type('12312');
cy.get('[data-testid="contact-primary-phone"]').type('awd');
uploadFile('corporate-disclosure-file');

cy.get('[data-testid="step-1-next-button"]').click();
cy.get('[data-testid="petition-reason--1"]').type('aws');
cy.get('[data-testid="petition-fact--1"]').type('aws');
cy.get('[data-testid="step-2-next-button"]').click();

cy.get('[data-testid="irs-notice-Yes"]').click();
cy.get('[data-testid="irs-notice-upload-0"]').click();
uploadFile('irs-notice-upload-0');
cy.get('[data-testid="case-type-select"]').select('Deficiency');
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="preferred-trial-city"]').select('Birmingham, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

cy.get('[data-testid="stin-file"]').click();
uploadFile('stin-file');
cy.get('[data-testid="step-5-next-button"]').click();

cy.get('[data-testid="step-6-next-button"]').click();

return cy
.get('[data-testid="case-link-docket-number"]')
.invoke('text')
.then(docketNumberWithSuffix => {
cy.get('[data-testid="case-link"]').click();
return cy.wrap<string>(docketNumberWithSuffix);
});
}

export function privatePractitionerCreatesElectronicCaseForBusiness() {
cy.get('[data-testid="file-a-petition"]').click();
uploadFile('stin-file');
Expand Down
42 changes: 42 additions & 0 deletions cypress/local-only/support/statusReportOrderResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
FORMATS,
formatNow,
} from '../../../shared/src/business/utilities/DateHandler';

export const docketNumber = '107-19';
export const leadCaseDocketNumber = '102-67';
export const statusReportDocketEntryId = '178af2d2-fab1-445a-a729-d3da63517a0a';
export const messages = {
statusReport: {
messageId: '73d4365b-8b3a-4b01-9ca3-7087f7a6d4b5',
name: 'Status Report',
},
testOrderResponseSigned: {
messageId: '32484c7f-4606-49fc-89f1-27ba1d5596be',
name: 'Test Order Response (Signed)',
},
testOrderResponseUnsigned: {
messageId: '34483b5b-29de-4ad4-8caa-59f71ad6d906',
name: 'Test Order Response (Unsigned)',
},
};
export const expectedPdfLines = [
'On June 28, 2024, a status report was filed in this case (Index no. 5). For cause, it is',
`ORDERED that the parties shall file a further status report by ${formatNow(FORMATS.MONTH_DAY_YEAR)}. It is further`,
'ORDERED that this case is stricken from the trial session. It is further',
'ORDERED that jurisdiction is retained by the undersigned. It is further',
'ORDERED that Here is my additional order text.',
];
export const selectAllOptionsInForm = ({
orderName,
}: {
orderName: string;
}) => {
cy.get('#order-type-status-report').check({ force: true });
cy.get('#status-report-due-date-picker').type(formatNow(FORMATS.MMDDYYYY));
cy.get('#stricken-from-trial-sessions').check({ force: true });
cy.get('#jurisdiction-retained').check({ force: true });
cy.get('#additional-order-text').type('Here is my additional order text.');
cy.get('#docket-entry-description').clear();
cy.get('#docket-entry-description').type(orderName);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { checkA11y } from '../../../support/generalCommands/checkA11y';
import { loginAsColvin } from '../../../../helpers/authentication/login-as-helpers';

describe('Status Report Order Response - Judge Accessibility', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

it('should be free of a11y issues', () => {
loginAsColvin();
cy.visit(
'/case-detail/102-67/documents/7be2dea1-4428-4917-a66d-0d474e57ee02/order-response-create?statusReportFilingDate=2024-06-28&statusReportIndex=1',
);
cy.get('[data-testid="save-draft-button"]').should('exist');

checkA11y();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { externalUserSearchesDocketNumber } from '../../../../../../helpers/advancedSearch/external-user-searches-docket-number';
import { goToCase } from '../../../../../../helpers/caseDetail/go-to-case';
import {
loginAsDocketClerk1,
loginAsDojPractitioner,
loginAsPetitioner,
loginAsPrivatePractitioner,
} from '../../../../../../helpers/authentication/login-as-helpers';
import { petitionerCreatesElectronicCaseWithDeceasedSpouse } from '../../../../../../helpers/fileAPetition/petitioner-creates-electronic-case';
import { petitionsClerkServesPetition } from '../../../../../../helpers/documentQC/petitionsclerk-serves-petition';
import { petitionsclerkAddsRespondentToCase } from '../../../../../../helpers/caseDetail/caseInformation/petitionsclerk-adds-respondent-to-case';
import { selectTypeaheadInput } from '../../../../../../helpers/components/typeAhead/select-typeahead-input';
import { updateCaseStatus } from '../../../../../../helpers/caseDetail/caseInformation/update-case-status';

describe('DOJ Practitioners - Represent A Party', () => {
before(() => {
cy.task('toggleFeatureFlag', {
flag: 'updated-petition-flow',
flagValue: false,
});

cy.reload(true);
});

after(() => {
cy.task('toggleFeatureFlag', {
flag: 'updated-petition-flow',
flagValue: true,
});
});

it('should only display the "Represent A Party" button when the case is "On Appeal"', () => {
const BAR_NUMBER = 'WN7777';
const primaryFilerName = 'John';
const secondaryFilerName = 'Sally';

loginAsPetitioner();
petitionerCreatesElectronicCaseWithDeceasedSpouse(
primaryFilerName,
secondaryFilerName,
).then(docketNumber => {
petitionsClerkServesPetition(docketNumber);
petitionsclerkAddsRespondentToCase(docketNumber, BAR_NUMBER);

loginAsPrivatePractitioner();
externalUserSearchesDocketNumber(docketNumber);

cy.get('[data-testid="request-represent-a-party-button"]').click();

selectTypeaheadInput('document-type', 'Entry of Appearance');

cy.get(`[data-testid="filer-${primaryFilerName}, Petitioner"]`).click();
cy.get(`[data-testid="filer-${secondaryFilerName}, Petitioner"]`).click();

cy.get('[data-testid="auto-generation"]').should('exist');
cy.get('[data-testid="request-access-submit-document"]').click();

cy.get('[data-testid="entry-of-appearance-pdf-preview"]').should('exist');
cy.get('[data-testid="submit-represent-a-party-button"]').click();

cy.get('[data-testid="document-download-link-EA"]').should(
'contain.text',
`Entry of Appearance for Petrs. ${primaryFilerName} & ${secondaryFilerName}`,
);

loginAsDojPractitioner();
externalUserSearchesDocketNumber(docketNumber);

cy.get('[data-testid="request-represent-a-party-button"]').should(
'not.exist',
);

loginAsDocketClerk1();
goToCase(docketNumber);
updateCaseStatus('On Appeal');

loginAsDojPractitioner();
externalUserSearchesDocketNumber(docketNumber);

cy.get('[data-testid="request-represent-a-party-button"]').should(
'exist',
);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,24 @@ describe('File a Petition', () => {

it('reviews information before filing', () => {
cy.get('button#submit-case').click();

// check pdf preview for desktop
cy.get('button#petition-preview-button').click();
cy.get('dialog.modal-screen').should('exist');
cy.get('button#close-modal-button').click();

// check pdf preview for mobile
cy.viewport('iphone-6+');
cy.window().then(win => {
// Stub the window.open in the context of the window
cy.stub(win, 'open').as('windowOpen');
});
cy.get('button#petition-preview-button').click();
cy.get('@windowOpen').should(
'be.calledWithMatch',
new RegExp('^blob:', 'm'),
'_blank',
);
});

it('submits forms and redirects to the file petition success page', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {
docketNumber,
messages,
statusReportDocketEntryId,
} from '../../../support/statusReportOrderResponse';
import { loginAsDocketClerk } from '../../../../helpers/authentication/login-as-helpers';

describe('check permissions for status report order response', () => {
beforeEach(() => {
loginAsDocketClerk();
});

it('docket clerk should not be able to create status report order response', () => {
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-document-view').click();
cy.contains('Status Report').click();

cy.get('[data-testid="order-response-button"]').should('not.exist');
});

it('should not be able to edit a status report order response in the status report order response form', () => {
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-drafts').click();
cy.contains('button', messages.testOrderResponseUnsigned.name).click();
cy.get('#draft-edit-button-not-signed').click();

cy.get('[data-testid="save-order-button"]').should('exist');
});

it('docket clerk should not be able to view status report order response route', () => {
[
`/case-detail/${docketNumber}/documents/${statusReportDocketEntryId}/order-response-create?statusReportFilingDate=2024-06-28&statusReportIndex=5`,
`/case-detail/${docketNumber}/documents/${statusReportDocketEntryId}/order-response-edit`,
`/messages/${docketNumber}/message-detail/${messages.statusReport.messageId}/${statusReportDocketEntryId}/order-response-create?statusReportFilingDate=2024-06-28&statusReportIndex=5`,
`/messages/${docketNumber}/message-detail/${messages.statusReport.messageId}/${statusReportDocketEntryId}/order-response-create`,
].forEach((route: string) => {
cy.visit(route);
cy.contains('Error 404').should('exist');
});
});
});
Loading

0 comments on commit c044d3a

Please sign in to comment.