-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into 10554-data-cleanup
- Loading branch information
Showing
132 changed files
with
537,767 additions
and
3,567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.21 | ||
efcms-docker-image: &efcms-docker-image $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ef-cms-us-east-1:4.3.21.1 | ||
|
||
parameters: | ||
run_build_and_deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ess/helpers/caseDetail/docketRecord/paperFiling/create-and-save-for-later-paper-filing.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
35 changes: 13 additions & 22 deletions
35
cypress/helpers/caseDetail/docketRecord/paperFiling/create-and-serve-paper-filing.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
26 changes: 26 additions & 0 deletions
26
cypress/helpers/caseDetail/docketRecord/paperFiling/fill-paper-filing-form.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]', | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
cypress/local-only/tests/integration/caseDetail/docketRecord/docket-record-sort.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
import { createAndSaveForLaterPaperFiling } from '../../../../../helpers/caseDetail/docketRecord/paperFiling/create-and-save-for-later-paper-filing'; | ||
import { createAndServePaperFiling } from '../../../../../helpers/caseDetail/docketRecord/paperFiling/create-and-serve-paper-filing'; | ||
import { externalUserCreatesElectronicCase } from '../../../../../helpers/fileAPetition/petitioner-creates-electronic-case'; | ||
import { goToCase } from '../../../../../helpers/caseDetail/go-to-case'; | ||
import { | ||
loginAsDocketClerk, | ||
loginAsPetitioner, | ||
} from '../../../../../helpers/authentication/login-as-helpers'; | ||
import { logout } from '../../../../../helpers/authentication/logout'; | ||
import { petitionsClerkServesPetition } from '../../../../../helpers/documentQC/petitionsclerk-serves-petition'; | ||
|
||
describe('Docket record sort', () => { | ||
before(() => { | ||
loginAsPetitioner(); | ||
externalUserCreatesElectronicCase().then(docketNumber => { | ||
cy.wrap(docketNumber).as('DOCKET_NUMBER'); | ||
petitionsClerkServesPetition(docketNumber); | ||
logout(); | ||
loginAsDocketClerk(); | ||
goToCase(docketNumber); | ||
createAndServePaperFiling({ | ||
dateReceived: '01/01/2022', | ||
documentType: 'Motion for a New Trial', | ||
isPaperCase: false, | ||
}); | ||
createAndSaveForLaterPaperFiling({ | ||
dateReceived: '01/01/2022', | ||
documentType: 'Motion for a New Trial', | ||
}); | ||
goToCase(docketNumber); | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.reload(true); | ||
cy.keepAliases(); | ||
}); | ||
|
||
it('should display docket entries in default sort order', () => { | ||
getColumnTextFields('docket-entry-filedDate').then(columnTextFields => { | ||
const sortedColumnsTextFieldsAsc = [...columnTextFields].sort( | ||
sortColumnsAsc, | ||
); | ||
|
||
expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsAsc); | ||
}); | ||
}); | ||
|
||
[ | ||
{ | ||
columnId: 'docket-entry-index', | ||
fieldName: 'index', | ||
sortButtonId: 'index-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-filedDate', | ||
defaultSort: true, | ||
fieldName: 'date', | ||
sortButtonId: 'sortingFilingDate-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-eventCode', | ||
fieldName: 'event code', | ||
sortButtonId: 'eventCode-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-filingsAndProceedings', | ||
fieldName: 'filings and proceedings', | ||
sortButtonId: 'descriptionDisplay-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-numberOfPages', | ||
fieldName: 'number of pages', | ||
sortButtonId: 'numberOfPages-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-filedBy', | ||
fieldName: 'filed by', | ||
sortButtonId: 'filedBy-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-action', | ||
fieldName: 'action', | ||
sortButtonId: 'action-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-record-cell-not-served', | ||
fieldName: 'served', | ||
sortButtonId: 'servedAt-sortable-button', | ||
}, | ||
{ | ||
columnId: 'docket-entry-servedPartiesCode', | ||
fieldName: 'served parties', | ||
sortButtonId: 'servedPartiesCode-sortable-button', | ||
}, | ||
].forEach(testInfo => { | ||
it(`should display docket entries in correct order when sorting by ${testInfo.fieldName} ascending and descending`, () => { | ||
if (!testInfo.defaultSort) { | ||
cy.get(`[data-testid="${testInfo.sortButtonId}"]`).click(); | ||
} | ||
getColumnTextFields(testInfo.columnId).then(columnTextFields => { | ||
const sortedColumnsTextFieldsAsc = [...columnTextFields].sort( | ||
sortColumnsAsc, | ||
); | ||
|
||
expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsAsc); | ||
}); | ||
|
||
cy.get(`[data-testid="${testInfo.sortButtonId}"]`).click(); | ||
|
||
getColumnTextFields(testInfo.columnId).then(columnTextFields => { | ||
const sortedColumnsTextFieldsDesc = [...columnTextFields] | ||
.sort(sortColumnsAsc) | ||
.reverse(); | ||
expect(columnTextFields).to.deep.equal(sortedColumnsTextFieldsDesc); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Mobile View', () => { | ||
beforeEach(() => { | ||
cy.viewport('iphone-5'); | ||
}); | ||
it('should update the dropdown value when user selects an option', () => { | ||
cy.get('[data-testid="docket-record-sort-select"]').should( | ||
'have.value', | ||
'byDate', | ||
); | ||
cy.get('[data-testid="docket-record-sort-select"]').select('byIndexDesc'); | ||
cy.get('[data-testid="docket-record-sort-select"]').should( | ||
'have.value', | ||
'byIndexDesc', | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
const getColumnTextFields = (dataTestId: string) => { | ||
return cy.get(`[data-testid^="${dataTestId}"]`).then($cells => { | ||
return $cells.toArray().map(cell => cell.innerText); | ||
}); | ||
}; | ||
|
||
function sortColumnsAsc(a: string, b: string) { | ||
const getPriority = (value: string) => { | ||
if (value === '') return 1; | ||
if (value?.toLocaleLowerCase() === 'not served') return 2; | ||
return 0; | ||
}; | ||
|
||
const priorityA = getPriority(a); | ||
const priorityB = getPriority(b); | ||
|
||
if (priorityA !== priorityB) return priorityA - priorityB; | ||
return a.localeCompare(b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.