diff --git a/app/src/organisms/Devices/RobotOverflowMenu.tsx b/app/src/organisms/Devices/RobotOverflowMenu.tsx index 751729b25a8..dd624e2dcd5 100644 --- a/app/src/organisms/Devices/RobotOverflowMenu.tsx +++ b/app/src/organisms/Devices/RobotOverflowMenu.tsx @@ -84,25 +84,27 @@ export function RobotOverflowMenu(props: RobotOverflowMenuProps): JSX.Element { if (robot.status === CONNECTABLE && runId == null) { menuItems = ( <> - {!isRobotBusy ? ( - - {t('run_a_protocol')} - - ) : null} + + {t('run_a_protocol')} + {isRobotOnWrongVersionOfSoftware && ( {t('shared:a_software_update_is_available')} )} + {!isRobotOnWrongVersionOfSoftware && isRobotBusy && ( + + {t('shared:robot_is_busy')} + + )} ) => { return renderWithProviders( @@ -85,19 +86,13 @@ describe('RobotOverflowMenu', () => { expect(run).toBeDisabled() }) - it('should only render robot settings when e-stop is pressed or disconnected', () => { + it('disables the run a protocol menu item if robot is busy', () => { vi.mocked(useCurrentRunId).mockReturnValue(null) - vi.mocked(getRobotUpdateDisplayInfo).mockReturnValue({ - autoUpdateAction: 'upgrade', - autoUpdateDisabledReason: null, - updateFromFileDisabledReason: null, - }) - vi.mocked(useIsRobotBusy).mockReturnValue(true) render(props) const btn = screen.getByLabelText('RobotOverflowMenu_button') fireEvent.click(btn) - expect(screen.queryByText('Run a protocol')).not.toBeInTheDocument() - screen.getByText('Robot settings') + const run = screen.getByText('Run a protocol') + expect(run).toBeDisabled() }) })