Skip to content
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

refactor(app,api-client): Delete bindings to nonexistent pause-requested run status #15476

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Delete more RUN_STATUS_PAUSE_REQUESTED references.
  • Loading branch information
SyntaxColoring committed Jun 21, 2024
commit 18c5a208c014d12c1b2786adbb7b0fdba6598cac
4 changes: 0 additions & 4 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Link, useHistory } from 'react-router-dom'
import {
RUN_STATUS_IDLE,
RUN_STATUS_RUNNING,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_PAUSED,
RUN_STATUS_STOP_REQUESTED,
RUN_STATUS_STOPPED,
Expand Down Expand Up @@ -113,7 +112,6 @@ const EQUIPMENT_POLL_MS = 5000
const CANCELLABLE_STATUSES = [
RUN_STATUS_RUNNING,
RUN_STATUS_PAUSED,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_BLOCKED_BY_OPEN_DOOR,
RUN_STATUS_IDLE,
RUN_STATUS_AWAITING_RECOVERY,
Expand Down Expand Up @@ -517,7 +515,6 @@ function DisplayRunStatus(props: DisplayRunStatusProps): JSX.Element {
const START_RUN_STATUSES: RunStatus[] = [
RUN_STATUS_IDLE,
RUN_STATUS_PAUSED,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_BLOCKED_BY_OPEN_DOOR,
]
const RUN_AGAIN_STATUSES: RunStatus[] = [
Expand All @@ -528,7 +525,6 @@ const RUN_AGAIN_STATUSES: RunStatus[] = [
]
const DISABLED_STATUSES: RunStatus[] = [
RUN_STATUS_FINISHING,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_STOP_REQUESTED,
RUN_STATUS_BLOCKED_BY_OPEN_DOOR,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
RUN_STATUS_IDLE,
RUN_STATUS_RUNNING,
RUN_STATUS_PAUSED,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_STOP_REQUESTED,
RUN_STATUS_STOPPED,
RUN_STATUS_FAILED,
Expand Down Expand Up @@ -49,7 +48,6 @@ import {
mockFailedRun,
mockIdleUnstartedRun,
mockPausedRun,
mockPauseRequestedRun,
mockRunningRun,
mockStoppedRun,
mockStopRequestedRun,
Expand Down Expand Up @@ -579,24 +577,6 @@ describe('ProtocolRunHeader', () => {
})
})

it('renders a disabled Resume Run button and when pause requested', () => {
when(vi.mocked(useNotifyRunQuery))
.calledWith(RUN_ID)
.thenReturn({
data: { data: mockPauseRequestedRun },
} as UseQueryResult<OpentronsApiClient.Run>)
when(vi.mocked(useRunStatus))
.calledWith(RUN_ID)
.thenReturn(RUN_STATUS_PAUSE_REQUESTED)

render()

const button = screen.getByRole('button', { name: 'Resume run' })
expect(button).toBeDisabled()
screen.getByRole('button', { name: 'Cancel run' })
screen.getByText('Pause requested')
})

it('renders a disabled Canceling Run button and when stop requested', () => {
when(vi.mocked(useNotifyRunQuery))
.calledWith(RUN_ID)
Expand Down
2 changes: 0 additions & 2 deletions app/src/organisms/Devices/hooks/useLastRunCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
RUN_STATUS_FINISHING,
RUN_STATUS_IDLE,
RUN_STATUS_PAUSED,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_RUNNING,
RUN_STATUS_STOP_REQUESTED,
} from '@opentrons/api-client'
Expand All @@ -18,7 +17,6 @@ import type { CommandsData, RunCommandSummary } from '@opentrons/api-client'
const LIVE_RUN_STATUSES = [
RUN_STATUS_IDLE,
RUN_STATUS_PAUSED,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_STOP_REQUESTED,
RUN_STATUS_RUNNING,
RUN_STATUS_FINISHING,
Expand Down
27 changes: 0 additions & 27 deletions app/src/organisms/RunTimeControl/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
RUN_ACTION_TYPE_PAUSE,
RUN_ACTION_TYPE_STOP,
RUN_STATUS_IDLE,
RUN_STATUS_PAUSE_REQUESTED,
RUN_STATUS_PAUSED,
RUN_STATUS_RUNNING,
RUN_STATUS_SUCCEEDED,
Expand Down Expand Up @@ -45,32 +44,6 @@ export const mockPausedRun: RunData = {
runTimeParameters: [],
}

export const mockPauseRequestedRun: RunData = {
id: RUN_ID_1,
createdAt: '2021-10-07T18:44:49.366581+00:00',
current: true,
status: RUN_STATUS_PAUSE_REQUESTED,
protocolId: PROTOCOL_ID,
actions: [
{
id: '1',
createdAt: '2021-10-25T12:54:53.366581+00:00',
actionType: RUN_ACTION_TYPE_PLAY,
},
{
id: '2',
createdAt: '2021-10-25T13:23:31.366581+00:00',
actionType: RUN_ACTION_TYPE_PAUSE,
},
],
errors: [],
pipettes: [],
labware: [],
modules: [],
liquids: [],
runTimeParameters: [],
}

export const mockRunningRun: RunData = {
id: RUN_ID_2,
createdAt: '2021-10-07T18:44:49.366581+00:00',
Expand Down
Loading