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

devex - refactor promises for resolving the filings of external documents #10244

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
37058c1
10214: organize judge activity report into three tabs
nechama-krigsman Dec 25, 2023
38572d7
10214: load CAV report data on initial page load
nechama-krigsman Dec 26, 2023
473ee31
10214: load statistics data when submitting statistics tab; clear out…
nechama-krigsman Dec 26, 2023
47998a1
10214: display count cav cases; switch total label to count
nechama-krigsman Dec 26, 2023
1e7c7dd
10214: remove date validation when loading cav/pending data
nechama-krigsman Dec 26, 2023
341a734
10214: clear out dates when user toggles judge
nechama-krigsman Dec 26, 2023
a3a40bd
10214: some cleanup
nechama-krigsman Dec 26, 2023
85a16f2
10214: add unit tests
nechama-krigsman Dec 28, 2023
ebecae5
10214: add pending motions table to judge activity report
nechama-krigsman Dec 28, 2023
3017b7b
10214: update load pending motions to accept an array of judges
nechama-krigsman Dec 28, 2023
9eb82e3
10214: remove unnecessary state
nechama-krigsman Dec 28, 2023
8a793a8
10214: remove unnecessary state
nechama-krigsman Dec 28, 2023
a6ec10f
Merge branch '10214-story' of https://github.com/flexion/ef-cms into …
nechama-krigsman Dec 28, 2023
6a72001
10214: remove logs
nechama-krigsman Dec 28, 2023
9c11b79
10214: update key
nechama-krigsman Dec 28, 2023
e315e95
10214: styling tweaks
nechama-krigsman Dec 28, 2023
f347f12
10214 - fixing unit tests
codyseibert Dec 28, 2023
4ceb795
10214 - working on refactoring integration test into a cypress test
codyseibert Dec 29, 2023
9b01e51
10214: fix unit tests
nechama-krigsman Jan 1, 2024
2414eae
10214: fix unit tests
nechama-krigsman Jan 2, 2024
75a27b7
10214 - fixing ts errors
codyseibert Jan 2, 2024
50eb267
Merge branch 'staging' into 10214-story
codyseibert Jan 2, 2024
6821073
10214 - replace integration tests with cypress tests
codyseibert Jan 2, 2024
e359552
Merge branch '10214-story' of github.com:flexion/ef-cms into 10214-story
codyseibert Jan 2, 2024
7649df7
10214 - testing pending reports
codyseibert Jan 2, 2024
e4e5539
10214: add cypress test for pending motion tab
nechama-krigsman Jan 2, 2024
e95a131
10214: organize cypress test filr by features;
nechama-krigsman Jan 2, 2024
f864a4c
10214: add cypress tests; add retry to fix flakey tests
nechama-krigsman Jan 2, 2024
d4b9853
10214: some test cleanup
nechama-krigsman Jan 2, 2024
0daadc4
verify the text is updated before submitting the modal
codyseibert Jan 2, 2024
067fde6
10214 - fixing issue with orders opening new tabs which causes cypres…
codyseibert Jan 3, 2024
e689522
Merge branch 'staging' into 10214-story
codyseibert Jan 3, 2024
444dd5a
deleting flaky test
codyseibert Jan 3, 2024
5d341cf
Merge branch '10214-story' of github.com:flexion/ef-cms into 10214-story
codyseibert Jan 3, 2024
be83c1e
10214 - refactor pa11y test to make less flaky
codyseibert Jan 3, 2024
7350b81
10214: refactor method to return all of the judges data; map to only …
nechama-krigsman Jan 3, 2024
a47f8b0
10214: Fix padding on each tab;
Jan 3, 2024
5995408
10214: remove old submitted and cav title
nechama-krigsman Jan 3, 2024
f5224e1
10214: pull out some test steps to helper functions
nechama-krigsman Jan 4, 2024
175e407
Merge branch 'staging' into 10214-story
codyseibert Jan 4, 2024
60aa6fe
10214: refactor markup
nechama-krigsman Jan 4, 2024
9b2f361
10214: remove unused computed field
nechama-krigsman Jan 4, 2024
d0901b9
10214: remove resetting initial; delete property form helper;
nechama-krigsman Jan 4, 2024
a6b6f4d
10214: Fix unit test; inline empty object;
Jan 4, 2024
b1f637d
10214: Include "docketNumberWithSuffix" pending motions table
Jan 5, 2024
7ce1312
10214: Extend test coverage to include new property;
Jan 5, 2024
5a6cb63
10214: Extend test coverage to check that were passing correct parame…
Jan 5, 2024
7838150
Merge branch 'staging' into 10214-story
codyseibert Jan 8, 2024
057815d
10214: refactor get pending motion interactor to speed up process;
codyseibert Jan 9, 2024
f6d650c
10214 - fixed mocking of data in test
codyseibert Jan 9, 2024
0e62100
Merge branch 'staging' into 10214-stg
cruzjone-flexion Jan 9, 2024
5e0eca8
Merge branch 'staging' into 10214-stg
cruzjone-flexion Jan 17, 2024
17a93f7
10241: Fix typing errors in test file;
Jan 17, 2024
9f54964
10241: Fix typing errors in test file;
Jan 17, 2024
fdc1d27
Merge branch 'staging' into 10214-stg
cruzjone-flexion Jan 17, 2024
594bc34
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into 1…
nechama-krigsman Jan 18, 2024
bbe3afe
10214: get pending motions by judgeId
nechama-krigsman Jan 18, 2024
038d4e2
10214: address feedback; use filter to load pending motions;
nechama-krigsman Jan 18, 2024
1aa2658
devex - fix promises for resolving filing external documents
Absolutestunna Jan 18, 2024
5d75895
Merge branch 'staging' into 10214-stg
cruzjone-flexion Jan 18, 2024
fd9c6db
Merge branch '10214-stg' of https://github.com/flexion/ef-cms into 10…
nechama-krigsman Jan 18, 2024
8378d77
10214: fix test
nechama-krigsman Jan 18, 2024
dc6a07b
Merge pull request #4534 from flexion/10214-stg
mmarcotte Jan 18, 2024
3389609
Merge branch 'staging' of https://github.com/ustaxcourt/ef-cms into d…
Absolutestunna Jan 18, 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 @@ -23,7 +23,7 @@ describe('Docket clerk creates and edits draft order with selected docket number
draftsCount = Number(text) || draftsCount;
});

createOrder(leadCase);
createOrder();

cy.get('[data-testid="icon-tab-unread-messages-count"]')
.invoke('text')
Expand All @@ -46,7 +46,7 @@ describe('Docket clerk creates and edits draft order with selected docket number

loginAsDocketClerk();
searchByDocketNumberInHeader(leadCase);
createOrder(leadCase);
createOrder();

cy.get('[data-testid="icon-tab-unread-messages-count"]')
.invoke('text')
Expand Down
231 changes: 231 additions & 0 deletions cypress/cypress-integration/integration/judge-activity-report.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
import { addCaseToGroup } from '../../helpers/add-case-to-group';
import { assertDoesNotExist, assertExists, retry } from '../../helpers/retry';
import { createAndServePaperFiling } from '../../helpers/create-and-serve-paper-filing';
import { createAndServePaperPetition } from '../../helpers/create-and-serve-paper-petition';
import { createOrderAndDecision } from '../../helpers/create-order-and-decision';
import { navigateToJudgeActivityReport } from '../../helpers/navigate-to-judge-activity-report';
import { searchByDocketNumberInHeader } from '../../helpers/search-by-docket-number-in-header';
import { updateCaseStatus } from '../../helpers/update-case-status';

describe('Verify the activity report', () => {
describe('Statistics table', () => {
it('should display an error message when invalid dates are entered into the form', () => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('statistics');
cy.get('[data-testid="view-statistics-button"]').should('be.disabled');
cy.get(
'.usa-date-picker__wrapper > [data-testid="deadlineStart-date-start-input"]',
).type('abc');
cy.get(
'.usa-date-picker__wrapper > [data-testid="deadlineEnd-date-end-input}"]',
).type('123');
cy.get('[data-testid="view-statistics-button"]').click();
cy.get('[data-testid="error-alert"]').should('be.visible');
cy.get('[data-testid="deadlineStart-date-start"]').should('be.visible');
cy.get('[data-testid="deadlineEnd-date-end}"]').should('be.visible');
cy.get('[data-testid="activity-report-header"]').should(
'contain',
'Colvin',
);
cy.get('[data-testid="judge-select"]')
.find('option:selected')
.should('have.text', 'Colvin');
});

it('should display statistics tables when a correct date is inputed', () => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('statistics');
cy.get('[data-testid="view-statistics-button"]').should('be.disabled');
cy.get('[data-testid="cases-closed-table"]').should('not.exist');
cy.get('[data-testid="trial-sessions-held-table"]').should('not.exist');
cy.get('[data-testid="orders-issued-table"]').should('not.exist');
cy.get('[data-testid="opinions-issued-table"]').should('not.exist');
cy.get(
'.usa-date-picker__wrapper > [data-testid="deadlineStart-date-start-input"]',
).type('01/01/2013');
cy.get(
'.usa-date-picker__wrapper > [data-testid="deadlineEnd-date-end-input}"]',
).type('01/01/2024');
cy.get('[data-testid="view-statistics-button"]').click();
cy.get('[data-testid="activity-report-header"]').should(
'contain',
'Colvin',
);
cy.get('[data-testid="judge-select"]')
.find('option:selected')
.should('have.text', 'Colvin');

cy.get('[data-testid="cases-closed-table"]').should('be.visible');
cy.get('[data-testid="trial-sessions-held-table"]').should('be.visible');
cy.get('[data-testid="orders-issued-table"]').should('be.visible');
cy.get('[data-testid="opinions-issued-table"]').should('be.visible');
});
});

describe('Submitted/CAV table', () => {
it('create a Submitted case and verify it shows up in the Submitted/CAV table', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('Submitted', 'Colvin');

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${docketNumber}"]`);
});
});
});

it('create a CAV case and verify it shows up in the Submitted/CAV table', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('CAV', 'Colvin');

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${docketNumber}"]`);
});
});
});

it('create a Submitted - Rule 122 case and verify it shows up in the Submitted/CAV table', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('Submitted - Rule 122', 'Colvin');

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${docketNumber}"]`);
});
});
});

it('should not display a served decision type event code on the submitted and cav table', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('Submitted', 'Colvin');

cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
createOrderAndDecision();

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${docketNumber}"]`);
});

cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);

cy.get('[data-testid="tab-drafts"]').click();
cy.get('[data-testid="add-court-issued-docket-entry-button"]').click();
cy.get('[data-testid="judge-select"]').select('Colvin');
cy.get('[data-testid="serve-to-parties-btn"]').click();
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="print-paper-service-done-button"]').click();

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertDoesNotExist(`[data-testid="${docketNumber}"]`);
});
});
});

it('should display a stricken decision type documents on the submitted and cav table', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('Submitted', 'Colvin');
createOrderAndDecision();

cy.get('[data-testid="tab-drafts"]').click();
cy.get('[data-testid="add-court-issued-docket-entry-button"]').click();
cy.get('[data-testid="judge-select"]').select('Colvin');
cy.get('[data-testid="serve-to-parties-btn"]').click();
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="print-paper-service-done-button"]').click();

updateCaseStatus('Submitted', 'Colvin');

cy.get('[data-testid="tab-docket-record"]').click();
cy.get('[data-testid="edit-OAD"]').click();
cy.get('[data-testid="tab-action"]').click();
cy.get('[data-testid="strike-entry"]').click();
cy.get('[data-testid="modal-button-confirm"]').click();

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${docketNumber}"]`);
});
});
});

it('should display lead case of a consolidated group', () => {
createAndServePaperPetition().then(
({ docketNumber: childDocketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(childDocketNumber);
updateCaseStatus('Submitted', 'Colvin');

createAndServePaperPetition({ yearReceived: '2019' }).then(
({ docketNumber: leadDocketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(leadDocketNumber);
updateCaseStatus('Submitted', 'Colvin');
addCaseToGroup(childDocketNumber);

retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('submitted-and-cav');
return assertExists(`[data-testid="${leadDocketNumber}"]`).then(
isLeadVisible => {
assertDoesNotExist(
`[data-testid="${childDocketNumber}"]`,
).then(isChildHidden => isLeadVisible && isChildHidden);
},
);
});
},
);
},
);
});
});

describe('Pending Motions Table', () => {
it('should display Pending Motions for judge in that report', () => {
createAndServePaperPetition().then(({ docketNumber }) => {
cy.login('docketclerk');
searchByDocketNumberInHeader(docketNumber);
updateCaseStatus('Submitted', 'Colvin');
searchByDocketNumberInHeader(docketNumber);
createAndServePaperFiling('Motion for a New Trial', '01/01/2022');
searchByDocketNumberInHeader(docketNumber);

cy.get(
'[data-testid="docket-record-table"] td:contains("Motion for a New Trial")',
)
.parent()
.invoke('attr', 'data-testid')
.then(docketEntryId => {
retry(() => {
cy.login('judgecolvin');
navigateToJudgeActivityReport('pending-motions');
return assertExists(
`[data-testid="pending-motion-row-${docketEntryId}"]`,
);
});
});
});
});
});
});
3 changes: 3 additions & 0 deletions cypress/cypress-integration/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Cypress.Commands.add('login', (username, route = '/') => {
cy.url().should('include', route);
cy.showsErrorMessage(false);
cy.url().should('not.include', '/mock-login');
cy.window().then(win =>
win.localStorage.setItem('__cypressOrderInSameTab', 'true'),
);
});

Cypress.Commands.add('goToRoute', (...args) => {
Expand Down
7 changes: 7 additions & 0 deletions cypress/helpers/add-case-to-group.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function addCaseToGroup(childDocketNumber: string) {
cy.get('[data-testid="add-cases-to-group"]').click();
cy.get('[data-testid="consolidated-case-search"]').type(childDocketNumber);
cy.get('[data-testid="consolidated-search"]').click();
cy.get('[data-testid="found-case-label"]').click();
cy.get('[data-testid="modal-confirm"]').click();
}
24 changes: 24 additions & 0 deletions cypress/helpers/create-and-serve-paper-filing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { selectTypeaheadInput } from './select-typeahead-input';

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('document-type', documentType);
cy.get('[data-testid="filed-by-option"]').click();
cy.get('[data-testid="objections-No"]').click();
cy.get('[data-testid="button-upload-pdf"]').click();

cy.get('input#primaryDocumentFile-file').attachFile(
'../fixtures/w3-dummy.pdf',
);

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();
}
6 changes: 4 additions & 2 deletions cypress/helpers/create-and-serve-paper-petition.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function createAndServePaperPetition() {
export function createAndServePaperPetition(
options = { yearReceived: '2020' },
) {
const name = 'rick james ' + Date.now();
cy.login('petitionsclerk1');
cy.get('[data-testid="inbox-tab-content"]').should('exist');
Expand All @@ -18,7 +20,7 @@ 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/2020');
cy.get('#date-received-picker').type(`01/02/${options.yearReceived}`);
cy.get('#mailing-date').clear();
cy.get('#mailing-date').type('01/02/2019');
cy.get('[data-testid="preferred-trial-city"]').select('Birmingham, Alabama');
Expand Down
11 changes: 11 additions & 0 deletions cypress/helpers/create-order-and-decision.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function createOrderAndDecision() {
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-create-order"]').click();
cy.get('[data-testid="event-code-select"]').select('OAD');
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('.ql-editor').click();
cy.get('[data-testid="save-order-button"]').click();
cy.get('[data-testid="sign-pdf-canvas"]').click();
cy.get('[data-testid="save-signature-button"]').click();
cy.get('[data-testid="success-alert"]');
}
13 changes: 3 additions & 10 deletions cypress/helpers/create-order.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
export const createOrder = (docketNumber: string) => {
export const createOrder = () => {
const orderTitle = 'Order first title';
const orderEventCode = 'O';
const leadCase = docketNumber;

cy.get('[data-testid="case-detail-menu-button"] > .svg-inline--fa').click();
cy.get('[data-testid="case-detail-menu-button"]').click();
cy.get('[data-testid="menu-button-create-order"]').click();
cy.get('[data-testid="event-code-select"]').select(orderEventCode);
cy.get('[data-testid="create-order-document-title"]').clear();
cy.get('[data-testid="create-order-document-title"]').type(orderTitle);
cy.get('[data-testid="modal-button-confirm"]')
.invoke('click')
.then(() => {
cy.visit(
`case-detail/${leadCase}/create-order?documentTitle=${orderTitle}&documentType=Order&eventCode=${orderEventCode}`,
);
});
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="create-order-page-title"]').should(
'contain',
`Create ${orderTitle}`,
Expand Down
7 changes: 7 additions & 0 deletions cypress/helpers/navigate-to-judge-activity-report.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function navigateToJudgeActivityReport(
tab: 'submitted-and-cav' | 'pending-motions' | 'statistics',
) {
cy.get('[data-testid="dropdown-select-report"]').click();
cy.get('[data-testid="activity-report-link"]').click();
cy.get(`[data-testid="${tab}-tab"]`).click();
}
6 changes: 6 additions & 0 deletions cypress/helpers/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ export function assertExists(selector: string) {
return body.find(selector).length > 0;
});
}

export function assertDoesNotExist(selector: string) {
return cy.get('body').then(body => {
return body.find(selector).length === 0;
});
}
8 changes: 8 additions & 0 deletions cypress/helpers/update-case-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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);
cy.get('[data-testid="modal-button-confirm"]').click();
cy.get('[data-testid="success-alert"]').should('be.visible');
}
Loading
Loading