diff --git a/app/src/assets/localization/en/run_details.json b/app/src/assets/localization/en/run_details.json index a785feb6658c..67d20eb43052 100644 --- a/app/src/assets/localization/en/run_details.json +++ b/app/src/assets/localization/en/run_details.json @@ -128,5 +128,9 @@ "latching_hs_latch": "Latching labware on Heater-Shaker", "deactivate_hs_shake": "Deactivating shaker", "wait_for_duration": "Pause for {{seconds}} seconds", - "tc_run_profile_steps": "temperature: {{celsius}}°C, seconds: {{seconds}}" + "tc_run_profile_steps": "temperature: {{celsius}}°C, seconds: {{seconds}}", + "aspirate": "Aspirating {{volume}} uL from {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec", + "dispense": "Dispensing {{volume}} uL into {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec", + "blowout": "Blowing out at {{well_name}} of {{labware}} in {{labware_location}} at {{flowRate}} uL/sec", + "touch_tip": "Touching tip" } diff --git a/app/src/organisms/Devices/ProtocolRun/StepText.tsx b/app/src/organisms/Devices/ProtocolRun/StepText.tsx index 1d088bf9c2ec..80f679fd6057 100644 --- a/app/src/organisms/Devices/ProtocolRun/StepText.tsx +++ b/app/src/organisms/Devices/ProtocolRun/StepText.tsx @@ -250,6 +250,82 @@ export function StepText(props: Props): JSX.Element | null { messageNode = t('wait_for_duration', { seconds: seconds }) break } + case 'aspirate': { + const { wellName, labwareId, volume, flowRate } = displayCommand.params + const labwareLocation = getLabwareLocation( + labwareId, + protocolData.commands + ) + messageNode = ( + + ) + + break + } + case 'dispense': { + const { wellName, labwareId, volume, flowRate } = displayCommand.params + const labwareLocation = getLabwareLocation( + labwareId, + protocolData.commands + ) + messageNode = ( + + ) + + break + } + case 'blowout': { + const { wellName, labwareId, flowRate } = displayCommand.params + const labwareLocation = getLabwareLocation( + labwareId, + protocolData.commands + ) + messageNode = ( + + ) + + break + } + case 'touchTip': { + messageNode = t('touch_tip') + break + } + case 'custom': { const { legacyCommandText } = displayCommand.params ?? {} const sanitizedCommandText = diff --git a/app/src/organisms/Devices/ProtocolRun/__tests__/StepText.test.tsx b/app/src/organisms/Devices/ProtocolRun/__tests__/StepText.test.tsx index 51f630db6db4..c2ccbd6ede6a 100644 --- a/app/src/organisms/Devices/ProtocolRun/__tests__/StepText.test.tsx +++ b/app/src/organisms/Devices/ProtocolRun/__tests__/StepText.test.tsx @@ -702,4 +702,111 @@ describe('StepText', () => { }) getByText('Pause for 60 seconds') }) + it('renders correct command text for aspirate', () => { + const labwareId = 'labwareId' + when(mockGetLabwareDisplayName) + .calledWith('fake_def' as any) + .mockReturnValue('fake_display_name') + when(mockGetLabwareLocation) + .calledWith(labwareId, []) + .mockReturnValue({ slotName: 'fake_labware_location' }) + mockUseLabwareRenderInfoForRunById.mockReturnValue({ + labwareId: { + labwareDef: 'fake_def', + }, + } as any) + const { getByText } = render({ + robotName: ROBOT_NAME, + runId: RUN_ID, + analysisCommand: null, + runCommand: { + ...MOCK_COMMAND_SUMMARY, + commandType: 'aspirate', + params: { + volume: 100, + flowRate: 130, + wellName: 'wellName', + labwareId: 'labwareId', + }, + }, + }) + getByText( + 'Aspirating 100 uL from wellName of fake_display_name in fake_labware_location at 130 uL/sec' + ) + }) + it('renders correct command text for dispense', () => { + const labwareId = 'labwareId' + when(mockGetLabwareDisplayName) + .calledWith('fake_def' as any) + .mockReturnValue('fake_display_name') + when(mockGetLabwareLocation) + .calledWith(labwareId, []) + .mockReturnValue({ slotName: 'fake_labware_location' }) + mockUseLabwareRenderInfoForRunById.mockReturnValue({ + labwareId: { + labwareDef: 'fake_def', + }, + } as any) + const { getByText } = render({ + robotName: ROBOT_NAME, + runId: RUN_ID, + analysisCommand: null, + runCommand: { + ...MOCK_COMMAND_SUMMARY, + commandType: 'dispense', + params: { + volume: 100, + flowRate: 130, + wellName: 'wellName', + labwareId: 'labwareId', + }, + }, + }) + getByText( + 'Dispensing 100 uL into wellName of fake_display_name in fake_labware_location at 130 uL/sec' + ) + }) + it('renders correct command text for blowout', () => { + const labwareId = 'labwareId' + when(mockGetLabwareDisplayName) + .calledWith('fake_def' as any) + .mockReturnValue('fake_display_name') + when(mockGetLabwareLocation) + .calledWith(labwareId, []) + .mockReturnValue({ slotName: 'fake_labware_location' }) + mockUseLabwareRenderInfoForRunById.mockReturnValue({ + labwareId: { + labwareDef: 'fake_def', + }, + } as any) + const { getByText } = render({ + robotName: ROBOT_NAME, + runId: RUN_ID, + analysisCommand: null, + runCommand: { + ...MOCK_COMMAND_SUMMARY, + commandType: 'blowout', + params: { + flowRate: 130, + wellName: 'wellName', + labwareId: 'labwareId', + }, + }, + }) + getByText( + 'Blowing out at wellName of fake_display_name in fake_labware_location at 130 uL/sec' + ) + }) + it('renders correct command text for touchTip', () => { + const { getByText } = render({ + robotName: ROBOT_NAME, + runId: RUN_ID, + analysisCommand: null, + runCommand: { + ...MOCK_COMMAND_SUMMARY, + commandType: 'touchTip', + }, + }) + getByText('Touching tip') + }) })