Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests fixes #232

Merged
merged 8 commits into from
May 13, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Provider } from 'react-redux';
import Adapter from 'enzyme-adapter-react-16';
import thunk from 'redux-thunk';
import configureMockStore from 'redux-mock-store';
import { enableFetchMocks } from 'jest-fetch-mock';
import { Empty } from 'antd';
// eslint-disable-next-line import/no-named-as-default
import HeatmapPlot from '../../../../components/data-exploration/heatmap/HeatmapPlot';
Expand All @@ -14,6 +15,7 @@ import { CELL_SETS_LOADING } from '../../../../redux/actionTypes/cellSets';
jest.mock('localforage');
jest.mock('../../../../components/data-exploration/heatmap/VegaHeatmap');
VegaHeatmap.mockImplementation(() => <div>Mocked Vega Heatmap</div>);
enableFetchMocks();

const mockStore = configureMockStore([thunk]);
configure({ adapter: new Adapter() });
Expand Down
7 changes: 6 additions & 1 deletion src/components/data-processing/StepsIndicator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ const StepsIndicator = (props) => {
completed: '#1890ff', // blue
};
return (
<div>
<div
role='progressbar'
aria-valuemin='0'
aria-valuemax={allSteps.length}
aria-valuenow={completedSteps}
>
{allSteps.map((step, index) => {
let color = colors.completed;
if (index === currentStep) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
)
}

}, [samples.meta.loading])
}, [samples.meta.loading, samples.ids])

useEffect(() => {
if (
Expand All @@ -134,7 +134,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
})
}

}, [preFilteredSamples, processingConfig.meta])
}, [stepIdx, preFilteredSamples, processingConfig.meta])

useEffect(() => {
if (sampleKeys && sampleKeys.length === 1) {
Expand Down Expand Up @@ -469,6 +469,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
{steps[stepIdx].multiSample && (
<Button
disabled={stepDisabledByCondition}
data-testid='enableFilterButton'
onClick={() => {
dispatch(updateProcessingSettings(
experimentId,
Expand All @@ -489,6 +490,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
{steps[stepIdx].multiSample && (
<Button
id='runFilterButton'
data-testid='runFilterButton'
type='primary'
onClick={() => { onPipelineRun(steps[stepIdx].key) }}
disabled={!pipelineErrors.includes(pipelineStatusKey) && !changesOutstanding}
Expand Down Expand Up @@ -517,6 +519,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
<Col style={{ marginLeft: 'auto' }}>
<Space size='large'>
<Button
data-testid='pipelinePrevStep'
disabled={stepIdx === 0}
icon={<LeftOutlined />}
onClick={() => changeStepId(Math.max(stepIdx - 1, 0))}
Expand All @@ -525,6 +528,7 @@ const DataProcessingPage = ({ experimentId, experimentData, route }) => {
</Button>
{stepIdx !== steps.length - 1 ? (
<Button
data-testid='pipelineNextStep'
onClick={() => {
const newStepIdx = Math.min(stepIdx + 1, steps.length - 1);
changeStepId(newStepIdx);
Expand Down