Skip to content

Commit

Permalink
fixup tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoster1 committed Oct 22, 2024
1 parent d1ac787 commit 9641102
Showing 1 changed file with 28 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ import { useDeckConfigurationCompatibility } from '/app/resources/deck_configura
import { useRobot, useIsFlex } from '/app/redux-resources/robots'
import { useRequiredSetupStepsInOrder } from '/app/redux-resources/runs'
import { useStoredProtocolAnalysis } from '/app/resources/analysis'
import {
updateRunSetupStepsComplete,

Check failure on line 36 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

'updateRunSetupStepsComplete' is defined but never used

Check failure on line 36 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

'updateRunSetupStepsComplete' is defined but never used
getMissingSetupSteps,
} from '/app/redux/protocol-runs'

import { SetupLabware } from '../SetupLabware'
import { SetupRobotCalibration } from '../SetupRobotCalibration'
Expand All @@ -41,6 +45,8 @@ import { EmptySetupStep } from '../EmptySetupStep'
import { ProtocolRunSetup } from '../ProtocolRunSetup'
import * as ReduxRuns from '/app/redux/protocol-runs'

import type { State } from '/app/redux/types'

import type { StepKey } from '/app/redux/protocol-runs'

Check failure on line 50 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

'StepKey' is defined but never used

Check failure on line 50 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

'StepKey' is defined but never used

import type * as SharedData from '@opentrons/shared-data'
Expand All @@ -59,6 +65,8 @@ vi.mock('/app/resources/runs/useUnmatchedModulesForProtocol')
vi.mock('/app/resources/runs/useModuleCalibrationStatus')
vi.mock('/app/resources/runs/useProtocolAnalysisErrors')
vi.mock('/app/redux/config')
vi.mock('/app/redux/protocol-runs')
vi.mock('/app/resources/protocol-runs')
vi.mock('/app/resources/deck_configuration/utils')
vi.mock('/app/resources/deck_configuration/hooks')
vi.mock('/app/redux-resources/robots')
Expand All @@ -79,13 +87,14 @@ const ROBOT_NAME = 'otie'
const RUN_ID = '1'
const MOCK_PROTOCOL_LIQUID_KEY = { liquids: [] }
const render = () => {
return renderWithProviders(
return renderWithProviders<State>(
<ProtocolRunSetup
protocolRunHeaderRef={null}
robotName={ROBOT_NAME}
runId={RUN_ID}
/>,
{
initialState: {},

Check failure on line 97 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

Type '{}' is missing the following properties from type 'State': robotApi, robotAdmin, robotControls, robotSettings, and 13 more.

Check failure on line 97 in app/src/organisms/Desktop/Devices/ProtocolRun/__tests__/ProtocolRunSetup.test.tsx

View workflow job for this annotation

GitHub Actions / js checks

Type '{}' is missing the following properties from type 'State': robotApi, robotAdmin, robotControls, robotSettings, and 13 more.
i18nInstance: i18n,
}
)[0]
Expand All @@ -100,6 +109,9 @@ describe('ProtocolRunSetup', () => {
...noModulesProtocol,
...MOCK_PROTOCOL_LIQUID_KEY,
} as any)
when(vi.mocked(getMissingSetupSteps))
.calledWith(expect.any(Object), RUN_ID)
.thenReturn([])
when(vi.mocked(useProtocolAnalysisErrors)).calledWith(RUN_ID).thenReturn({
analysisErrors: null,
})
Expand All @@ -112,14 +124,23 @@ describe('ProtocolRunSetup', () => {
when(vi.mocked(useRequiredSetupStepsInOrder))
.calledWith({
runId: RUN_ID,
protocolAnalysis: ({
...noModulesProtocol,
...MOCK_PROTOCOL_LIQUID_KEY,
} as any) as SharedData.CompletedProtocolAnalysis,
protocolAnalysis: expect.any(Object),
})
.thenReturn({
orderedSteps: ReduxRuns.SETUP_STEP_KEYS,
orderedApplicableSteps: (ReduxRuns.SETUP_STEP_KEYS as any) as StepKey[],
orderedSteps: [
ReduxRuns.ROBOT_CALIBRATION_STEP_KEY,
ReduxRuns.MODULE_SETUP_STEP_KEY,
ReduxRuns.LPC_STEP_KEY,
ReduxRuns.LABWARE_SETUP_STEP_KEY,
ReduxRuns.LIQUID_SETUP_STEP_KEY,
],
orderedApplicableSteps: [
ReduxRuns.ROBOT_CALIBRATION_STEP_KEY,
ReduxRuns.MODULE_SETUP_STEP_KEY,
ReduxRuns.LPC_STEP_KEY,
ReduxRuns.LABWARE_SETUP_STEP_KEY,
ReduxRuns.LIQUID_SETUP_STEP_KEY,
],
})
vi.mocked(parseAllRequiredModuleModels).mockReturnValue([])
vi.mocked(parseLiquidsInLoadOrder).mockReturnValue([])
Expand Down

0 comments on commit 9641102

Please sign in to comment.