Skip to content

Commit

Permalink
Merge branch 'staging' into 10282-design-debt
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlerza authored Sep 11, 2024
2 parents bdace8b + b5c71f7 commit e7ac9b8
Show file tree
Hide file tree
Showing 92 changed files with 2,195 additions and 3,175 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
orbs:
git-shallow-clone: guitarrapc/[email protected]

efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.8
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.9

parameters:
run_build_and_deploy:
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module.exports = {
'no-underscore-dangle': 'off',
'promise/always-return': 'off',
'promise/catch-or-return': 'off',
'promise/no-nesting': 'off',
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: node-20.14.0-chrome-125.0.* is debian 12.5 (bookworm)

FROM cypress/browsers:node-20.16.0-chrome-127.0.6533.119-1-ff-129.0.1-edge-127.0.2651.98-1
FROM cypress/browsers:node-20.17.0-chrome-128.0.6613.119-1-ff-130.0-edge-128.0.2739.63-1

WORKDIR /home/app

Expand Down Expand Up @@ -37,7 +37,7 @@ RUN apt-get install -y build-essential
RUN apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.36.zip" -o "awscliv2.zip" && \
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.17.46.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
plugins: ['babel-plugin-cerebral', 'transform-html-import-require-to-string'],
plugins: ['babel-plugin-cerebral'],
presets: [
[
'@babel/preset-env',
Expand Down
30 changes: 26 additions & 4 deletions cypress/helpers/fileAPetition/create-and-serve-paper-petition.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
import { ProcedureType } from '../../../shared/src/business/entities/EntityConstants';
import { loginAsPetitionsClerk1 } from '../authentication/login-as-helpers';

export function createAndServePaperPetition(
options = { yearReceived: '2020' },
) {
{
procedureType = 'Regular',
trialLocation = 'Birmingham, Alabama',
yearReceived = '2020',
}: Partial<{
yearReceived: string;
procedureType: ProcedureType;
trialLocation: string;
}> = {
procedureType: 'Regular',
trialLocation: 'Birmingham, Alabama',
yearReceived: '2020',
},
): Cypress.Chainable<{
docketNumber: string;
documentsCreated: {
eventCode: string;
index: number;
servedTo: string;
}[];
name: string;
}> {
const name = 'rick james ' + Date.now();
loginAsPetitionsClerk1();
cy.get('[data-testid="inbox-tab-content"]').should('exist');
Expand All @@ -22,10 +43,11 @@ export function createAndServePaperPetition(
cy.get('[data-testid="phone"]').type('n/a');
cy.get('#tab-case-info > .button-text').click();
cy.get('#date-received-picker').clear();
cy.get('#date-received-picker').type(`01/02/${options.yearReceived}`);
cy.get('#date-received-picker').type(`01/02/${yearReceived}`);
cy.get('#mailing-date').clear();
cy.get('#mailing-date').type('01/02/2019');
cy.get('[data-testid="preferred-trial-city"]').select('Birmingham, Alabama');
cy.get(`[data-testid="procedure-type-${procedureType}-radio"]`).click();
cy.get('[data-testid="preferred-trial-city"]').select(trialLocation);
cy.get(
':nth-child(9) > .usa-fieldset > :nth-child(3) > .usa-radio__label',
).click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../shared/src/business/entities/EntityConstants';
import { uploadFile } from '../file/upload-file';

export function petitionerCreatesElectronicCaseUpdated(
Expand Down Expand Up @@ -26,8 +27,9 @@ export function petitionerCreatesElectronicCaseUpdated(
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

Expand Down Expand Up @@ -119,8 +121,9 @@ export function petitionerAttemptsToUploadCorruptPdfUpdated() {
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

Expand Down Expand Up @@ -170,8 +173,9 @@ export function petitionerCreatesElectronicCaseWithSpouseUpdated(
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

Expand Down Expand Up @@ -221,8 +225,9 @@ export function petitionerCreatesElectronicCaseWithDeceasedSpouseUpdated(
cy.get('[data-testid="redaction-acknowledgement-label"]').click();
cy.get('[data-testid="step-3-next-button"]').click();

cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="step-4-next-button"]').click();

Expand Down
31 changes: 19 additions & 12 deletions cypress/helpers/fileAPetition/petitioner-creates-electronic-case.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../shared/src/business/entities/EntityConstants';
import {
petitionerAttemptsToUploadCorruptPdfUpdated,
petitionerCreatesElectronicCaseForBusinessUpdated,
Expand Down Expand Up @@ -31,8 +32,9 @@ export function petitionerCreatesElectronicCaseWithDeceasedSpouseOld(
cy.get('[data-testid="phone"]').type('1111111111');
cy.get('[data-testid="use-same-address-above-label"]').click();
cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();
cy.get('[data-testid="file-petition"]').click();
Expand Down Expand Up @@ -111,8 +113,9 @@ export function petitionerCreatesElectronicCaseWithSpouseOld(
cy.get('[data-testid="phone"]').type('1111111111');
cy.get('[data-testid="use-same-address-above-label"]').click();
cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();
cy.get('[data-testid="file-petition"]').click();
Expand Down Expand Up @@ -160,8 +163,9 @@ function petitionerCreatesElectronicCaseOld(primaryFilerName = 'John') {
cy.get('[data-testid="phone"]').type('1111111111');

cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();

Expand Down Expand Up @@ -204,8 +208,9 @@ export function petitionerCreatesElectronicCaseForBusinessOld() {
uploadFile('corporate-disclosure-file');

cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();

Expand Down Expand Up @@ -259,8 +264,9 @@ export function privatePractitionerCreatesElectronicCaseForBusiness() {
uploadFile('corporate-disclosure-file');

cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();

Expand Down Expand Up @@ -313,8 +319,9 @@ export function petitionerAttemptsToUploadCorruptPdfOld() {
cy.get('[data-testid="phone"]').type('1111111111');

cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../shared/src/business/entities/EntityConstants';
import { uploadFile } from '../file/upload-file';

export function practitionerCreatesElectronicCase() {
Expand All @@ -20,8 +21,9 @@ export function practitionerCreatesElectronicCase() {
cy.get('[data-testid="phone"]').type('1111111111');
cy.get('[data-testid="use-same-address-above-label"]').click();
cy.get('[data-testid="complete-step-3"]').click();
cy.get('[data-testid="procedure-type-1"]').click();
cy.get('[data-testid="procedure-type-0"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('[data-testid="preferred-trial-city"]').select('Mobile, Alabama');
cy.get('[data-testid="complete-step-4"]').click();
cy.get('[data-testid="file-petition"]').click();
Expand Down
5 changes: 4 additions & 1 deletion cypress/local-only/support/pages/create-paper-petition.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../../shared/src/business/entities/EntityConstants';
import { faker } from '@faker-js/faker';
import {
getCreateACaseButton,
Expand Down Expand Up @@ -54,7 +55,9 @@ export const fillInCreateCaseFromPaperForm = (testData?: {

cy.get('input#date-received-picker').type('01/01/2020');
cy.get('#mailing-date').type('01/01/2020');
cy.get('#procedure-type-0').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('#preferred-trial-city').scrollIntoView();
cy.get('#preferred-trial-city').select('Birmingham, Alabama');
cy.get('label[for="payment-status-paid"]').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../../../shared/src/business/entities/EntityConstants';
import { checkA11y } from '../../../support/generalCommands/checkA11y';
import { loginAsPetitioner } from '../../../../helpers/authentication/login-as-helpers';

Expand Down Expand Up @@ -262,7 +263,9 @@ describe('File a Petition Page - Petitioner Accessibility', () => {
loginAsPetitioner();
cy.visit('/file-a-petition-pa11y/step-4');
cy.get('[data-testid="complete-step-4"]').should('exist');
cy.get('#procedure-type-0').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.regular}-radio"]`,
).click();
cy.get('#preferred-trial-city').should('exist');

checkA11y();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PROCEDURE_TYPES_MAP } from '../../../../../shared/src/business/entities/EntityConstants';
import { checkA11y } from '../../../support/generalCommands/checkA11y';
import {
fillIrsNoticeInformation,
Expand All @@ -22,7 +23,9 @@ describe('Petition generation - step 4', () => {
});

it('Small Case: should be free of a11y issues', () => {
cy.get('[data-testid="procedure-type-1"]').click();
cy.get(
`[data-testid="procedure-type-${PROCEDURE_TYPES_MAP.small}-radio"]`,
).click();
checkA11y();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import {
CASE_STATUS_TYPES,
PROCEDURE_TYPES_MAP,
} from '../../../../../shared/src/business/entities/EntityConstants';
import {
FORMATS,
formatNow,
} from '../../../../../shared/src/business/utilities/DateHandler';
import { createAndServePaperPetition } from '../../../../helpers/fileAPetition/create-and-serve-paper-petition';
import { goToCase } from '../../../../helpers/caseDetail/go-to-case';
import { loginAsColvin } from '../../../../helpers/authentication/login-as-helpers';
import { retry } from '../../../../helpers/retry';

describe('Blocked Cases Report', () => {
beforeEach(() => {
cy.task('deleteAllFilesInFolder', 'cypress/downloads');
});

it('should show a blocked case in the blocked cases report and the downloaded csv report', () => {
const trialLocation = 'Portland, Maine';
const [trialCity, trialState] = trialLocation.split(', ');
const procedureType = PROCEDURE_TYPES_MAP.small;
createAndServePaperPetition({
procedureType,
trialLocation,
}).then(({ docketNumber }) => {
//block case
loginAsColvin();
goToCase(docketNumber);
cy.get('[data-testid="tab-case-information"]').click();
cy.get('[data-testid="add-manual-block-button"]').click();
cy.get('[data-testid="blocked-from-trial-reason-textarea"]').type(
'This case cannot go to trial.',
);
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="success-alert"]').contains(
'Case blocked from being set for trial.',
);

//View report
cy.get('[data-testid="dropdown-select-report"]').click();
cy.get('[data-testid="blocked-cases-report"]').click();

function checkIfOpensearchHasIndexedBlockedCase() {
cy.reload();
cy.get('[data-testid="trial-location-filter"]').select(trialLocation);
cy.get('[data-testid="procedure-type-filter"]').select(procedureType);
cy.get('[data-testid="case-status-filter"]').select(
CASE_STATUS_TYPES.generalDocket,
);
cy.get('[data-testid="blocked-reason-filter"]').select('Manual Block');
const selector = `[data-testid="blocked-case-${docketNumber}-row"]`;
return cy.get(selector).then(elements => elements.length > 0);
}

retry(checkIfOpensearchHasIndexedBlockedCase);

cy.get('[data-testid="blocked-cases-count"]').should('exist');

//download csv
cy.get('[data-testid="export-blocked-case-report"]').click();
const today = formatNow(FORMATS.MMDDYYYY_UNDERSCORED);
const fileName = `Blocked Cases Report - ${trialCity}_${trialState} ${today}.csv`;
cy.readFile(`cypress/downloads/${fileName}`, 'utf-8').should(
fileContent => {
expect(fileContent).to.include(docketNumber);
},
);
});
});
});
Loading

0 comments on commit e7ac9b8

Please sign in to comment.