Skip to content

Commit

Permalink
add test coverage for tip length calibration active index
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbowser committed Dec 19, 2022
1 parent 0b4fe4f commit 4bad6e1
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('useGenerateTaskList hook', () => {
expect(result.current.taskList[2].description).toEqual('Empty')
})

it('returns the the correct active index for a task that needs to be completed without subtasks', () => {
it('returns the the correct active when Deck Calibration is needed', () => {
when(mockUseAttachedPipettes)
.calledWith()
.mockReturnValue(mockAttachedPipettesResponse)
Expand All @@ -136,7 +136,7 @@ describe('useGenerateTaskList hook', () => {
expect(result.current.activeIndex).toEqual([0, 0])
})

it('returns the the correct active index for a task with a subtask that needs to be completed', () => {
it('returns the the correct active index when a pipette is missing Offset Calibrations', () => {
when(mockUseAttachedPipettes)
.calledWith()
.mockReturnValue(mockAttachedPipettesResponse)
Expand All @@ -156,6 +156,26 @@ describe('useGenerateTaskList hook', () => {
expect(result.current.activeIndex).toEqual([2, 1])
})

it('returns the the correct active index when a pipette is missing Tip Length Calibrations', () => {
when(mockUseAttachedPipettes)
.calledWith()
.mockReturnValue(mockAttachedPipettesResponse)
when(mockUseDeckCalibrationData)
.calledWith('otie')
.mockReturnValue(mockCompleteDeckCalibration)
when(mockUseTipLengthCalibrations)
.calledWith('otie')
.mockReturnValue(mockIncompleteTipLengthCalibrations)
when(mockUsePipetteOffsetCalibrations)
.calledWith('otie')
.mockReturnValue(mockCompletePipetteOffsetCalibrations) // right mount marked as bad
const { result } = renderHook(() => useGenerateTaskList('otie'), {
wrapper,
})

expect(result.current.activeIndex).toEqual([1, 0])
})

it('returns the earliest encountered task as the active index when multiple tasks require calibrations', () => {
when(mockUseAttachedPipettes)
.calledWith()
Expand Down

0 comments on commit 4bad6e1

Please sign in to comment.