Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Feb 8, 2024
1 parent 496b1ed commit 4b02e7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import {
import {
getConnectableRobots,
getReachableRobots,
getUnreachableRobots,
} from '../../../../../../redux/discovery'
import {
mockConnectableRobot,
mockReachableRobot,
mockUnreachableRobot,
} from '../../../../../../redux/discovery/__fixtures__'

import { RenameRobotSlideout } from '../RenameRobotSlideout'
Expand All @@ -29,6 +31,9 @@ const mockGetConnectableRobots = getConnectableRobots as jest.MockedFunction<
const mockGetReachableRobots = getReachableRobots as jest.MockedFunction<
typeof getReachableRobots
>
const mockGetUnreachableRobots = getUnreachableRobots as jest.MockedFunction<
typeof getUnreachableRobots
>
const mockUseTrackEvent = useTrackEvent as jest.MockedFunction<
typeof useTrackEvent
>
Expand Down Expand Up @@ -56,8 +61,10 @@ describe('RobotSettings RenameRobotSlideout', () => {
mockUseTrackEvent.mockReturnValue(mockTrackEvent)
mockConnectableRobot.name = 'connectableOtie'
mockReachableRobot.name = 'reachableOtie'
mockUnreachableRobot.name = 'unreachableOtie'
mockGetConnectableRobots.mockReturnValue([mockConnectableRobot])
mockGetReachableRobots.mockReturnValue([mockReachableRobot])
mockGetUnreachableRobots.mockReturnValue([mockUnreachableRobot])
mockUseIsFlex.mockReturnValue(false)
})

Expand Down
7 changes: 7 additions & 0 deletions app/src/pages/NameRobot/__tests__/NameRobot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { useTrackEvent } from '../../../redux/analytics'
import {
getConnectableRobots,
getReachableRobots,
getUnreachableRobots,
} from '../../../redux/discovery'
import { useIsUnboxingFlowOngoing } from '../../../organisms/RobotSettingsDashboard/NetworkSettings/hooks'
import {
mockConnectableRobot,
mockReachableRobot,
mockUnreachableRobot,
} from '../../../redux/discovery/__fixtures__'

import { NameRobot } from '..'
Expand Down Expand Up @@ -41,6 +43,9 @@ const mockGetReachableRobots = getReachableRobots as jest.MockedFunction<
const mockUseTrackEvent = useTrackEvent as jest.MockedFunction<
typeof useTrackEvent
>
const mockGetUnreachableRobots = getUnreachableRobots as jest.MockedFunction<
typeof getUnreachableRobots
>
const mockuseIsUnboxingFlowOngoing = useIsUnboxingFlowOngoing as jest.MockedFunction<
typeof useIsUnboxingFlowOngoing
>
Expand All @@ -61,8 +66,10 @@ describe('NameRobot', () => {
mockUseTrackEvent.mockReturnValue(mockTrackEvent)
mockConnectableRobot.name = 'connect'
mockReachableRobot.name = 'reach'
mockUnreachableRobot.name = 'unreachableOtie'
mockGetConnectableRobots.mockReturnValue([mockConnectableRobot])
mockGetReachableRobots.mockReturnValue([mockReachableRobot])
mockGetUnreachableRobots.mockReturnValue([mockUnreachableRobot])
mockuseIsUnboxingFlowOngoing.mockReturnValue(true)
})

Expand Down

0 comments on commit 4b02e7a

Please sign in to comment.