From e11059c3e637f748a7117a142c7838e6aa203d92 Mon Sep 17 00:00:00 2001 From: Jamey Huffnagle Date: Mon, 4 Mar 2024 15:00:09 -0500 Subject: [PATCH] lint fixes --- app-shell/src/main.ts | 6 +- app/src/__testing-utils__/matchers.ts | 1 - .../atoms/text/__tests__/StyledText.test.tsx | 4 +- .../__tests__/createSnippet.test.ts | 7 +- .../ClearUnavailableRobots.tsx | 64 ++++++++++--------- .../__tests__/ClearUnavailableRobots.test.tsx | 2 +- .../getLabwareLocationCombos.test.ts | 2 +- .../__tests__/LiquidDetailCard.test.tsx | 4 +- .../__tests__/SetupLiquids.test.tsx | 3 +- .../__tests__/SetupRobotCalibration.test.tsx | 12 ++-- .../getModuleInitialLoadInfo.test.ts | 6 +- .../__tests__/getProtocolModulesInfo.test.ts | 4 +- .../__tests__/SoftwareUpdateModal.test.tsx | 1 + .../__tests__/UpdateRobotSoftware.test.tsx | 1 + .../__tests__/HistoricalProtocolRun.test.tsx | 2 +- .../__tests__/RobotOverflowMenu.test.tsx | 5 +- .../Devices/__tests__/RobotOverview.test.tsx | 2 +- .../__tests__/useLPCDisabledReason.test.tsx | 11 ++-- ...seModuleRenderInfoForProtocolById.test.tsx | 8 ++- .../useRunPipetteInfoByMount.test.tsx | 17 ++--- .../__tests__/MovePin.test.tsx | 4 +- .../organisms/GripperWizardFlows/index.tsx | 2 +- .../InterventionModal/__fixtures__/index.ts | 1 - .../__tests__/InterventionModal.test.tsx | 3 +- .../CustomLabwareOverflowMenu.test.tsx | 12 ++-- .../__tests__/LabwareCard.test.tsx | 6 -- .../LabwareDetails/__tests__/Gallery.test.tsx | 4 +- .../TerseOffsetTable.stories.tsx | 8 ++- .../__tests__/useLaunchLPC.test.tsx | 3 +- .../ModuleWizardFlows/BeforeBeginning.tsx | 2 +- .../ModuleWizardFlows/PlaceAdapter.tsx | 8 +-- .../usePlayMaintenanceRunMutation.test.tsx | 3 +- 32 files changed, 107 insertions(+), 111 deletions(-) diff --git a/app-shell/src/main.ts b/app-shell/src/main.ts index 5b5776e8a60..b198f1705bd 100644 --- a/app-shell/src/main.ts +++ b/app-shell/src/main.ts @@ -134,7 +134,7 @@ function createRendererLogger(): Logger { return logger } -function installDevtools(): Promise { +function installDevtools(): Promise { const extensions = [ electronDevtoolsInstaller.REACT_DEVELOPER_TOOLS, electronDevtoolsInstaller.REDUX_DEVTOOLS, @@ -158,6 +158,8 @@ function installDevtools(): Promise { }) } else { log.warn('could not resolve electron dev tools installer') - return Promise.reject('could not resolve electron dev tools installer') + return Promise.reject( + new Error('could not resolve electron dev tools installer') + ) } } diff --git a/app/src/__testing-utils__/matchers.ts b/app/src/__testing-utils__/matchers.ts index 1056454175b..66234dbc915 100644 --- a/app/src/__testing-utils__/matchers.ts +++ b/app/src/__testing-utils__/matchers.ts @@ -1,4 +1,3 @@ -import { when } from 'vitest-when' import type { Matcher } from '@testing-library/react' // Match things like

Some nested text

diff --git a/app/src/atoms/text/__tests__/StyledText.test.tsx b/app/src/atoms/text/__tests__/StyledText.test.tsx index 0b857e3d211..5a13de49145 100644 --- a/app/src/atoms/text/__tests__/StyledText.test.tsx +++ b/app/src/atoms/text/__tests__/StyledText.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react' -import { describe, it, expect, vi, beforeEach } from 'vitest' +import { describe, it, expect } from 'vitest' import '@testing-library/jest-dom/vitest' -import { fireEvent, screen } from '@testing-library/react' +import { screen } from '@testing-library/react' import { TYPOGRAPHY } from '@opentrons/components' import { StyledText } from '../' import { renderWithProviders } from '../../../__testing-utils__' diff --git a/app/src/molecules/PythonLabwareOffsetSnippet/__tests__/createSnippet.test.ts b/app/src/molecules/PythonLabwareOffsetSnippet/__tests__/createSnippet.test.ts index bdc1a779452..683caeed815 100644 --- a/app/src/molecules/PythonLabwareOffsetSnippet/__tests__/createSnippet.test.ts +++ b/app/src/molecules/PythonLabwareOffsetSnippet/__tests__/createSnippet.test.ts @@ -1,7 +1,10 @@ import { describe, it, expect } from 'vitest' import '@testing-library/jest-dom/vitest' -import { transfer_settings } from '@opentrons/shared-data' -import { ModuleModel, CompletedProtocolAnalysis } from '@opentrons/shared-data' +import { + transfer_settings, + ModuleModel, + CompletedProtocolAnalysis, +} from '@opentrons/shared-data' import { createSnippet } from '../createSnippet' const protocolWithMagTempTC = ({ diff --git a/app/src/organisms/AdvancedSettings/ClearUnavailableRobots.tsx b/app/src/organisms/AdvancedSettings/ClearUnavailableRobots.tsx index 4eaacca623e..98ebe695c77 100644 --- a/app/src/organisms/AdvancedSettings/ClearUnavailableRobots.tsx +++ b/app/src/organisms/AdvancedSettings/ClearUnavailableRobots.tsx @@ -24,7 +24,7 @@ import { TertiaryButton } from '../../atoms/buttons' import { ERROR_TOAST, SUCCESS_TOAST } from '../../atoms/Toast' import { useToaster } from '../../organisms/ToasterOven' import { LegacyModal } from '../../molecules/LegacyModal' -import { Portal, getTopPortalEl } from '../../App/portal' +import { getTopPortalEl } from '../../App/portal' import { clearDiscoveryCache, getReachableRobots, @@ -63,41 +63,43 @@ export function ClearUnavailableRobots(): JSX.Element { } = useConditionalConfirm(handleDeleteUnavailRobots, true) return ( <> - {showConfirmDeleteUnavailRobots ? createPortal( - - {t('clearing_cannot_be_undone')} - + {t('clearing_cannot_be_undone')} - - {t('shared:cancel')} - - - - - {t('clear_confirm')} - + + {t('shared:cancel')} + + + + + {t('clear_confirm')} + + - - , - getTopPortalEl() - ) : null} + , + getTopPortalEl() + ) + : null} { }) it('renders deck, pipette, and tip length calibration components', () => { - render()[0] + render() screen.getByText('Mock SetupDeckCalibration') screen.getByText('Mock SetupInstrumentCalibration') screen.getByText('Mock SetupTipLengthCalibration') @@ -85,19 +85,19 @@ describe('SetupRobotCalibration', () => { it('renders only pipette calibration component for Flex', () => { when(vi.mocked(useIsFlex)).calledWith(ROBOT_NAME).thenReturn(true) - render()[0] + render() expect(screen.queryByText('Mock SetupDeckCalibration')).toBeNull() screen.getByText('Mock SetupInstrumentCalibration') expect(screen.queryByText('Mock SetupTipLengthCalibration')).toBeNull() }) it('changes Proceed CTA copy based on next step', () => { - render({ nextStep: 'labware_setup_step' })[0] + render({ nextStep: 'labware_setup_step' }) screen.getByRole('button', { name: 'Proceed to labware' }) }) it('calls the expandStep function and tracks the analytics event on click', () => { - render()[0] + render() fireEvent.click(screen.getByRole('button', { name: 'Proceed to modules' })) expect(mockExpandStep).toHaveBeenCalled() expect(mockTrackEvent).toHaveBeenCalledWith({ @@ -107,7 +107,7 @@ describe('SetupRobotCalibration', () => { }) it('does not call the expandStep function on click if calibration is not complete', () => { - render({ calibrationStatus: { complete: false } })[0] + render({ calibrationStatus: { complete: false } }) const button = screen.getByRole('button', { name: 'Proceed to modules' }) expect(button).toBeDisabled() fireEvent.click(button) @@ -116,7 +116,7 @@ describe('SetupRobotCalibration', () => { it('does not call the expandStep function on click if run has started', () => { when(vi.mocked(useRunHasStarted)).calledWith(RUN_ID).thenReturn(true) - render()[0] + render() const button = screen.getByRole('button', { name: 'Proceed to modules' }) expect(button).toBeDisabled() fireEvent.click(button) diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts b/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts index 9ef5eef8a39..25225a56ea2 100644 --- a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts +++ b/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getModuleInitialLoadInfo.test.ts @@ -1,7 +1,9 @@ import { describe, it, expect } from 'vitest' -import { transfer_settings } from '@opentrons/shared-data' +import { + transfer_settings, + CompletedProtocolAnalysis, +} from '@opentrons/shared-data' import { getModuleInitialLoadInfo } from '../getModuleInitialLoadInfo' -import { CompletedProtocolAnalysis } from '@opentrons/shared-data' import type { LoadModuleRunTimeCommand } from '@opentrons/shared-data' const protocolWithMagTempTC = (transfer_settings as unknown) as CompletedProtocolAnalysis diff --git a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts b/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts index 7364fd90f16..cd6b5d06408 100644 --- a/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts +++ b/app/src/organisms/Devices/ProtocolRun/utils/__tests__/getProtocolModulesInfo.test.ts @@ -3,14 +3,12 @@ import { transfer_settings, multiple_temp_modules, ot2DeckDefV4, -} from '@opentrons/shared-data' -import { getProtocolModulesInfo } from '../getProtocolModulesInfo' -import { getModuleDef2, ProtocolAnalysisOutput, LoadedLabware, LoadedModule, } from '@opentrons/shared-data' +import { getProtocolModulesInfo } from '../getProtocolModulesInfo' const protocolWithMagTempTC = ({ ...transfer_settings, diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/SoftwareUpdateModal.test.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/SoftwareUpdateModal.test.tsx index a7f15b459d6..141cc4b3638 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/SoftwareUpdateModal.test.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/SoftwareUpdateModal.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable testing-library/no-node-access */ import * as React from 'react' import { MemoryRouter } from 'react-router-dom' import { screen } from '@testing-library/react' diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/UpdateRobotSoftware.test.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/UpdateRobotSoftware.test.tsx index 28168e38488..4b5e2191ab7 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/UpdateRobotSoftware.test.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/__tests__/UpdateRobotSoftware.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable testing-library/no-node-access */ import * as React from 'react' import { MemoryRouter } from 'react-router-dom' import { screen } from '@testing-library/react' diff --git a/app/src/organisms/Devices/__tests__/HistoricalProtocolRun.test.tsx b/app/src/organisms/Devices/__tests__/HistoricalProtocolRun.test.tsx index ae5ca760ce4..bc59f8cf884 100644 --- a/app/src/organisms/Devices/__tests__/HistoricalProtocolRun.test.tsx +++ b/app/src/organisms/Devices/__tests__/HistoricalProtocolRun.test.tsx @@ -19,7 +19,7 @@ vi.mock('../../RunTimeControl/hooks') vi.mock('../HistoricalProtocolRunOverflowMenu') vi.mock('react-router-dom', async importOriginal => { const reactRouterDom = importOriginal() - return { + return await { ...reactRouterDom, useHistory: () => ({ push: mockPush } as any), } diff --git a/app/src/organisms/Devices/__tests__/RobotOverflowMenu.test.tsx b/app/src/organisms/Devices/__tests__/RobotOverflowMenu.test.tsx index ab934a34d13..69ad5afc77a 100644 --- a/app/src/organisms/Devices/__tests__/RobotOverflowMenu.test.tsx +++ b/app/src/organisms/Devices/__tests__/RobotOverflowMenu.test.tsx @@ -1,7 +1,6 @@ import * as React from 'react' import { MemoryRouter } from 'react-router-dom' -import { fireEvent } from '@testing-library/react' -import { screen } from '@testing-library/react' +import { fireEvent, screen } from '@testing-library/react' import { describe, it, vi, beforeEach, expect } from 'vitest' import '@testing-library/jest-dom/vitest' import { renderWithProviders } from '../../../__testing-utils__' @@ -68,7 +67,7 @@ describe('RobotOverflowMenu', () => { render(props) const btn = screen.getByLabelText('RobotOverflowMenu_button') fireEvent.click(btn) - const why = screen.getByText('Why is this robot unavailable?') + screen.getByText('Why is this robot unavailable?') screen.getByText('Forget unavailable robot') }) diff --git a/app/src/organisms/Devices/__tests__/RobotOverview.test.tsx b/app/src/organisms/Devices/__tests__/RobotOverview.test.tsx index 0b3b0b06b2f..97c34ac10bb 100644 --- a/app/src/organisms/Devices/__tests__/RobotOverview.test.tsx +++ b/app/src/organisms/Devices/__tests__/RobotOverview.test.tsx @@ -55,7 +55,7 @@ import type * as ReactApiClient from '@opentrons/react-api-client' vi.mock('@opentrons/react-api-client', async importOriginal => { const actual = importOriginal() - return { + return await { ...actual, useAuthorization: vi.fn(), } diff --git a/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx index 3829c49f78b..1ad5e345e30 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useLPCDisabledReason.test.tsx @@ -4,8 +4,10 @@ import { Provider } from 'react-redux' import { I18nextProvider } from 'react-i18next' import { createStore } from 'redux' import { vi, it, expect, describe, beforeEach, afterEach } from 'vitest' -import { getLoadedLabwareDefinitionsByUri } from '@opentrons/shared-data' -import { simple_v6 as _uncastedSimpleV6Protocol } from '@opentrons/shared-data' +import { + getLoadedLabwareDefinitionsByUri, + simple_v6 as _uncastedSimpleV6Protocol, +} from '@opentrons/shared-data' import { i18n } from '../../../../i18n' import { RUN_ID_1 } from '../../../RunTimeControl/__fixtures__' import { useLPCDisabledReason } from '../useLPCDisabledReason' @@ -17,7 +19,6 @@ import { } from '..' import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import type { Store } from 'redux' -import type { ProtocolAnalysisOutput } from '@opentrons/shared-data' import type * as SharedData from '@opentrons/shared-data' import type { State } from '../../../../redux/types' @@ -31,7 +32,7 @@ vi.mock('@opentrons/shared-data', async importOriginal => { } }) -const simpleV6Protocol = (_uncastedSimpleV6Protocol as unknown) as ProtocolAnalysisOutput +const simpleV6Protocol = (_uncastedSimpleV6Protocol as unknown) as SharedData.ProtocolAnalysisOutput describe('useLPCDisabledReason', () => { const store: Store = createStore(vi.fn(), {}) @@ -48,7 +49,7 @@ describe('useLPCDisabledReason', () => { simpleV6Protocol as any ) vi.mocked(useStoredProtocolAnalysis).mockReturnValue( - (simpleV6Protocol as unknown) as ProtocolAnalysisOutput + (simpleV6Protocol as unknown) as SharedData.ProtocolAnalysisOutput ) vi.mocked(useRunHasStarted).mockReturnValue(false) vi.mocked(useRunCalibrationStatus).mockReturnValue({ complete: true }) diff --git a/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx index 73fa81d2075..e4db66555d5 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useModuleRenderInfoForProtocolById.test.tsx @@ -3,8 +3,10 @@ import { vi, it, expect, describe, beforeEach } from 'vitest' import { when } from 'vitest-when' import { UseQueryResult } from 'react-query' -import { STAGING_AREA_RIGHT_SLOT_FIXTURE } from '@opentrons/shared-data' -import { heater_shaker_commands_with_result as _heaterShakerCommandsWithResultsKey } from '@opentrons/shared-data' +import { + STAGING_AREA_RIGHT_SLOT_FIXTURE, + heater_shaker_commands_with_results_key, +} from '@opentrons/shared-data' import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' import { useDeckConfigurationQuery } from '@opentrons/react-api-client' @@ -35,7 +37,7 @@ vi.mock('../useAttachedModules') vi.mock('../useStoredProtocolAnalysis') vi.mock('../../../LabwarePositionCheck/useMostRecentCompletedAnalysis') -const heaterShakerCommandsWithResultsKey = (_heaterShakerCommandsWithResultsKey as unknown) as ProtocolAnalysisOutput +const heaterShakerCommandsWithResultsKey = (heater_shaker_commands_with_results_key as unknown) as ProtocolAnalysisOutput const PROTOCOL_DETAILS = { displayName: 'fake protocol', diff --git a/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx b/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx index 61cf8cd5d4d..b410220425d 100644 --- a/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx +++ b/app/src/organisms/Devices/hooks/__tests__/useRunPipetteInfoByMount.test.tsx @@ -6,9 +6,9 @@ import { getPipetteNameSpecs, getLoadedLabwareDefinitionsByUri, RunTimeCommand, + opentrons96Tiprack10UlV1Uncasted as _tiprack10ul, } from '@opentrons/shared-data' import { useAllTipLengthCalibrationsQuery } from '@opentrons/react-api-client' -import { opentrons96Tiprack10UlV1Uncasted as _tiprack10ul } from '@opentrons/shared-data' import { mockPipetteOffsetCalibration1, @@ -31,11 +31,6 @@ import { } from '..' import _uncastedModifiedSimpleV6Protocol from '../__fixtures__/modifiedSimpleV6.json' -import type { - LabwareDefinition2, - PipetteNameSpecs, - ProtocolAnalysisOutput, -} from '@opentrons/shared-data' import type * as SharedData from '@opentrons/shared-data' import type { PipetteInfo } from '..' @@ -75,7 +70,7 @@ const TIP_LENGTH_CALIBRATIONS = [ mockTipLengthCalibration2, ] -const tiprack10ul = _tiprack10ul as LabwareDefinition2 +const tiprack10ul = _tiprack10ul as SharedData.LabwareDefinition2 const modifiedSimpleV6Protocol = ({ ..._uncastedModifiedSimpleV6Protocol, labware: [ @@ -110,7 +105,7 @@ const modifiedSimpleV6Protocol = ({ pipetteName: 'p10_single', }, ], -} as any) as ProtocolAnalysisOutput +} as any) as SharedData.ProtocolAnalysisOutput const PROTOCOL_DETAILS = { displayName: 'fake protocol', @@ -135,12 +130,14 @@ describe('useRunPipetteInfoByMount hook', () => { .thenReturn(PROTOCOL_DETAILS.protocolData as any) when(vi.mocked(useStoredProtocolAnalysis)) .calledWith('1') - .thenReturn((PROTOCOL_DETAILS as unknown) as ProtocolAnalysisOutput) + .thenReturn( + (PROTOCOL_DETAILS as unknown) as SharedData.ProtocolAnalysisOutput + ) when(vi.mocked(getPipetteNameSpecs)) .calledWith('p10_single') .thenReturn({ displayName: 'P10 Single-Channel GEN1', - } as PipetteNameSpecs) + } as SharedData.PipetteNameSpecs) when(vi.mocked(getLoadedLabwareDefinitionsByUri)) .calledWith( _uncastedModifiedSimpleV6Protocol.commands as RunTimeCommand[] diff --git a/app/src/organisms/GripperWizardFlows/__tests__/MovePin.test.tsx b/app/src/organisms/GripperWizardFlows/__tests__/MovePin.test.tsx index 5e54f7fd869..954a3bcb19e 100644 --- a/app/src/organisms/GripperWizardFlows/__tests__/MovePin.test.tsx +++ b/app/src/organisms/GripperWizardFlows/__tests__/MovePin.test.tsx @@ -64,7 +64,7 @@ describe('MovePin', () => { render() const begin = screen.getByRole('button', { name: 'Begin calibration' }) fireEvent.click(begin) - await new Promise(r => setTimeout(r)) + await new Promise((resolve, reject) => setTimeout(resolve)) expect(mockCreateRunCommand).toHaveBeenNthCalledWith(1, { maintenanceRunId: 'fakeRunId', command: { @@ -138,7 +138,7 @@ describe('MovePin', () => { name: 'Continue calibration', }) fireEvent.click(continueButton) - await new Promise(r => setTimeout(r)) + await new Promise((resolve, reject) => setTimeout(resolve)) expect(mockCreateRunCommand).toHaveBeenNthCalledWith(1, { maintenanceRunId: 'fakeRunId', command: { diff --git a/app/src/organisms/GripperWizardFlows/index.tsx b/app/src/organisms/GripperWizardFlows/index.tsx index fe6f776f416..3c7b6d80b5b 100644 --- a/app/src/organisms/GripperWizardFlows/index.tsx +++ b/app/src/organisms/GripperWizardFlows/index.tsx @@ -17,7 +17,7 @@ import { } from '@opentrons/react-api-client' import { useNotifyCurrentMaintenanceRun } from '../../resources/maintenance_runs/useNotifyCurrentMaintenanceRun' import { LegacyModalShell } from '../../molecules/LegacyModal' -import { Portal, getTopPortalEl } from '../../App/portal' +import { getTopPortalEl } from '../../App/portal' import { WizardHeader } from '../../molecules/WizardHeader' import { FirmwareUpdateModal } from '../FirmwareUpdateModal' import { getIsOnDevice } from '../../redux/config' diff --git a/app/src/organisms/InterventionModal/__fixtures__/index.ts b/app/src/organisms/InterventionModal/__fixtures__/index.ts index a63f7b2cdfb..b6d631f4c97 100644 --- a/app/src/organisms/InterventionModal/__fixtures__/index.ts +++ b/app/src/organisms/InterventionModal/__fixtures__/index.ts @@ -1,6 +1,5 @@ import { LabwareDefinition2, - ModuleDefinition, SPAN7_8_10_11_SLOT, THERMOCYCLER_MODULE_V1, getModuleDef2, diff --git a/app/src/organisms/InterventionModal/__tests__/InterventionModal.test.tsx b/app/src/organisms/InterventionModal/__tests__/InterventionModal.test.tsx index 4698eef7633..555973db4eb 100644 --- a/app/src/organisms/InterventionModal/__tests__/InterventionModal.test.tsx +++ b/app/src/organisms/InterventionModal/__tests__/InterventionModal.test.tsx @@ -1,6 +1,5 @@ import * as React from 'react' -import { fireEvent } from '@testing-library/react' -import { screen } from '@testing-library/react' +import { fireEvent, screen } from '@testing-library/react' import { describe, it, expect, vi, beforeEach } from 'vitest' import { renderWithProviders } from '../../../__testing-utils__' import { diff --git a/app/src/organisms/LabwareCard/__tests__/CustomLabwareOverflowMenu.test.tsx b/app/src/organisms/LabwareCard/__tests__/CustomLabwareOverflowMenu.test.tsx index 5d32f272816..b21600a354e 100644 --- a/app/src/organisms/LabwareCard/__tests__/CustomLabwareOverflowMenu.test.tsx +++ b/app/src/organisms/LabwareCard/__tests__/CustomLabwareOverflowMenu.test.tsx @@ -71,11 +71,11 @@ describe('CustomLabwareOverflowMenu', () => { render(props) fireEvent.click(screen.getByLabelText('CustomLabwareOverflowMenu_button')) fireEvent.click(screen.getByRole('button', { name: 'Delete' })) - await screen.getByText('Delete this labware definition?') - await screen.getByText( + screen.getByText('Delete this labware definition?') + screen.getByText( 'This labware definition will be moved to this computer’s trash and may be unrecoverable.' ) - await screen.getByText( + screen.getByText( 'Robots cannot run Python protocols with missing labware definitions.' ) fireEvent.click(screen.getByText('cancel')) @@ -86,11 +86,11 @@ describe('CustomLabwareOverflowMenu', () => { render(props) fireEvent.click(screen.getByLabelText('CustomLabwareOverflowMenu_button')) fireEvent.click(screen.getByRole('button', { name: 'Delete' })) - await screen.getByText('Delete this labware definition?') - await screen.getByText( + screen.getByText('Delete this labware definition?') + screen.getByText( 'This labware definition will be moved to this computer’s trash and may be unrecoverable.' ) - await screen.getByText( + screen.getByText( 'Robots cannot run Python protocols with missing labware definitions.' ) fireEvent.click(screen.getByText('Yes, delete definition')) diff --git a/app/src/organisms/LabwareCard/__tests__/LabwareCard.test.tsx b/app/src/organisms/LabwareCard/__tests__/LabwareCard.test.tsx index 4058b6492b8..e0fdcc361ed 100644 --- a/app/src/organisms/LabwareCard/__tests__/LabwareCard.test.tsx +++ b/app/src/organisms/LabwareCard/__tests__/LabwareCard.test.tsx @@ -24,12 +24,6 @@ vi.mock('@opentrons/components', async importOriginal => { } }) -const mockCustomLabwareOverflowMenu = CustomLabwareOverflowMenu as jest.MockedFunction< - typeof CustomLabwareOverflowMenu -> -const mockUseAllLabware = useAllLabware as jest.MockedFunction< - typeof useAllLabware -> const render = (props: React.ComponentProps) => { return renderWithProviders(, { i18nInstance: i18n, diff --git a/app/src/organisms/LabwareDetails/__tests__/Gallery.test.tsx b/app/src/organisms/LabwareDetails/__tests__/Gallery.test.tsx index 14a57ea51bc..5a2a8378f16 100644 --- a/app/src/organisms/LabwareDetails/__tests__/Gallery.test.tsx +++ b/app/src/organisms/LabwareDetails/__tests__/Gallery.test.tsx @@ -21,14 +21,14 @@ describe('Gallery', () => { it('renders one main SVG and no mini images if definition contains no images', () => { labwareImages.mock_definition = [] - const [{ getByTestId, queryAllByTestId }] = render(props) + const [{ queryAllByTestId }] = render(props) screen.getByTestId('gallery_main_svg') expect(queryAllByTestId('gallery_mini_image')).toHaveLength(0) }) it('renders one main SVG and two mini images if definition contains one image', () => { - const [{ getByTestId, queryAllByTestId }] = render(props) + const [{ queryAllByTestId }] = render(props) screen.getByTestId('gallery_main_svg') expect(queryAllByTestId('gallery_mini_image')).toHaveLength(2) diff --git a/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx b/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx index 8065169a154..2077ce88598 100644 --- a/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx +++ b/app/src/organisms/LabwarePositionCheck/TerseOffsetTable.stories.tsx @@ -6,8 +6,12 @@ import { JUSTIFY_SPACE_BETWEEN, SPACING, } from '@opentrons/components' -import { fixture12Trough, fixtureTiprack10ul } from '@opentrons/shared-data' -import { LabwareDefinition2, getLabwareDefURI } from '@opentrons/shared-data' +import { + fixture12Trough, + fixtureTiprack10ul, + LabwareDefinition2, + getLabwareDefURI, +} from '@opentrons/shared-data' import { touchScreenViewport } from '../../DesignTokens/constants' import { SmallButton } from '../../atoms/buttons' diff --git a/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx b/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx index 164efc56076..e558d76d884 100644 --- a/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx +++ b/app/src/organisms/LabwarePositionCheck/__tests__/useLaunchLPC.test.tsx @@ -16,11 +16,10 @@ import { useCreateMaintenanceRunLabwareDefinitionMutation, useDeleteMaintenanceRunMutation, } from '@opentrons/react-api-client' -import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data' +import { FLEX_ROBOT_TYPE, fixtureTiprack300ul } from '@opentrons/shared-data' import { renderWithProviders } from '../../../__testing-utils__' import { useCreateTargetedMaintenanceRunMutation } from '../../../resources/runs/hooks' -import { fixtureTiprack300ul } from '@opentrons/shared-data' import { useMostRecentCompletedAnalysis } from '../useMostRecentCompletedAnalysis' import { useNotifyRunQuery } from '../../../resources/runs/useNotifyRunQuery' import { useLaunchLPC } from '../useLaunchLPC' diff --git a/app/src/organisms/ModuleWizardFlows/BeforeBeginning.tsx b/app/src/organisms/ModuleWizardFlows/BeforeBeginning.tsx index ccf6b439811..98d5b024696 100644 --- a/app/src/organisms/ModuleWizardFlows/BeforeBeginning.tsx +++ b/app/src/organisms/ModuleWizardFlows/BeforeBeginning.tsx @@ -6,8 +6,8 @@ import { HEATERSHAKER_MODULE_MODELS, TEMPERATURE_MODULE_MODELS, THERMOCYCLER_MODULE_MODELS, + getModuleDisplayName, } from '@opentrons/shared-data' -import { getModuleDisplayName } from '@opentrons/shared-data' import { StyledText } from '../../atoms/text' import { GenericWizardTile } from '../../molecules/GenericWizardTile' diff --git a/app/src/organisms/ModuleWizardFlows/PlaceAdapter.tsx b/app/src/organisms/ModuleWizardFlows/PlaceAdapter.tsx index c9473244ece..1ab35baf151 100644 --- a/app/src/organisms/ModuleWizardFlows/PlaceAdapter.tsx +++ b/app/src/organisms/ModuleWizardFlows/PlaceAdapter.tsx @@ -20,15 +20,13 @@ import { getModuleDisplayName, HEATERSHAKER_MODULE_TYPE, THERMOCYCLER_MODULE_TYPE, -} from '@opentrons/shared-data' - -import { StyledText } from '../../atoms/text' -import { GenericWizardTile } from '../../molecules/GenericWizardTile' -import { HEATERSHAKER_MODULE_MODELS, TEMPERATURE_MODULE_MODELS, THERMOCYCLER_MODULE_MODELS, } from '@opentrons/shared-data' + +import { StyledText } from '../../atoms/text' +import { GenericWizardTile } from '../../molecules/GenericWizardTile' import { LEFT_SLOTS } from './constants' import type { ModuleCalibrationWizardStepProps } from './types' diff --git a/react-api-client/src/maintenance_runs/__tests__/usePlayMaintenanceRunMutation.test.tsx b/react-api-client/src/maintenance_runs/__tests__/usePlayMaintenanceRunMutation.test.tsx index 21f888ccd98..0f3f7c33f51 100644 --- a/react-api-client/src/maintenance_runs/__tests__/usePlayMaintenanceRunMutation.test.tsx +++ b/react-api-client/src/maintenance_runs/__tests__/usePlayMaintenanceRunMutation.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { describe, it, expect, beforeEach, vi } from 'vitest' import { QueryClient, QueryClientProvider } from 'react-query' import { act, renderHook, waitFor } from '@testing-library/react' -import { createRunAction, RUN_ACTION_TYPE_PLAY } from '@opentrons/api-client' +import { createRunAction } from '@opentrons/api-client' import { useHost } from '../../api' import { usePlayMaintenanceRunMutation } from '..' @@ -23,7 +23,6 @@ describe('usePlayMaintenanceRunMutation hook', () => { let wrapper: React.FunctionComponent< { children: React.ReactNode } & UsePlayMaintenanceRunMutationOptions > - const createPlayRunActionData = { actionType: RUN_ACTION_TYPE_PLAY } beforeEach(() => { const queryClient = new QueryClient()