Skip to content

Commit

Permalink
Update DeckSetup.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
koji committed Mar 2, 2024
1 parent 1a6d6fd commit dfc4ba9
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions app/src/organisms/CalibrationPanels/__tests__/DeckSetup.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import * as React from 'react'
import { fireEvent, screen } from '@testing-library/react'
import { vi, it, describe, expect } from 'vitest'

import { getDeckDefinitions } from '@opentrons/shared-data'
import { vi, it, describe, expect, beforeEach } from 'vitest'

import { renderWithProviders } from '../../../__testing-utils__'
import { i18n } from '../../../i18n'
Expand All @@ -14,22 +15,15 @@ import * as Sessions from '../../../redux/sessions'

import { DeckSetup } from '../DeckSetup'

import type * as OpentronsComponent from '@opentrons/components'

vi.mock('../../../assets/labware/getLabware')
vi.mock('@opentrons/shared-data')
vi.mock(
'@opentrons/components/src/hardware-sim/Deck/RobotWorkSpace',
async importOriginal => {
const actual = await importOriginal<
typeof OpentronsComponent.RobotWorkSpace
>()
return {
...actual,
RobotWorkSpace: () => <></>,
}
vi.mock('@opentrons/shared-data', async importOriginal => {
const actual = await importOriginal<typeof getDeckDefinitions>()
return {
...actual,
getDeckDefinitions: () => vi.fn(),
}
)
})
vi.mock('@opentrons/components/src/hardware-sim/Deck/RobotWorkSpace')

describe('DeckSetup', () => {
const mockSendCommands = vi.fn()
Expand Down Expand Up @@ -65,10 +59,6 @@ describe('DeckSetup', () => {
)
}

beforeEach(() => {
vi.mocked(getDeckDefinitions).mockReturnValue({})
})

it('clicking continue proceeds to next step', () => {
render()
fireEvent.click(screen.getByRole('button', { name: 'Confirm placement' }))
Expand Down

0 comments on commit dfc4ba9

Please sign in to comment.