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

10489: Status Order Report Enhancements #5600

Open
wants to merge 16 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
@@ -0,0 +1,112 @@
import {
FORMATS,
formatNow,
} from '../../../../../shared/src/business/utilities/DateHandler';
import {
docketNumber,
getLastDraftOrderElementFromDrafts,
} from '../../../support/statusReportOrder';
import {
loginAsColvin,
loginAsColvinChambers,
loginAsDocketClerk,
} from '../../../../helpers/authentication/login-as-helpers';
import { logout } from '../../../../helpers/authentication/logout';

describe('should default status report order descriptions', () => {
const today = formatNow(FORMATS.MMDDYYYY);
it('should display default description when document type is an Order', () => {
judgeOrChambersCreatesStatusReportOrder(today);
loginAsDocketClerk();
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-drafts').click();
getLastDraftOrderElementFromDrafts().click();
cy.get('[data-testid="add-court-issued-docket-entry-button"]').click();
cy.get('[data-testid="court-issued-document-type-search"]').should(
'have.text',
'Order',
);
cy.get('[data-testid="document-description-input"]').should(
'have.value',
`Order parties by ${today} shall file a status report.`,
);
cy.get('[data-testid="docket-entry-preview-text"]').should(
'have.text',
`Docket entry preview: Order parties by ${today} shall file a status report.`,
);
});

it('should set event code to OJR when case is stricken from trial session and jurisdiction is retained and display default description', () => {
judgeOrChambersCreatesStatusReportOrder(today, true);
loginAsDocketClerk();
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-drafts').click();
getLastDraftOrderElementFromDrafts().click();
cy.get('[data-testid="add-court-issued-docket-entry-button"]').click();
cy.get('[data-testid="court-issued-document-type-search"]').should(
'have.text',
'Order that jurisdiction is retained',
);
cy.get('[data-testid="document-description-input"]').should(
'have.value',
`. Parties by ${today} shall file a status report. Case is stricken from the current trial session.`,
);
cy.get('[data-testid="judge-select"]').should('have.value', 'Colvin');
cy.get('[data-testid="docket-entry-preview-text"]').should(
'have.text',
`Docket entry preview: Order that jurisdiction is retained by Judge Colvin. Parties by ${today} shall file a status report. Case is stricken from the current trial session.`,
);
});

it('should continue to handle OJR and set correct signing judge when status order report is signed by chambers user', () => {
judgeOrChambersCreatesStatusReportOrder(today, true, true);
loginAsDocketClerk();
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-drafts').click();
getLastDraftOrderElementFromDrafts().click();
cy.get('[data-testid="add-court-issued-docket-entry-button"]').click();
cy.get('[data-testid="court-issued-document-type-search"]').should(
'have.text',
'Order that jurisdiction is retained',
);
cy.get('[data-testid="document-description-input"]').should(
'have.value',
`. Parties by ${today} shall file a status report. Case is stricken from the current trial session.`,
);
cy.get('[data-testid="judge-select"]').should('have.value', 'Colvin');
cy.get('[data-testid="docket-entry-preview-text"]').should(
'have.text',
`Docket entry preview: Order that jurisdiction is retained by Judge Colvin. Parties by ${today} shall file a status report. Case is stricken from the current trial session.`,
);
});
});

function judgeOrChambersCreatesStatusReportOrder(
today: string,
jurisdictionRetained: boolean = false,
chambersUser: boolean = false,
) {
if (chambersUser) {
loginAsColvinChambers();
} else {
loginAsColvin();
}
cy.visit(`/case-detail/${docketNumber}`);
cy.get('#tab-document-view').click();
cy.contains('Status Report').click();
cy.get('[data-testid="status-report-order-button"]').click();
cy.get('[data-testid="order-type-status-report"]').check({ force: true });
cy.get('#status-report-due-date-picker').type(today);

if (jurisdictionRetained) {
cy.get('#stricken-from-trial-sessions-label').click();
cy.get(
'#jurisdiction-form-group > :nth-child(2) > .usa-radio__label',
).click();
cy.get('#jurisdiction-retained').check();
}
cy.get('[data-testid="save-draft-button"]').click();
cy.get('[data-testid="sign-pdf-canvas"]').click();
cy.get('[data-testid="save-signature-button"]').click();
logout();
}
2 changes: 2 additions & 0 deletions shared/src/business/entities/EntityConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const DOCUMENT_EXTERNAL_CATEGORIES_MAP: {
} = externalFilingEventsJson;
export const COURT_ISSUED_EVENT_CODES = courtIssuedEventCodesJson;

export const EVENT_CODES_THAT_ALLOW_FREE_TEXT = ['O', 'NOT', 'OJR'];

export const DOCKET_NUMBER_MATCHER = /^([1-9]\d{2,4}-\d{2})$/;

export const CURRENT_YEAR = +formatNow(FORMATS.YEAR);
Expand Down
1 change: 1 addition & 0 deletions shared/src/business/utilities/replaceBracketed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const replaceBracketed = (
while (bracketsMatcher.test(template)) {
template = template.replace(bracketsMatcher, values.shift() || '');
}
template = template.replace(/\s+\./g, '.');
template = template.trim();
return template;
};
Loading
Loading