File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
app/proposals/[proposalId]/sessions/[visitNumber]/shipments/[shipmentId]/(default) Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,19 @@ describe("Sample Collection Submission Overview", () => {
5656 expect ( screen . getAllByRole ( "group" ) [ 0 ] ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
5757 } ) ;
5858
59+ it ( "should not enable 'edit pre-session information' button if session is locked" , async ( ) => {
60+ server . use (
61+ http . get (
62+ "http://localhost/api/shipments/:shipmentId/preSession" ,
63+ ( ) => HttpResponse . json ( { details : { } , isLocked : true } ) ,
64+ { once : true } ,
65+ ) ,
66+ ) ;
67+ renderWithProviders ( await ShipmentHome ( baseShipmentParams ) ) ;
68+
69+ expect ( screen . getAllByRole ( "group" ) [ 1 ] ) . toHaveAttribute ( "aria-disabled" , "true" ) ;
70+ } ) ;
71+
5972 it ( "should not enable 'print pre-session' button if no pre-session data is available" , async ( ) => {
6073 server . use (
6174 http . get (
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ const ShipmentHome = async (props: { params: Promise<ShipmentParams> }) => {
130130 Pre-Session Information
131131 </ Heading >
132132 < Divider borderColor = 'gray.800' />
133- { shipmentData . preSessionInfo ? (
133+ { shipmentData . preSessionInfo ?. details ? (
134134 < DynamicFormView
135135 formType = 'preSession'
136136 data = { shipmentData . preSessionInfo . details }
@@ -156,7 +156,10 @@ const ShipmentHome = async (props: { params: Promise<ShipmentParams> }) => {
156156 title = { `${ shipmentData . preSessionInfo ? "Edit" : "Set" } Pre-Session Information` }
157157 as = { NextLink }
158158 href = { `${ params . shipmentId } /pre-session` }
159- isDisabled = { ! ! shipmentData . dispatch . shipmentRequest }
159+ isDisabled = {
160+ ! shipmentData . preSessionInfo ||
161+ ! ! shipmentData . preSessionInfo . isLocked
162+ }
160163 >
161164 Set imaging conditions, grid/data acquisition parameters
162165 </ TwoLineLink >
Original file line number Diff line number Diff line change @@ -789,6 +789,11 @@ export interface components {
789789 PreSessionOut : {
790790 /** Details */
791791 details ?: Record < string , never > | null ;
792+ /**
793+ * Islocked
794+ * @default false
795+ */
796+ isLocked : boolean ;
792797 } ;
793798 /** SampleIn */
794799 SampleIn : {
You can’t perform that action at this time.
0 commit comments