From 4b02e7a25160fdd636d872ce40f521f95c32cefc Mon Sep 17 00:00:00 2001 From: Jethary Date: Thu, 8 Feb 2024 16:33:13 -0500 Subject: [PATCH] fix tests --- .../__tests__/RenameRobotSlideout.test.tsx | 7 +++++++ app/src/pages/NameRobot/__tests__/NameRobot.test.tsx | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/__tests__/RenameRobotSlideout.test.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/__tests__/RenameRobotSlideout.test.tsx index 8895964a62e..518a55a2f2d 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/__tests__/RenameRobotSlideout.test.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/__tests__/RenameRobotSlideout.test.tsx @@ -10,10 +10,12 @@ import { import { getConnectableRobots, getReachableRobots, + getUnreachableRobots, } from '../../../../../../redux/discovery' import { mockConnectableRobot, mockReachableRobot, + mockUnreachableRobot, } from '../../../../../../redux/discovery/__fixtures__' import { RenameRobotSlideout } from '../RenameRobotSlideout' @@ -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 > @@ -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) }) diff --git a/app/src/pages/NameRobot/__tests__/NameRobot.test.tsx b/app/src/pages/NameRobot/__tests__/NameRobot.test.tsx index 693ce660069..16a1fd80304 100644 --- a/app/src/pages/NameRobot/__tests__/NameRobot.test.tsx +++ b/app/src/pages/NameRobot/__tests__/NameRobot.test.tsx @@ -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 '..' @@ -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 > @@ -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) })