Skip to content

Commit e11059c

Browse files
committed
lint fixes
1 parent eda4f56 commit e11059c

File tree

32 files changed

+107
-111
lines changed

32 files changed

+107
-111
lines changed

app-shell/src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function createRendererLogger(): Logger {
134134
return logger
135135
}
136136

137-
function installDevtools(): Promise<void | Logger> {
137+
function installDevtools(): Promise<Logger> {
138138
const extensions = [
139139
electronDevtoolsInstaller.REACT_DEVELOPER_TOOLS,
140140
electronDevtoolsInstaller.REDUX_DEVTOOLS,
@@ -158,6 +158,8 @@ function installDevtools(): Promise<void | Logger> {
158158
})
159159
} else {
160160
log.warn('could not resolve electron dev tools installer')
161-
return Promise.reject('could not resolve electron dev tools installer')
161+
return Promise.reject(
162+
new Error('could not resolve electron dev tools installer')
163+
)
162164
}
163165
}

app/src/__testing-utils__/matchers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { when } from 'vitest-when'
21
import type { Matcher } from '@testing-library/react'
32

43
// Match things like <p>Some <strong>nested</strong> text</p>

app/src/atoms/text/__tests__/StyledText.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react'
2-
import { describe, it, expect, vi, beforeEach } from 'vitest'
2+
import { describe, it, expect } from 'vitest'
33
import '@testing-library/jest-dom/vitest'
4-
import { fireEvent, screen } from '@testing-library/react'
4+
import { screen } from '@testing-library/react'
55
import { TYPOGRAPHY } from '@opentrons/components'
66
import { StyledText } from '../'
77
import { renderWithProviders } from '../../../__testing-utils__'

app/src/molecules/PythonLabwareOffsetSnippet/__tests__/createSnippet.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { describe, it, expect } from 'vitest'
22
import '@testing-library/jest-dom/vitest'
3-
import { transfer_settings } from '@opentrons/shared-data'
4-
import { ModuleModel, CompletedProtocolAnalysis } from '@opentrons/shared-data'
3+
import {
4+
transfer_settings,
5+
ModuleModel,
6+
CompletedProtocolAnalysis,
7+
} from '@opentrons/shared-data'
58
import { createSnippet } from '../createSnippet'
69

710
const protocolWithMagTempTC = ({

app/src/organisms/AdvancedSettings/ClearUnavailableRobots.tsx

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { TertiaryButton } from '../../atoms/buttons'
2424
import { ERROR_TOAST, SUCCESS_TOAST } from '../../atoms/Toast'
2525
import { useToaster } from '../../organisms/ToasterOven'
2626
import { LegacyModal } from '../../molecules/LegacyModal'
27-
import { Portal, getTopPortalEl } from '../../App/portal'
27+
import { getTopPortalEl } from '../../App/portal'
2828
import {
2929
clearDiscoveryCache,
3030
getReachableRobots,
@@ -63,41 +63,43 @@ export function ClearUnavailableRobots(): JSX.Element {
6363
} = useConditionalConfirm(handleDeleteUnavailRobots, true)
6464
return (
6565
<>
66-
{showConfirmDeleteUnavailRobots ? createPortal(
67-
<LegacyModal
68-
type="warning"
69-
title={t('clear_unavailable_robots')}
70-
onClose={cancelExit}
71-
>
72-
<StyledText as="p">{t('clearing_cannot_be_undone')}</StyledText>
73-
<Flex
74-
flexDirection={DIRECTION_ROW}
75-
paddingTop={SPACING.spacing32}
76-
justifyContent={JUSTIFY_FLEX_END}
66+
{showConfirmDeleteUnavailRobots
67+
? createPortal(
68+
<LegacyModal
69+
type="warning"
70+
title={t('clear_unavailable_robots')}
71+
onClose={cancelExit}
7772
>
73+
<StyledText as="p">{t('clearing_cannot_be_undone')}</StyledText>
7874
<Flex
79-
paddingRight={SPACING.spacing4}
80-
data-testid="AdvancedSettings_ConfirmClear_Cancel"
75+
flexDirection={DIRECTION_ROW}
76+
paddingTop={SPACING.spacing32}
77+
justifyContent={JUSTIFY_FLEX_END}
8178
>
82-
<Btn
83-
onClick={cancelExit}
84-
textTransform={TYPOGRAPHY.textTransformCapitalize}
85-
color={COLORS.blue50}
86-
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
87-
marginRight={SPACING.spacing32}
79+
<Flex
80+
paddingRight={SPACING.spacing4}
81+
data-testid="AdvancedSettings_ConfirmClear_Cancel"
8882
>
89-
{t('shared:cancel')}
90-
</Btn>
91-
</Flex>
92-
<Flex data-testid="AdvancedSettings_ConfirmClear_Proceed">
93-
<AlertPrimaryButton onClick={confirmDeleteUnavailRobots}>
94-
{t('clear_confirm')}
95-
</AlertPrimaryButton>
83+
<Btn
84+
onClick={cancelExit}
85+
textTransform={TYPOGRAPHY.textTransformCapitalize}
86+
color={COLORS.blue50}
87+
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
88+
marginRight={SPACING.spacing32}
89+
>
90+
{t('shared:cancel')}
91+
</Btn>
92+
</Flex>
93+
<Flex data-testid="AdvancedSettings_ConfirmClear_Proceed">
94+
<AlertPrimaryButton onClick={confirmDeleteUnavailRobots}>
95+
{t('clear_confirm')}
96+
</AlertPrimaryButton>
97+
</Flex>
9698
</Flex>
97-
</Flex>
98-
</LegacyModal>,
99-
getTopPortalEl()
100-
) : null}
99+
</LegacyModal>,
100+
getTopPortalEl()
101+
)
102+
: null}
101103
<Flex
102104
alignItems={ALIGN_CENTER}
103105
justifyContent={JUSTIFY_SPACE_BETWEEN}

app/src/organisms/AdvancedSettings/__tests__/ClearUnavailableRobots.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react'
2-
import { screen, fireEvent, waitFor } from '@testing-library/react'
2+
import { screen, fireEvent } from '@testing-library/react'
33
import { describe, it, expect, vi, beforeEach } from 'vitest'
44
import { useConditionalConfirm } from '@opentrons/components'
55
import { i18n } from '../../../i18n'

app/src/organisms/ApplyHistoricOffsets/hooks/__tests__/getLabwareLocationCombos.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, it, expect, beforeEach } from 'vitest'
1+
import { describe, it, expect } from 'vitest'
22
import {
33
getLabwareDefURI,
44
opentrons96PcrAdapterV1,

app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/LiquidDetailCard.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22
import { fireEvent, screen } from '@testing-library/react'
3-
import { describe, it, beforeEach, vi, expect } from 'vitest'
3+
import { describe, it, beforeEach, vi, expect, Mock } from 'vitest'
44

55
import { SPACING, COLORS } from '@opentrons/components'
66

@@ -16,8 +16,6 @@ import {
1616
import { getIsOnDevice } from '../../../../../redux/config'
1717
import { LiquidDetailCard } from '../LiquidDetailCard'
1818

19-
import { Mock } from 'vitest'
20-
2119
vi.mock('../../../../../redux/analytics')
2220
vi.mock('../../../../../redux/config')
2321

app/src/organisms/Devices/ProtocolRun/SetupLiquids/__tests__/SetupLiquids.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import * as React from 'react'
22
import { describe, it, beforeEach, vi } from 'vitest'
3-
import { screen } from '@testing-library/react'
3+
import { screen, fireEvent } from '@testing-library/react'
44

55
import { renderWithProviders } from '../../../../../__testing-utils__'
66
import { i18n } from '../../../../../i18n'
77
import { SetupLiquids } from '../index'
88
import { SetupLiquidsList } from '../SetupLiquidsList'
99
import { SetupLiquidsMap } from '../SetupLiquidsMap'
1010
import { BackToTopButton } from '../../BackToTopButton'
11-
import { fireEvent } from '@testing-library/react'
1211

1312
vi.mock('../SetupLiquidsList')
1413
vi.mock('../SetupLiquidsMap')

app/src/organisms/Devices/ProtocolRun/__tests__/SetupRobotCalibration.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,27 @@ describe('SetupRobotCalibration', () => {
7777
})
7878

7979
it('renders deck, pipette, and tip length calibration components', () => {
80-
render()[0]
80+
render()
8181
screen.getByText('Mock SetupDeckCalibration')
8282
screen.getByText('Mock SetupInstrumentCalibration')
8383
screen.getByText('Mock SetupTipLengthCalibration')
8484
})
8585

8686
it('renders only pipette calibration component for Flex', () => {
8787
when(vi.mocked(useIsFlex)).calledWith(ROBOT_NAME).thenReturn(true)
88-
render()[0]
88+
render()
8989
expect(screen.queryByText('Mock SetupDeckCalibration')).toBeNull()
9090
screen.getByText('Mock SetupInstrumentCalibration')
9191
expect(screen.queryByText('Mock SetupTipLengthCalibration')).toBeNull()
9292
})
9393

9494
it('changes Proceed CTA copy based on next step', () => {
95-
render({ nextStep: 'labware_setup_step' })[0]
95+
render({ nextStep: 'labware_setup_step' })
9696
screen.getByRole('button', { name: 'Proceed to labware' })
9797
})
9898

9999
it('calls the expandStep function and tracks the analytics event on click', () => {
100-
render()[0]
100+
render()
101101
fireEvent.click(screen.getByRole('button', { name: 'Proceed to modules' }))
102102
expect(mockExpandStep).toHaveBeenCalled()
103103
expect(mockTrackEvent).toHaveBeenCalledWith({
@@ -107,7 +107,7 @@ describe('SetupRobotCalibration', () => {
107107
})
108108

109109
it('does not call the expandStep function on click if calibration is not complete', () => {
110-
render({ calibrationStatus: { complete: false } })[0]
110+
render({ calibrationStatus: { complete: false } })
111111
const button = screen.getByRole('button', { name: 'Proceed to modules' })
112112
expect(button).toBeDisabled()
113113
fireEvent.click(button)
@@ -116,7 +116,7 @@ describe('SetupRobotCalibration', () => {
116116

117117
it('does not call the expandStep function on click if run has started', () => {
118118
when(vi.mocked(useRunHasStarted)).calledWith(RUN_ID).thenReturn(true)
119-
render()[0]
119+
render()
120120
const button = screen.getByRole('button', { name: 'Proceed to modules' })
121121
expect(button).toBeDisabled()
122122
fireEvent.click(button)

0 commit comments

Comments
 (0)