Skip to content

Commit

Permalink
Merge branch 'test' of https://github.com/ustaxcourt/ef-cms into 1049…
Browse files Browse the repository at this point in the history
…2-dxox-intermediate-branch-to-test-1733243644
  • Loading branch information
pixiwyn committed Dec 3, 2024
2 parents 8c2ba35 + 5a8e8f2 commit 9855223
Show file tree
Hide file tree
Showing 383 changed files with 539,525 additions and 9,329 deletions.
7 changes: 6 additions & 1 deletion cypress/helpers/authentication/login-as-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ export function loginAsDocketClerk() {
}

export function loginAsDocketClerk1() {
cy.login('docketclerk1');
login({ email: 'docketclerk1@example.com' });
cy.get('[data-testid="inbox-tab-content"]').should('exist');
}

export function loginAsClerkOfCourt() {
login({ email: 'clerkofcourt@example.com' });
cy.get('[data-testid="inbox-tab-content"]').should('exist');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { fillPaperFilingForm } from './fill-paper-filing-form';

export function createAndSaveForLaterPaperFiling({
dateReceived,
documentType,
}: {
documentType: string;
dateReceived: string;
}) {
fillPaperFilingForm({ dateReceived, documentType });

cy.get('[data-testid="save-for-later"]').click();
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
import { attachFile } from '../../../file/upload-file';
import { selectTypeaheadInput } from '../../../components/typeAhead/select-typeahead-input';
import { fillPaperFilingForm } from './fill-paper-filing-form';

export function createAndServePaperFiling(
documentType: string,
dateReceived: string,
) {
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-add-paper-filing"]').click();
cy.get(
'.usa-date-picker__wrapper > [data-testid="date-received-picker"]',
).type(dateReceived);
selectTypeaheadInput('primary-document-type-search', documentType);
cy.get('[data-testid="filed-by-option"]').click();
cy.get('[data-testid="objections-No"]').click();
cy.get('[data-testid="upload-pdf-button"]').click();

attachFile({
filePath: '../../helpers/file/sample.pdf',
selector: 'input#primaryDocumentFile-file',
selectorToAwaitOnSuccess: '[data-testid="remove-pdf"]',
});
export function createAndServePaperFiling({
dateReceived,
documentType,
isPaperCase = true,
}: {
documentType: string;
dateReceived: string;
isPaperCase?: boolean;
}) {
fillPaperFilingForm({ dateReceived, documentType });

cy.get('[data-testid="save-and-serve"]').click();
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="print-paper-service-done-button"]').click();
if (isPaperCase)
cy.get('[data-testid="print-paper-service-done-button"]').click();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { attachFile } from '../../../file/upload-file';
import { selectTypeaheadInput } from '../../../components/typeAhead/select-typeahead-input';

export function fillPaperFilingForm({
dateReceived,
documentType,
}: {
documentType: string;
dateReceived: string;
}) {
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-add-paper-filing"]').click();
cy.get(
'.usa-date-picker__wrapper > [data-testid="date-received-picker"]',
).type(dateReceived);
selectTypeaheadInput('primary-document-type-search', documentType);
cy.get('[data-testid="filed-by-option"]').click();
cy.get('[data-testid="objections-No"]').click();
cy.get('[data-testid="upload-pdf-button"]').click();

attachFile({
filePath: '../../helpers/file/sample.pdf',
selector: 'input#primaryDocumentFile-file',
selectorToAwaitOnSuccess: '[data-testid="remove-pdf"]',
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ export function createAndServePaperPetition(
];

expectedDocuments.forEach(({ eventCode, index, servedTo }) => {
cy.get(`[data-testid="docket-entry-index-${index}-eventCode"]`).should(
cy.get(`[data-testid="docket-entry-eventCode-${index}"]`).should(
'have.text',
eventCode,
);
cy.get(
`[data-testid="docket-entry-index-${index}-servedPartiesCode"]`,
`[data-testid="docket-entry-servedPartiesCode-${index}"]`,
).should('have.text', servedTo);
});

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

export function externalUserCreatesElectronicCase(
primaryFilerName: string = 'John',
Expand Down Expand Up @@ -246,4 +246,13 @@ export function petitionerAttemptsToUploadCorruptPdf() {
'contain.text',
'Your Request Was Not Completed',
);

attachFile({
filePath: '../../helpers/file/corrupt-pdf.pdf',
selector: '[data-testid="stin-file"]',
});

cy.get('[data-testid="file-upload-error-modal"]').contains(
'The file is corrupted or in an unsupported PDF format. Ensure that the file is not corrupted and/or is in a supported PDF format and try again.',
);
}
2 changes: 1 addition & 1 deletion cypress/helpers/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function retry(cb: () => Cypress.Chainable<boolean>, maxAttempts = 5) {
}
});
} else {
throw new Error('cypress failed to run a successful retry block');
throw new Error('cypress failed to successfully run a retry block');
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { checkA11y } from '../../../../support/generalCommands/checkA11y';

describe('Trial Sessions - Public Accessibility', () => {
beforeEach(() => {
Cypress.session.clearCurrentSessionData();
});

it('should be free of a11y issues', () => {
cy.visit('/trial-sessions');
checkA11y();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ describe('Docket clerk views consolidated case', function () {
});

it('should persist the selected sort filter by navigating away from the tab', () => {
cy.get('select[name="docketRecordSort.111-19"]').should(
'have.value',
'byDate',
);
cy.get('select[name="docketRecordSort.111-19"]').select('Newest');
cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'exchange-alt');

cy.get('[data-testid="descriptionDisplay-sortable-button"]').click();

cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'long-arrow-alt-up');

cy.get('#tab-document-view').click();
cy.get('#tab-docket-sub-record').click();
cy.get('select[name="docketRecordSort.111-19"]').should(
'have.value',
'byDateDesc',
);

cy.get('[data-testid="descriptionDisplay-sortable-button"]')
.find('svg')
.invoke('attr', 'data-icon')
.should('equal', 'long-arrow-alt-up');
});

it('should persist the populated consolidated cases in the overview tab when petitioner counsel is added to parties', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import { attachFile } from '../../../../../../helpers/file/upload-file';
import { loginAsPetitioner } from '../../../../../../helpers/authentication/login-as-helpers';
import { createAndServePaperFiling } from '../../../../../../helpers/caseDetail/docketRecord/paperFiling/create-and-serve-paper-filing';
import { createAndServePaperPetition } from '../../../../../../helpers/fileAPetition/create-and-serve-paper-petition';
import {
createMessage,
enterSubject,
fillOutMessageField,
selectRecipient,
selectSection,
sendMessage,
} from '../../../../../support/pages/document-qc';
import { goToCase } from '../../../../../../helpers/caseDetail/go-to-case';
import {
loginAsClerkOfCourt,
loginAsDocketClerk1,
loginAsPetitioner,
} from '../../../../../../helpers/authentication/login-as-helpers';
import { petitionerCreatesElectronicCaseWithSpouse } from '../../../../../../helpers/fileAPetition/petitioner-creates-electronic-case';
import { petitionsClerkServesPetition } from '../../../../../../helpers/documentQC/petitionsclerk-serves-petition';
import { selectTypeaheadInput } from '../../../../../../helpers/components/typeAhead/select-typeahead-input';

describe('Judge`s chambers stamps an order', () => {
it('should create an order, serve it, and apply a stamp to it', () => {
it('should create an order, serve it, apply a stamp to it, then redirect to Drafts of case detail', () => {
loginAsPetitioner();
petitionerCreatesElectronicCaseWithSpouse().then(docketNumber => {
petitionsClerkServesPetition(docketNumber);
Expand Down Expand Up @@ -35,7 +50,8 @@ describe('Judge`s chambers stamps an order', () => {
);

// Apply a stamp
cy.login('colvinschambers', `case-detail/${docketNumber}`);
loginAsClerkOfCourt();
goToCase(docketNumber);
cy.get('[data-testid="document-viewer-link-M006"]').last().click();
cy.get('[data-testid="apply-stamp"]').click();
cy.get('[data-testid="status-report-or-stip-decision-due-date"]').click();
Expand Down Expand Up @@ -67,4 +83,47 @@ describe('Judge`s chambers stamps an order', () => {
);
});
});

it('should allow judge to stamp motion from Message View and redirect to MessageDetail', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
loginAsDocketClerk1();
goToCase(docketNumber);
createAndServePaperFiling({
dateReceived: '01/01/2022',
documentType: 'Motion to Proceed Remotely',
});
cy.get(
'[data-testid="docket-record-table"] td:contains("Motion to Proceed Remotely")',
)
.parent()
.invoke('attr', 'data-testid')
.then(docketEntryId => {
createMessage();
selectSection('Clerk of the Court');
selectRecipient('Test Clerk of Court');
enterSubject();
fillOutMessageField();
cy.get('[data-testid="select-document"]').select(docketEntryId!);
sendMessage();
loginAsClerkOfCourt();
cy.get(
'.message-subject > .message-document-title > [data-testid="messages-individual-inbox-subject-cell"]',
)
.first()
.click();
cy.get('[data-testid="apply-stamp"]').click();
cy.get('[data-testid="motion-disposition-Granted"]').click();
cy.get('[data-testid="save-signature-button"]').click();
cy.get('[data-testid="success-alert"]').contains(
'Motion to Proceed Remotely stamped successfully.',
);
cy.get('.attachment-viewer-button')
.contains('Motion to Proceed Remotely')
.should('be.visible');
cy.get('.attachment-viewer-button')
.contains('Motion to Proceed Remotely GRANTED')
.should('be.visible');
});
});
});
});
Loading

0 comments on commit 9855223

Please sign in to comment.