Skip to content

Commit

Permalink
fix(app): fix RunProgressMeter currnet step
Browse files Browse the repository at this point in the history
Add a condition to reflecet the status correctly

close RQA-1632
  • Loading branch information
koji committed Oct 9, 2023
1 parent 11b35ed commit 9332e3f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
useCommandQuery,
useRunQuery,
} from '@opentrons/react-api-client'
import { RUN_STATUS_IDLE, RUN_STATUS_RUNNING } from '@opentrons/api-client'
import {
RUN_STATUS_IDLE,
RUN_STATUS_RUNNING,
RUN_STATUS_SUCCEEDED,
} from '@opentrons/api-client'

import { i18n } from '../../../i18n'
import { InterventionModal } from '../../InterventionModal'
Expand Down Expand Up @@ -143,4 +147,11 @@ describe('RunProgressMeter', () => {
const { findByText } = render(props)
expect(await findByText('MOCK INTERVENTION MODAL')).toBeTruthy()
})

it('should render the correct run status when run status is completed', () => {
mockUseCommandQuery.mockReturnValue({ data: null } as any)
mockUseRunStatus.mockReturnValue(RUN_STATUS_SUCCEEDED)
const { getByText } = render(props)
getByText('Protocol completed')
})
})
4 changes: 3 additions & 1 deletion app/src/organisms/RunProgressMeter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export function RunProgressMeter(props: RunProgressMeterProps): JSX.Element {
)
} else if (
analysis != null &&
analysisCommands[lastRunAnalysisCommandIndex] != null
analysisCommands[lastRunAnalysisCommandIndex] != null &&
runStatus != null &&
!TERMINAL_RUN_STATUSES.includes(runStatus)
) {
currentStepContents = (
<CommandText
Expand Down

0 comments on commit 9332e3f

Please sign in to comment.