Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test update
Browse files Browse the repository at this point in the history
mjhuff committed Sep 7, 2023
1 parent 44a2b71 commit fcbe2ff
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
import * as React from 'react'
import { createStore } from 'redux'
import { when } from 'jest-when'
import { fireEvent } from '@testing-library/react'

import { renderWithProviders } from '@opentrons/components'

import { i18n } from '../../../../../i18n'
import * as RobotUpdate from '../../../../../redux/robot-update'
import { getRobotUpdateDisplayInfo } from '../../../../../redux/robot-update'
import { getDiscoverableRobotByName } from '../../../../../redux/discovery'
import { UpdateRobotModal } from '../UpdateRobotModal'
import type { Store } from 'redux'

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

jest.mock('../../../../../redux/robot-update')
jest.mock('../../../../../redux/discovery')
jest.mock('../../../../UpdateAppModal', () => ({
UpdateAppModal: () => null,
}))

const getRobotUpdateDisplayInfo = RobotUpdate.getRobotUpdateDisplayInfo as jest.MockedFunction<
typeof RobotUpdate.getRobotUpdateDisplayInfo
const mockGetRobotUpdateDisplayInfo = getRobotUpdateDisplayInfo as jest.MockedFunction<
typeof getRobotUpdateDisplayInfo
>
const mockGetDiscoverableRobotByName = getDiscoverableRobotByName as jest.MockedFunction<
typeof getDiscoverableRobotByName
>

const render = (props: React.ComponentProps<typeof UpdateRobotModal>) => {
@@ -38,11 +44,12 @@ describe('UpdateRobotModal', () => {
systemType: 'flex',
closeModal: jest.fn(),
}
getRobotUpdateDisplayInfo.mockReturnValue({
when(mockGetRobotUpdateDisplayInfo).mockReturnValue({
autoUpdateAction: 'upgrade',
autoUpdateDisabledReason: null,
updateFromFileDisabledReason: 'test',
})
when(mockGetDiscoverableRobotByName).mockReturnValue(null)
})

afterEach(() => {

0 comments on commit fcbe2ff

Please sign in to comment.