Skip to content

Commit d808780

Browse files
shiyaochenshiyaochen
authored andcommitted
update test to check PositionField component
1 parent 1649f3a commit d808780

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/__tests__/MultiInputField.test.tsx

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { COLORS } from '@opentrons/components'
33
import { fireEvent, screen } from '@testing-library/react'
44
import { i18n } from '../../../../../../../assets/localization'
55
import { renderWithProviders } from '../../../../../../../__testing-utils__'
6+
import { PositionField } from '../../../PipetteFields'
67
import { MultiInputField } from '../MultiInputField'
78

89
import type { ComponentProps } from 'react'
@@ -54,35 +55,9 @@ describe('MultiInputField', () => {
5455
updateValue: vi.fn(),
5556
value: '',
5657
},
57-
aspirate_retract_mmFromBottom: {
58-
onFieldFocus: vi.fn(),
59-
onFieldBlur: vi.fn(),
60-
errorToShow: null,
61-
disabled: false,
62-
name: 'aspirate_retract_mmFromBottom',
63-
updateValue: vi.fn(),
64-
value: null,
65-
},
66-
aspirate_retract_x_position: {
67-
onFieldFocus: vi.fn(),
68-
onFieldBlur: vi.fn(),
69-
errorToShow: null,
70-
disabled: false,
71-
name: 'aspirate_retract_mmFromBottom',
72-
updateValue: vi.fn(),
73-
value: 0,
74-
},
75-
aspirate_retract_y_position: {
76-
onFieldFocus: vi.fn(),
77-
onFieldBlur: vi.fn(),
78-
errorToShow: null,
79-
disabled: false,
80-
name: 'aspirate_retract_mmFromBottom',
81-
updateValue: vi.fn(),
82-
value: 0,
83-
},
8458
},
8559
}
60+
vi.mocked(PositionField).mockReturnValue(<div>mock PositionField</div>)
8661
})
8762

8863
it('should render input fields with caption and units wrapped by ListItem', () => {
@@ -108,11 +83,10 @@ describe('MultiInputField', () => {
10883
).toHaveBeenCalled()
10984
})
11085

111-
it('should render a well position listbutton when isWellPosition is true', () => {
86+
it('should render a well position component when isWellPosition is true', () => {
11287
props.isWellPosition = true
11388
props.labwareId = 'mockID'
11489
render(props)
115-
const listButton = screen.getByTestId('ListButton_onColor')
116-
expect(listButton).toHaveStyle(`backgroundColor: ${COLORS.white}`)
90+
screen.getByText('mock PositionField')
11791
})
11892
})

0 commit comments

Comments
 (0)