File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
app/src/organisms/RunDetails Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -126,8 +126,15 @@ export function CommandText(props: Props): JSX.Element | null {
126
126
break
127
127
}
128
128
case 'custom' : {
129
+ const { legacyCommandText } = displayCommand . params ?? { }
130
+ const sanitizedCommandText =
131
+ typeof legacyCommandText === 'object'
132
+ ? JSON . stringify ( legacyCommandText )
133
+ : String ( legacyCommandText )
129
134
messageNode =
130
- displayCommand . params ?. legacyCommandText ?? displayCommand . commandType
135
+ legacyCommandText != null
136
+ ? sanitizedCommandText
137
+ : displayCommand . commandType
131
138
break
132
139
}
133
140
default : {
Original file line number Diff line number Diff line change @@ -158,4 +158,19 @@ describe('CommandText', () => {
158
158
'Picking up tip from wellName of fake_display_name in fake_labware_location'
159
159
)
160
160
} )
161
+
162
+ it ( 'renders correct command text for for legacy command with non-string text' , ( ) => {
163
+ const { getByText } = render ( {
164
+ analysisCommand : null ,
165
+ runCommand : {
166
+ ...MOCK_COMMAND_SUMMARY ,
167
+ commandType : 'custom' ,
168
+ params : {
169
+ legacyCommandType : 'anyLegacyCommand' ,
170
+ legacyCommandText : { someKey : [ 'someValue' , 'someOtherValue' ] } ,
171
+ } ,
172
+ } ,
173
+ } )
174
+ getByText ( '{"someKey":["someValue","someOtherValue"]}' )
175
+ } )
161
176
} )
You can’t perform that action at this time.
0 commit comments