Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhuff committed Jul 24, 2024
1 parent 9b3388e commit 861d04a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/src/organisms/ErrorRecoveryFlows/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@ export const mockRecoveryContentProps: RecoveryContentProps = {
mockRobotSideAnalysis.commands[mockRobotSideAnalysis.commands.length - 1],
],
recoveryActionMutationUtils: {} as any,
analytics: {
reportRecoveredRunResult: () => {},
reportErrorEvent: () => {},
reportViewErrorDetailsEvent: () => {},
reportActionSelectedEvent: () => {},
reportInitialActionEvent: () => {},
reportActionSelectedResult: () => {},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
useCurrentlyRecoveringFrom,
useERUtils,
useShowDoorInfo,
useRecoveryAnalytics,
} from '../hooks'
import { useFeatureFlag } from '../../../redux/config'
import { useERWizard, ErrorRecoveryWizard } from '../ErrorRecoveryWizard'
Expand Down Expand Up @@ -144,6 +145,9 @@ describe('ErrorRecovery', () => {
vi.mocked(useRunPausedSplash).mockReturnValue(true)
vi.mocked(useERUtils).mockReturnValue({ routeUpdateActions: {} } as any)
vi.mocked(useShowDoorInfo).mockReturnValue(false)
vi.mocked(useRecoveryAnalytics).mockReturnValue({
reportErrorEvent: vi.fn(),
} as any)
})

it('renders the wizard when the wizard is toggled on', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportRecoveredRunResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -86,6 +88,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand Down Expand Up @@ -113,6 +117,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportRecoveredRunResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -134,6 +140,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: { makeSuccessToast: mockMakeSuccessToast } as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,

Check failure on line 143 in app/src/organisms/ErrorRecoveryFlows/hooks/__tests__/useRecoveryCommands.test.ts

View workflow job for this annotation

GitHub Actions / js checks

Argument of type '{ runId: string; failedCommand: any; failedLabwareUtils: any; routeUpdateActions: any; recoveryToastUtils: any; }' is not assignable to parameter of type 'UseRecoveryCommandsParams'.
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -153,6 +161,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -169,6 +179,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand Down Expand Up @@ -208,6 +220,8 @@ describe('useRecoveryCommands', () => {
},
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -229,6 +243,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: { makeSuccessToast: mockMakeSuccessToast } as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand All @@ -248,6 +264,8 @@ describe('useRecoveryCommands', () => {
failedLabwareUtils: mockFailedLabwareUtils,
routeUpdateActions: mockRouteUpdateActions,
recoveryToastUtils: {} as any,
analytics: { reportActionSelectedResult: vi.fn() } as any,
selectedRecoveryOption: RECOVERY_MAP.RETRY_NEW_TIPS.ROUTE,
})
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react'

import { RUN_STATUS_FAILED, RUN_STATUS_SUCCEEDED } from '@opentrons/api-client'

import {
Expand Down

0 comments on commit 861d04a

Please sign in to comment.