null;
@@ -21,7 +21,7 @@ const {
finalPopulationSizes,
outcome,
selectedStudyPopulationCohort,
-} = ValidInitialState;
+} = ValidState;
describe('JobInputModal', () => {
let wrapper;
diff --git a/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.stories.jsx b/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.stories.jsx
index 8eebba7b80..4af68178e7 100644
--- a/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.stories.jsx
+++ b/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.stories.jsx
@@ -5,7 +5,7 @@ import SelectionConfiguration from './SelectConfiguration';
import { rest } from 'msw';
import { QueryClient, QueryClientProvider } from 'react-query';
import '../../GWASV2.css';
-import ValidInitialState from '../../TestData/InitialStates/ValidInitialState';
+import ValidState from '../../TestData/States/ValidState';
export default {
title: 'Tests3/GWASV2/SelectConfiguration',
@@ -19,7 +19,7 @@ const mockedQueryClient = new QueryClient({
});
const MockTemplate = () => {
- const [state, dispatch] = useReducer(reducer, ValidInitialState);
+ const [state, dispatch] = useReducer(reducer, ValidState);
return (
diff --git a/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.test.jsx b/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.test.jsx
index 80fedd4251..e2823255ee 100644
--- a/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.test.jsx
+++ b/src/Analysis/GWASV2/Components/SelectConfiguration/SelectConfiguration.test.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import SelectConfiguration from './SelectConfiguration';
-import ValidInitialState from '../../TestData/InitialStates/ValidInitialState';
+import ValidState from '../../TestData/States/ValidState';
import ACTIONS from '../../Utils/StateManagement/Actions';
describe('SelectConfiguration component', () => {
@@ -14,7 +14,7 @@ describe('SelectConfiguration component', () => {
covariates,
outcome,
imputationScore,
- } = ValidInitialState;
+ } = ValidState;
beforeEach(() => {
wrapper = shallow(
diff --git a/src/Analysis/GWASV2/Components/SelectHare/SelectHareDropDown.test.jsx b/src/Analysis/GWASV2/Components/SelectHare/SelectHareDropDown.test.jsx
index 1c16a6bbcd..68d63642dc 100644
--- a/src/Analysis/GWASV2/Components/SelectHare/SelectHareDropDown.test.jsx
+++ b/src/Analysis/GWASV2/Components/SelectHare/SelectHareDropDown.test.jsx
@@ -3,7 +3,7 @@ import { mount } from 'enzyme';
import { Select } from 'antd';
import { QueryClient, QueryClientProvider } from 'react-query';
import SelectHareDropDown from './SelectHareDropDown';
-import ValidInitialState from '../../TestData/InitialStates/ValidInitialState';
+import ValidState from '../../TestData/States/ValidState';
import ACTIONS from '../../Utils/StateManagement/Actions';
import { SourceContextProvider } from '../../Utils/Source';
import {
@@ -30,7 +30,8 @@ fetchConceptStatsByHareSubset.mockResolvedValue({
],
});
useSourceFetch.mockResolvedValue({
- sourceId: 2, loading: false,
+ sourceId: 2,
+ loading: false,
});
// Other generic arguments and functions shared by tests below:
@@ -43,7 +44,8 @@ const mountDropDownForOutcome = (
selectedStudyPopulationCohort,
covariates,
outcome,
- dispatch) => mount(
+ dispatch,
+) => mount(
{
let wrapper;
- const {
- selectedStudyPopulationCohort,
- covariates,
- outcome,
- } = ValidInitialState;
+ const { selectedStudyPopulationCohort, covariates, outcome } = ValidState;
let dispatch;
beforeEach(() => {
dispatch = jest.fn();
// use mount() instead of shallow():
- wrapper = mountDropDownForOutcome(selectedStudyPopulationCohort,
+ wrapper = mountDropDownForOutcome(
+ selectedStudyPopulationCohort,
covariates,
outcome,
- dispatch);
+ dispatch,
+ );
});
it('should render the SelectHareDropDown component', async () => {
expect(wrapper.find(SelectHareDropDown).exists()).toBe(true);
@@ -107,10 +107,7 @@ describe('SelectHareDropDown component - Quantitative outcome test scenarios', (
describe('SelectHareDropDown component - Dichotomous (case/control) test scenarios', () => {
let wrapper;
- const {
- selectedStudyPopulationCohort,
- covariates,
- } = ValidInitialState;
+ const { selectedStudyPopulationCohort, covariates } = ValidState;
// Custom dichotomous (case/control) outcome type:
const outcome = {
variable_type: 'custom_dichotomous',
@@ -121,10 +118,12 @@ describe('SelectHareDropDown component - Dichotomous (case/control) test scenari
beforeEach(() => {
dispatch = jest.fn();
- wrapper = mountDropDownForOutcome(selectedStudyPopulationCohort,
+ wrapper = mountDropDownForOutcome(
+ selectedStudyPopulationCohort,
covariates,
outcome,
- dispatch);
+ dispatch,
+ );
});
it('should render the SelectHareDropDown component', async () => {
expect(wrapper.find(SelectHareDropDown).exists()).toBe(true);
@@ -154,7 +153,8 @@ describe('SelectHareDropDown component - Dichotomous (case/control) test scenari
payload: [
{ population: 'Control', size: 39648 },
{ population: 'Case', size: 39648 },
- { population: 'Total', size: 39648 * 2 }],
+ { population: 'Total', size: 39648 * 2 },
+ ],
});
});
});
diff --git a/src/Analysis/GWASV2/Steps/SelectCovariates/SelectCovariates.jsx b/src/Analysis/GWASV2/Steps/SelectCovariates/SelectCovariates.jsx
index 45089d64fc..243e96de00 100644
--- a/src/Analysis/GWASV2/Steps/SelectCovariates/SelectCovariates.jsx
+++ b/src/Analysis/GWASV2/Steps/SelectCovariates/SelectCovariates.jsx
@@ -82,6 +82,7 @@ const SelectCovariates = ({
dispatch({
type: ACTIONS.DELETE_COVARIATE,
payload: chosenCovariate,
diff --git a/src/Analysis/GWASV2/Steps/SelectOutcome/SelectOutcome.jsx b/src/Analysis/GWASV2/Steps/SelectOutcome/SelectOutcome.jsx
index 8e0edc3b83..2bb3c24915 100644
--- a/src/Analysis/GWASV2/Steps/SelectOutcome/SelectOutcome.jsx
+++ b/src/Analysis/GWASV2/Steps/SelectOutcome/SelectOutcome.jsx
@@ -76,6 +76,7 @@ const SelectOutcome = ({
dispatch({
type: ACTIONS.DELETE_COVARIATE,
payload: chosenCovariate,
diff --git a/src/Analysis/GWASV2/TestData/InitialStates/ValidInitialState.js b/src/Analysis/GWASV2/TestData/States/ValidState.js
similarity index 84%
rename from src/Analysis/GWASV2/TestData/InitialStates/ValidInitialState.js
rename to src/Analysis/GWASV2/TestData/States/ValidState.js
index 26b0ae9d1c..9b24ca4001 100644
--- a/src/Analysis/GWASV2/TestData/InitialStates/ValidInitialState.js
+++ b/src/Analysis/GWASV2/TestData/States/ValidState.js
@@ -1,4 +1,4 @@
-const ValidInitialState = {
+const ValidState = {
outcome: {
variable_type: 'concept',
concept_id: 2000000873,
@@ -10,6 +10,11 @@ const ValidInitialState = {
size: 510904,
},
covariates: [
+ {
+ variable_type: 'custom_dichotomous',
+ provided_name: 'providednamebyuser',
+ cohort_ids: [12, 32],
+ },
{
variable_type: 'concept',
concept_id: 2000000873,
@@ -43,4 +48,4 @@ const ValidInitialState = {
},
],
};
-export default ValidInitialState;
+export default ValidState;