Skip to content

Commit

Permalink
make testing utils a first class directory
Browse files Browse the repository at this point in the history
  • Loading branch information
shlokamin committed Sep 30, 2021
1 parent 7a238a2 commit e95f6af
Show file tree
Hide file tree
Showing 63 changed files with 67 additions and 80 deletions.
2 changes: 1 addition & 1 deletion app/src/organisms/Alerts/__tests__/Alerts.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'

import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import * as AppAlerts from '../../../redux/alerts'
import { Alerts } from '..'
import { LostConnectionAlert } from '../LostConnectionAlert'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import uniqueId from 'lodash/uniqueId'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import { act } from 'react-dom/test-utils'

import * as RobotApi from '../../../redux/robot-api'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import { act } from 'react-dom/test-utils'

import { AskForCalibrationBlockModal } from '../AskForCalibrationBlockModal'
import { CheckboxField } from '@opentrons/components'
import { setUseTrashSurfaceForTipCal } from '../../../redux/calibration'

import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'

type RenderReturnType = WrapperWithStore<
React.ComponentProps<typeof AskForCalibrationBlockModal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import { mockAttachedPipette } from '../../../redux/pipettes/__fixtures__'
import { mockDeckCalTipRack } from '../../../redux/sessions/__fixtures__'
Expand All @@ -17,7 +17,7 @@ import { getAttachedPipettes } from '../../../redux/pipettes'
import { ChooseTipRack } from '../ChooseTipRack'
import type { AttachedPipettesByMount } from '../../../redux/pipettes/types'
import type { ReactWrapper } from 'enzyme'
import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'

jest.mock('../../../redux/pipettes/selectors')
jest.mock('../../../redux/calibration/')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import {
mountWithStore,
WrapperWithStore,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'

import { ConfirmPipette } from '../ConfirmPipette'
import { CheckPipettesButton } from '../CheckPipettesButton'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { StaticRouter } from 'react-router-dom'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../i18n'
import { Box, Flex, ListItem, Tooltip } from '@opentrons/components'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fireEvent, screen } from '@testing-library/react'
import {
partialComponentPropsMatcher,
renderWithProviders,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { ExtraAttentionWarning } from '../ExtraAttentionWarning'
import { SecureLabwareModal } from '../SecureLabwareModal'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
LabwareDefinition2,
} from '@opentrons/shared-data'
import fixture_tiprack_300_ul from '@opentrons/shared-data/labware/fixtures/2/fixture_tiprack_300_ul.json'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { LabwareInfoOverlay } from '../LabwareInfoOverlay'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
renderWithProviders,
componentPropsMatcher,
partialComponentPropsMatcher,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { LabwareSetup } from '..'
import { LabwareSetupModal } from '../LabwareSetupModal'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { LabwareSetupModal } from '../LabwareSetupModal'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import '@testing-library/jest-dom'
import { ModuleModel, ModuleType } from '@opentrons/shared-data'
import { ModuleInfo } from '../ModuleInfo'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'

const render = (props: React.ComponentProps<typeof ModuleInfo>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
renderWithProviders,
partialComponentPropsMatcher,
componentPropsMatcher,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { ModuleSetup } from '..'
import { ModuleInfo } from '../ModuleInfo'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { MultipleModulesModal } from '../MultipleModulesModal'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'

import { i18n } from '../../../../../i18n'
import { CalibrationItem } from '../CalibrationItem'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { mockDeckCalData } from '../../../../../redux/calibration/__fixtures__'
import * as calibrationSelectors from '../../../../../redux/calibration/selectors'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import { mockProtocolPipetteTipRackCalInfo } from '../../../../../redux/pipettes/__fixtures__'
import { PipetteCalibration } from '../PipetteCalibration'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../../i18n'
import * as PipetteOffset from '../../../../../redux/calibration/pipette-offset'
import * as TipLength from '../../../../../redux/calibration/tip-length'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { StaticRouter } from 'react-router-dom'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import { i18n } from '../../../../i18n'
import * as hooks from '../hooks'
import { ProceedToRunCta } from '../ProceedToRunCta'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'

import { i18n } from '../../../i18n'
import { CollapsibleStep } from '../RunSetupCard/CollapsibleStep'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'

import { i18n } from '../../../i18n'
import { MetadataCard } from '../MetadataCard'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
componentPropsMatcher,
partialComponentPropsMatcher,
renderWithProviders,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'
import noModulesProtocol from '@opentrons/shared-data/protocol/fixtures/4/simpleV4.json'
import withModulesProtocol from '@opentrons/shared-data/protocol/fixtures/4/testModulesProtocol.json'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'
import withModulesProtocol from '@opentrons/shared-data/protocol/fixtures/4/testModulesProtocol.json'

import { i18n } from '../../../i18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import '@testing-library/jest-dom'
import { fireEvent } from '@testing-library/react'
import { renderWithProviders } from '@opentrons/components/__utils__'
import { renderWithProviders } from '@opentrons/components'

import { i18n } from '../../../i18n'
import { UploadInput } from '../UploadInput'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { Link as InternalLink } from 'react-router-dom'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import { BaseModal, Flex, Icon } from '@opentrons/components'
import * as Shell from '../../../redux/shell'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'
import { CalibrationData } from '../CalibrationData'

import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'

describe('CalibrationData', () => {
let render: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'
import wellPlate96Def from '@opentrons/shared-data/labware/fixtures/2/fixture_96_plate.json'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { StaticRouter } from 'react-router-dom'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'
import * as PipettesSelectors from '../../../../redux/pipettes/selectors'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'
import { TipLengthCalibrationData } from '../TipLengthCalibrationData'

import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'

describe('TipLengthCalibrationData', () => {
let render: (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import wellPlate96Def from '@opentrons/shared-data/labware/fixtures/2/fixture_96_plate.json'
import tiprack300Def from '@opentrons/shared-data/labware/fixtures/2/fixture_tiprack_300_ul.json'
Expand All @@ -16,7 +16,7 @@ import * as Analytics from '../../../redux/analytics/actions'
import type { Labware } from '../../../redux/robot/types'
import type { State } from '../../../redux/types'
import type { DispatchApiRequestType } from '../../../redux/robot-api'
import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'

jest.mock('../../../redux/robot-api')
jest.mock('../../../redux/robot/selectors')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import * as CustomLabware from '../../../../redux/custom-labware'
import * as CustomLabwareFixtures from '../../../../redux/custom-labware/__fixtures__'
Expand All @@ -8,7 +8,7 @@ import { ManagePath } from '../ManagePath'
import { AddLabware } from '../AddLabware'
import { AddLabwareFailureModal } from '../AddLabwareFailureModal'

import type { WrapperWithStore } from '@opentrons/components/__utils__'
import type { WrapperWithStore } from '@opentrons/components'
import type { State, Action } from '../../../../redux/types'

jest.mock('../../../../redux/custom-labware/selectors')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import * as Config from '../../../../redux/config'
import { AppAdvancedSettingsCard } from '../AppAdvancedSettingsCard'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tests for the AppSoftwareSettingsCard
import * as React from 'react'

import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import { Card, LabeledValue, Link, SecondaryBtn } from '@opentrons/components'
import * as Shell from '../../../../redux/shell'
import { Portal } from '../../../../App/portal'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import { BORDER_SOLID_LIGHT } from '@opentrons/components'
import * as Alerts from '../../../../redux/alerts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'

import * as Config from '../../../../redux/config'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react'
import {
mountWithStore,
WrapperWithStore,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'
import { mockConnectableRobot as mockRobot } from '../../../../../redux/discovery/__fixtures__'
import * as Buildroot from '../../../../../redux/buildroot'
import { UpdateBuildroot } from '..'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'

import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import { AlertModal, OutlineButton } from '@opentrons/components'
import { mockReachableRobot } from '../../../../../redux/discovery/__fixtures__'
import { UPGRADE, DOWNGRADE, REINSTALL } from '../../../../../redux/buildroot'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'

import { mountWithStore } from '@opentrons/components/__utils__'
import { mountWithStore } from '@opentrons/components'
import * as Buildroot from '../../../../../redux/buildroot'

import { DownloadUpdateModal } from '../DownloadUpdateModal'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'
import { saveAs } from 'file-saver'

import { i18n } from '../../../../i18n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import {
mountWithProviders,
WrapperWithStore,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'

import { i18n } from '../../../../i18n'
import * as Sessions from '../../../../redux/sessions'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'
import { i18n } from '../../../../i18n'

import * as Networking from '../../../../redux/networking'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { mountWithProviders } from '@opentrons/components/__utils__'
import { mountWithProviders } from '@opentrons/components'

import { i18n } from '../../../../i18n'
import * as RobotControls from '../../../../redux/robot-controls'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react'
import {
mountWithProviders,
WrapperWithStore,
} from '@opentrons/components/__utils__'
} from '@opentrons/components'

import { i18n } from '../../../../i18n'

Expand Down
Loading

0 comments on commit e95f6af

Please sign in to comment.