-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00fc80a
commit 530d447
Showing
17 changed files
with
107 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
app/src/calibration/labware/epic/fetchSingleLabwareCalibrationEpic.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,77 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import { Provider } from 'react-redux' | ||
import { mount } from 'enzyme' | ||
|
||
import { getCalibrateLocation, getRunLocation } from '../../../nav' | ||
import { PrimaryButton } from '@opentrons/components' | ||
import { Continue } from '../Continue' | ||
|
||
import type { State } from '../../../types' | ||
|
||
jest.mock('../../nav') | ||
|
||
const mockGetCalNavigation: JestMockFn< | ||
[State], | ||
$Call<typeof getCalibrateLocation, State> | ||
> = getCalibrateLocation | ||
|
||
const mockGetRunNavigation: JestMockFn< | ||
[State], | ||
$Call<typeof getRunLocation, State> | ||
> = getRunLocation | ||
|
||
const mockRunPath = '/path/to/run' | ||
const mockCalPath = '/path/to/cal' | ||
|
||
describe('Continue to run or calibration button component', () => { | ||
const render = (status: boolean = false) => { | ||
return mount(<Continue labwareCalibrated={status} />) | ||
let mockStore | ||
let render | ||
|
||
const CALIBRATE_SELECTOR = { | ||
id: 'calibrate', | ||
path: mockCalPath, | ||
title: 'CALIBRATE', | ||
iconName: 'ot-calibrate', | ||
disabledReason: null, | ||
} | ||
|
||
const RUN_SELECTOR = { | ||
id: 'run', | ||
path: mockRunPath, | ||
title: 'RUN', | ||
iconName: 'ot-run', | ||
disabledReason: null, | ||
} | ||
|
||
beforeEach(() => { | ||
mockGetCalNavigation.mockReturnValue(CALIBRATE_SELECTOR) | ||
mockGetRunNavigation.mockReturnValue(RUN_SELECTOR) | ||
|
||
mockStore = { | ||
subscribe: () => {}, | ||
getState: () => ({ state: true }), | ||
dispatch: jest.fn(), | ||
} | ||
render = (labwareCalibrated: boolean = false) => | ||
mount( | ||
<Provider store={mockStore}> | ||
<Continue labwareCalibrated={labwareCalibrated} /> | ||
</Provider> | ||
) | ||
}) | ||
|
||
it('Default button renders to continue to labware when not all labware is calibrated', () => { | ||
const wrapper = render() | ||
const button = wrapper.find(PrimaryButton) | ||
console.log(button) | ||
expect(button.children).toEqual('Proceed to Calibrate') | ||
expect(wrapper.children).toEqual('Proceed to Calibrate') | ||
expect(button.props.path).toEqual(mockCalPath) | ||
}) | ||
|
||
it('renders nothing when calibration is OK', () => { | ||
const wrapper = render(true) | ||
const button = wrapper.find(PrimaryButton) | ||
console.log(button.children) | ||
expect(button.children).toEqual('Proceed to Calibrate') | ||
expect(wrapper.children).toEqual('Proceed to Run') | ||
expect(button.props.path).toEqual(mockRunPath) | ||
}) | ||
}) |
Oops, something went wrong.