Skip to content

Commit

Permalink
fix(app): Update tip detection logic (#15955)
Browse files Browse the repository at this point in the history
Closes RQA-2935
  • Loading branch information
mjhuff authored Aug 9, 2024
1 parent 42db1ee commit def8db3
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 220 deletions.
6 changes: 1 addition & 5 deletions app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
useModulesQuery,
useDoorQuery,
useHost,
useInstrumentsQuery,
useRunCommandErrors,
} from '@opentrons/react-api-client'
import { FLEX_ROBOT_TYPE, OT2_ROBOT_TYPE } from '@opentrons/shared-data'
Expand Down Expand Up @@ -166,7 +165,6 @@ export function ProtocolRunHeader({
const isRobotViewable = useIsRobotViewable(robotName)
const runStatus = useRunStatus(runId)
const { analysisErrors } = useProtocolAnalysisErrors(runId)
const { data: attachedInstruments } = useInstrumentsQuery()
const isRunCurrent = Boolean(useNotifyRunQuery(runId)?.data?.data?.current)
const mostRecentRunId = useMostRecentRunId()
const { closeCurrentRun, isClosingCurrentRun } = useCloseCurrentRun()
Expand Down Expand Up @@ -224,10 +222,8 @@ export function ProtocolRunHeader({
aPipetteWithTip,
} = useTipAttachmentStatus({
runId,
runRecord,
attachedInstruments,
runRecord: runRecord ?? null,
host,
isFlex,
})
const {
showDTModal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { getPipettesWithTipAttached } from '../getPipettesWithTipAttached'
import { getPipetteModelSpecs } from '@opentrons/shared-data'
import { DropTipWizard } from '../DropTipWizard'
import { useInstrumentsQuery } from '@opentrons/react-api-client'

import type { Mock } from 'vitest'
import type { PipetteModelSpecs } from '@opentrons/shared-data'
Expand All @@ -28,6 +29,7 @@ vi.mock('@opentrons/shared-data', async importOriginal => {
vi.mock('../DropTipWizard')
vi.mock('../getPipettesWithTipAttached')
vi.mock('../hooks')
vi.mock('@opentrons/react-api-client')

const MOCK_ACTUAL_PIPETTE = {
...mockPipetteInfo.pipetteSpecs,
Expand Down Expand Up @@ -60,6 +62,7 @@ describe('useTipAttachmentStatus', () => {
vi.mocked(getPipetteModelSpecs).mockReturnValue(MOCK_ACTUAL_PIPETTE)
vi.mocked(DropTipWizard).mockReturnValue(<div>MOCK DROP TIP WIZ</div>)
mockGetPipettesWithTipAttached.mockResolvedValue(mockPipettesWithTip)
vi.mocked(useInstrumentsQuery).mockReturnValue({ data: {} } as any)
})

afterEach(() => {
Expand Down
Loading

0 comments on commit def8db3

Please sign in to comment.