-
Notifications
You must be signed in to change notification settings - Fork 47
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
10464 Bug: Invalid documents in scenario dropdowns #5256
10464 Bug: Invalid documents in scenario dropdowns #5256
Conversation
const mockDocuments = MOCK_DOCUMENTS.map(d => { | ||
return { | ||
...d, | ||
isOnDocketRecord: true, | ||
isStricken: false, | ||
servedAt: '2019-08-25T05:00:00.000Z', | ||
}; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MOCK_DOCUMENTS
is used in a lot of places. I modified them here in the tests as needed to avoid affecting other tests.
const formattedCaseDetail = applicationContext | ||
.getUtilities() | ||
.getFormattedCaseDetail({ | ||
applicationContext, | ||
caseDetail, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have logic on this function to determine if a document has been served or not.
…o be selectable in selectDocumentTypeHelper.ts
2418ece
to
4644153
Compare
@@ -733,6 +733,7 @@ export const baseState = { | |||
pdfsAppended: 0, | |||
totalPdfs: 0, | |||
}, | |||
parentMessageId: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were last-minute additions to 10102, in staging but not in test.
@@ -17,7 +16,6 @@ export const editUnsignedDraftDocumentSequence = [ | |||
isStatusReportOrder: [ | |||
setEditStatusReportOrderFormAction, | |||
navigateToPathAction, | |||
statusReportOrderPdfPreviewSequence, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to #5254, I discovered this is a redundant call. I'm slipping it into this PR to avoid a whole new branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as you tell me you have high confidence that our test suite covers the functionality this would impact on the slim chance something did go wrong with this, then I think it's reasonable 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to having tested manually, I've just double-checked that edit-status-report-order.cy.ts
does check this (and fails successfully when I modify things further). Also, I've walked through the logic just to make sure I'm not lying to myself and taking advantage of your trust 🤣
We call statusReportOrderPdfPreviewSequence.ts
in three places:
navigateToEditOrderSequence.ts
-- to show an existing order pdf if the user is editinggotoStatusReportOrderSequence.ts
-- to show an existing order pdf if the user is editingStatusReportOrder.tsx
-- to show the pdf when the user clicks "Preview"
In navigateToEditOrderSequence.ts
, in the case of a status report order, we navigate to one of two "status-report-order-edit" routes, which both call gotoStatusReportOrderSequence.ts
. However, in these edit cases, gotoStatusReportOrderSequence.ts
itself calls statusReportOrderPdfPreviewSequence.ts
. So any call to statusReportOrderPdfPreviewSequence.ts
in navigateToEditOrderSequence.ts
will always precede the call to statusReportOrderPdfPreviewSequence.ts
in gotoStatusReportOrderSequence.ts
and can thus be eliminated.
@@ -3,4 +3,4 @@ import { setFormValueAction } from '../../actions/setFormValueAction'; | |||
export const updateStatusReportOrderFormValueSequence = [ | |||
setFormValueAction, | |||
clearJurisdictionRadioAction, | |||
] as unknown as (props: { key: string; value: any }) => void; | |||
] as unknown as (props: { key: string; value: string | boolean }) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a last-minute addition to 10102, in staging but not in test.
|
||
export type ViewerDocument = { | ||
docketEntryId: string; | ||
documentTitle?: string; // Should this be required? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we can guarantee that there will be a documentTitle here, so I think this is correct
We do not want to show unserved, undocketed, or stricken documents from "What Document are You Filing?" dropdowns. This PR enforces these checks and updates tests accordingly.