From 882b4c37679c3a16feb0c9be5272f1c2a3461db7 Mon Sep 17 00:00:00 2001 From: Christopher Bisom Date: Mon, 23 Sep 2024 10:26:46 -0400 Subject: [PATCH 1/5] add getJudgesChambersSequence to openCompleteAndSendMessageModalSequence --- .../sequences/openCompleteAndSendMessageModalSequence.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web-client/src/presenter/sequences/openCompleteAndSendMessageModalSequence.ts b/web-client/src/presenter/sequences/openCompleteAndSendMessageModalSequence.ts index 72b6b6da4af..b94eaa911f4 100644 --- a/web-client/src/presenter/sequences/openCompleteAndSendMessageModalSequence.ts +++ b/web-client/src/presenter/sequences/openCompleteAndSendMessageModalSequence.ts @@ -1,6 +1,7 @@ import { clearModalStateAction } from '../actions/clearModalStateAction'; import { generateTitleAction } from '../actions/FileDocument/generateTitleAction'; import { getCaseAction } from '../actions/getCaseAction'; +import { getJudgesChambersSequence } from '@web-client/presenter/sequences/getJudgesChambersSequence'; import { isWorkItemAlreadyCompletedAction } from '../actions/isWorkItemAlreadyCompletedAction'; import { refreshExternalDocumentTitleFromEventCodeAction } from '../actions/FileDocument/refreshExternalDocumentTitleFromEventCodeAction'; import { setAlertErrorAction } from '../actions/setAlertErrorAction'; @@ -29,6 +30,7 @@ export const openCompleteAndSendMessageModalSequence = [ ], success: [ clearModalStateAction, + getJudgesChambersSequence, refreshExternalDocumentTitleFromEventCodeAction, setPreviousDocumentDocketEntryAction, generateTitleAction, From 686a22fd17b636a4ed9ce8285af2fe78bcbc2361 Mon Sep 17 00:00:00 2001 From: Christopher Bisom Date: Mon, 23 Sep 2024 10:30:21 -0400 Subject: [PATCH 2/5] also add to openForwardMessageModalSequence --- .../src/presenter/sequences/openForwardMessageModalSequence.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web-client/src/presenter/sequences/openForwardMessageModalSequence.ts b/web-client/src/presenter/sequences/openForwardMessageModalSequence.ts index 01cfc5e15d8..73ec32cead0 100644 --- a/web-client/src/presenter/sequences/openForwardMessageModalSequence.ts +++ b/web-client/src/presenter/sequences/openForwardMessageModalSequence.ts @@ -1,4 +1,5 @@ import { clearModalStateAction } from '../actions/clearModalStateAction'; +import { getJudgesChambersSequence } from '@web-client/presenter/sequences/getJudgesChambersSequence'; import { getMostRecentMessageInThreadAction } from '../actions/getMostRecentMessageInThreadAction'; import { setForwardMessageModalDialogModalStateAction } from '../actions/WorkItem/setForwardMessageModalDialogModalStateAction'; import { setShowModalFactoryAction } from '../actions/setShowModalFactoryAction'; @@ -6,6 +7,7 @@ import { setShowModalFactoryAction } from '../actions/setShowModalFactoryAction' export const openForwardMessageModalSequence = [ clearModalStateAction, getMostRecentMessageInThreadAction, + getJudgesChambersSequence, setForwardMessageModalDialogModalStateAction, setShowModalFactoryAction('ForwardMessageModal'), ]; From 13102ad8f2cdc13fbdf3d77ae10310dba24747fe Mon Sep 17 00:00:00 2001 From: Christopher Bisom Date: Mon, 23 Sep 2024 11:58:43 -0400 Subject: [PATCH 3/5] 10501-bug: add tests --- .../local-only/support/pages/document-qc.ts | 12 +++- .../messages/chambers-dropdown.cy.ts | 60 +++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts diff --git a/cypress/local-only/support/pages/document-qc.ts b/cypress/local-only/support/pages/document-qc.ts index d3a474d2f84..7e23c4fe565 100644 --- a/cypress/local-only/support/pages/document-qc.ts +++ b/cypress/local-only/support/pages/document-qc.ts @@ -37,14 +37,22 @@ export const fillOutMessageField = () => { cy.get('#message').clear().type("I don't appreciate your lack of sarcasm."); }; -export const enterSubject = () => { - cy.get('#subject').clear().type('Demeanor'); +export const enterSubject = (subject?: string) => { + cy.get('#subject') + .clear() + .type(subject || 'Demeanor'); }; export const sendMessage = () => { cy.get('#confirm').click(); }; +export const forwardMessage = (messageSubject: string) => { + cy.get('#tab-case-messages').click(); + cy.contains('a', messageSubject).click(); + cy.get('#button-forward').click(); +}; + export const progressIndicatorDoesNotExist = () => { cy.get('.progress-indicator').should('not.exist'); }; diff --git a/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts new file mode 100644 index 00000000000..20e17231bdf --- /dev/null +++ b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts @@ -0,0 +1,60 @@ +// make sure the chambers dropdown works in open message, qc, and forward + +import { + createMessage, + enterSubject, + fillOutMessageField, + forwardMessage, + goToDocumentNeedingQC, + openCompleteAndSendMessageDialog, + selectChambers, + selectRecipient, + selectSection, + sendMessage, +} from '../../../support/pages/document-qc'; +import { goToCase } from '../../../../helpers/caseDetail/go-to-case'; +import { loginAsDocketClerk } from '../../../../helpers/authentication/login-as-helpers'; +import { v4 } from 'uuid'; + +describe('BUG: chambers dropdown should be populated in message modals', () => { + const chambersSection = 'buchsChambers'; + const recipient = 'Judge Buch'; + + it('should have nonempty chambers section in create new message modal', () => { + loginAsDocketClerk(); + goToCase('103-20'); + createMessage(); + + selectSection('Chambers'); + selectChambers(chambersSection); + selectRecipient(recipient); + }); + + it('should have nonempty chambers sections in forward message modal', () => { + loginAsDocketClerk(); + goToCase('103-20'); + createMessage(); + selectSection('Docket'); + selectRecipient('Test Docketclerk'); + const subject = v4(); + enterSubject(subject); + fillOutMessageField(); + sendMessage(); + forwardMessage(subject); + + selectSection('Chambers'); + selectChambers(chambersSection); + selectRecipient(recipient); + }); + + it('should have nonempty chambers sections in docket QC complete and send message modal', () => { + cy.login('docketclerk', '/document-qc/section/inbox'); + cy.get('.big-blue-header').should('exist'); + goToDocumentNeedingQC(); + openCompleteAndSendMessageDialog(); + + selectSection('Chambers'); + selectChambers(chambersSection); + selectRecipient(recipient); + }); +}); From 821207d70c0e5b3954b1c896a4772f57514e2c12 Mon Sep 17 00:00:00 2001 From: Christopher Bisom Date: Mon, 23 Sep 2024 12:12:14 -0400 Subject: [PATCH 4/5] 10501-bug: update tests after discovering the forward message test could pass spuriously due to caching --- .../messages/chambers-dropdown.cy.ts | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts index 20e17231bdf..b831d54268a 100644 --- a/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts +++ b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts @@ -19,10 +19,28 @@ import { v4 } from 'uuid'; describe('BUG: chambers dropdown should be populated in message modals', () => { const chambersSection = 'buchsChambers'; const recipient = 'Judge Buch'; + const caseNumber = '103-20'; + let messageToForwardSubject = ''; + + before(() => { + // Send a message that we will forward later. + // We do this here rather than in the message forward test itself because + // judgesChambers are cached, so the message forward test could + // "pass" when it shouldn't if we create a message (and populate cache) first. + loginAsDocketClerk(); + goToCase(caseNumber); + createMessage(); + selectSection('Docket'); + selectRecipient('Test Docketclerk'); + messageToForwardSubject = v4(); + enterSubject(messageToForwardSubject); + fillOutMessageField(); + sendMessage(); + }); it('should have nonempty chambers section in create new message modal', () => { loginAsDocketClerk(); - goToCase('103-20'); + goToCase(caseNumber); createMessage(); selectSection('Chambers'); @@ -32,15 +50,8 @@ describe('BUG: chambers dropdown should be populated in message modals', () => { it('should have nonempty chambers sections in forward message modal', () => { loginAsDocketClerk(); - goToCase('103-20'); - createMessage(); - selectSection('Docket'); - selectRecipient('Test Docketclerk'); - const subject = v4(); - enterSubject(subject); - fillOutMessageField(); - sendMessage(); - forwardMessage(subject); + goToCase(caseNumber); + forwardMessage(messageToForwardSubject); selectSection('Chambers'); selectChambers(chambersSection); From f06381177a07e4ef5300db26f7aa97081e04bcdb Mon Sep 17 00:00:00 2001 From: Christopher Bisom Date: Mon, 23 Sep 2024 12:37:04 -0400 Subject: [PATCH 5/5] 10501-bug: no good reason to set messageToForwardSubject in the before hook --- .../tests/integration/messages/chambers-dropdown.cy.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts index b831d54268a..d0512dbd823 100644 --- a/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts +++ b/cypress/local-only/tests/integration/messages/chambers-dropdown.cy.ts @@ -20,7 +20,7 @@ describe('BUG: chambers dropdown should be populated in message modals', () => { const chambersSection = 'buchsChambers'; const recipient = 'Judge Buch'; const caseNumber = '103-20'; - let messageToForwardSubject = ''; + const messageToForwardSubject = v4(); before(() => { // Send a message that we will forward later. @@ -32,7 +32,6 @@ describe('BUG: chambers dropdown should be populated in message modals', () => { createMessage(); selectSection('Docket'); selectRecipient('Test Docketclerk'); - messageToForwardSubject = v4(); enterSubject(messageToForwardSubject); fillOutMessageField(); sendMessage();