-
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' of github.com:ustaxcourt/ef-cms into 10285-des…
…ign-debt
- Loading branch information
Showing
13 changed files
with
261 additions
and
558 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 |
---|---|---|
|
@@ -84,7 +84,12 @@ export function loginAsDocketClerk() { | |
} | ||
|
||
export function loginAsDocketClerk1() { | ||
cy.login('docketclerk1'); | ||
login({ email: '[email protected]' }); | ||
cy.get('[data-testid="inbox-tab-content"]').should('exist'); | ||
} | ||
|
||
export function loginAsClerkOfCourt() { | ||
login({ email: '[email protected]' }); | ||
cy.get('[data-testid="inbox-tab-content"]').should('exist'); | ||
} | ||
|
||
|
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
134 changes: 134 additions & 0 deletions
134
...-only/tests/integration/caseDetail/docketRecord/courtIssuedFiling/judge-stamp-order.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,134 @@ | ||
import { attachFile } from '../../../../../../helpers/file/upload-file'; | ||
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, | ||
selectChambers, | ||
selectRecipient, | ||
selectSection, | ||
sendMessage, | ||
} from '../../../../../support/pages/document-qc'; | ||
import { goToCase } from '../../../../../../helpers/caseDetail/go-to-case'; | ||
import { | ||
loginAsColvin, | ||
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, apply a stamp to it, then redirect to Drafts of case detail', () => { | ||
loginAsPetitioner(); | ||
petitionerCreatesElectronicCaseWithSpouse().then(docketNumber => { | ||
petitionsClerkServesPetition(docketNumber); | ||
|
||
cy.login('docketclerk1', `case-detail/${docketNumber}`); | ||
|
||
// File Motion for Continuance | ||
cy.get('[data-testid="case-detail-menu-button"]').click(); | ||
cy.get('[data-testid="menu-button-add-paper-filing"]').click(); | ||
cy.get('input#date-received-picker').type('11/01/2023'); | ||
selectTypeaheadInput( | ||
'primary-document-type-search', | ||
'Motion for Continuance', | ||
); | ||
cy.get('[data-testid="filed-by-option"]').contains('Petitioner').click(); | ||
cy.get('[data-testid="upload-pdf-button"]').click(); | ||
attachFile({ | ||
filePath: '../../helpers/file/sample.pdf', | ||
selector: 'input#primaryDocumentFile-file', | ||
selectorToAwaitOnSuccess: '[data-testid="remove-pdf"]', | ||
}); | ||
cy.get('[data-testid="save-and-serve"]').click(); | ||
cy.get('[data-testid="modal-button-confirm"]').click(); | ||
cy.get('.usa-alert').should( | ||
'contain', | ||
'Print and mail to complete paper service.', | ||
); | ||
|
||
// Apply a stamp | ||
loginAsColvin(); | ||
cy.get('.message-document-title > [data-testid="message-header-link"]') | ||
.first() | ||
.click(); | ||
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(); | ||
cy.get('input#due-date-input-statusReportDueDate-picker').type( | ||
'11/02/2023', | ||
); | ||
cy.get('input#due-date-input-statusReportDueDate-picker').should( | ||
'have.value', | ||
'11/02/2023', | ||
); | ||
cy.get('[data-testid="clear-optional-fields"]').click(); | ||
cy.get('[data-testid="status-report-or-stip-decision-due-date"]').click(); | ||
cy.get('input#due-date-input-statusReportDueDate-picker').should( | ||
'have.value', | ||
'', | ||
); | ||
|
||
// Apply stamp | ||
cy.get('[data-testid="clear-optional-fields"]').click(); | ||
cy.get('[data-testid="motion-disposition-Granted"]').click(); | ||
cy.get('[data-testid="save-signature-button"]').click(); | ||
|
||
// Make sure it's there | ||
cy.get('[data-testid="success-alert"]').contains( | ||
'Motion for Continuance stamped successfully.', | ||
); | ||
cy.get('[data-testid="docket-entry-description-1"]').contains( | ||
'Motion for Continuance GRANTED', | ||
); | ||
}); | ||
}); | ||
|
||
it('should allow judge to stamp motion from Message View and redirect to MessageDetail', () => { | ||
createAndServePaperPetition().then(({ docketNumber }) => { | ||
loginAsDocketClerk1(); | ||
goToCase(docketNumber); | ||
createAndServePaperFiling('Motion to Proceed Remotely', '01/01/2022'); | ||
cy.get( | ||
'[data-testid="docket-record-table"] td:contains("Motion to Proceed Remotely")', | ||
) | ||
.parent() | ||
.invoke('attr', 'data-testid') | ||
.then(docketEntryId => { | ||
createMessage(); | ||
selectSection('Chambers'); | ||
selectChambers('colvinsChambers'); | ||
selectRecipient('Judge Colvin'); | ||
enterSubject(); | ||
fillOutMessageField(); | ||
cy.get('[data-testid="select-document"]').select(docketEntryId!); | ||
sendMessage(); | ||
loginAsColvin(); | ||
cy.get('tbody') | ||
.contains('td.message-queue-row', docketNumber) | ||
.parents('tbody') | ||
.within(() => { | ||
cy.get( | ||
'div.message-document-title a[data-testid="message-header-link"]', | ||
).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'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
41 changes: 41 additions & 0 deletions
41
web-api/src/persistence/postgres/messages/createMessageAsReply.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,41 @@ | ||
import { Message, RawMessage } from '@shared/business/entities/Message'; | ||
import { getDbWriter } from '@web-api/database'; | ||
import { getMessageThreadByParentId } from '@web-api/persistence/postgres/messages/getMessageThreadByParentId'; | ||
import { toKyselyNewMessage } from './mapper'; | ||
|
||
export const createMessageAsReply = async ({ | ||
newMessage, | ||
parentMessageId, | ||
}: { | ||
parentMessageId: string; | ||
newMessage: RawMessage; | ||
}): Promise<RawMessage> => { | ||
const messages = await getMessageThreadByParentId({ | ||
parentMessageId, | ||
}); | ||
|
||
const createdMessage = await getDbWriter( | ||
async writer => | ||
await writer.transaction().execute(async trx => { | ||
if (messages?.length) { | ||
await trx | ||
.updateTable('dwMessage') | ||
.set({ | ||
isRepliedTo: true, | ||
}) | ||
.where('parentMessageId', '=', parentMessageId) | ||
.execute(); | ||
} | ||
|
||
return await trx | ||
.insertInto('dwMessage') | ||
.values(toKyselyNewMessage(newMessage)) | ||
.returningAll() | ||
.executeTakeFirstOrThrow(() => { | ||
throw new Error('could not create a message'); | ||
}); | ||
}), | ||
); | ||
|
||
return new Message(createdMessage); | ||
}; |
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
Oops, something went wrong.