diff --git a/source/selectors/analyseSelectors.js b/source/selectors/analyseSelectors.js index 62db0d319..f1efdd703 100644 --- a/source/selectors/analyseSelectors.js +++ b/source/selectors/analyseSelectors.js @@ -11,8 +11,8 @@ import { head, isEmpty, pick } from 'ramda' import { getFormValues } from 'redux-form' import { collectDefaults, - rules, - rulesFr, + rules as baseRulesEn, + rulesFr as baseRulesFr, nestedSituationToPathMap, formatInputs, findRuleByDottedName, @@ -26,11 +26,10 @@ import { * * */ -let langSelector = state => state.lang - export let flatRulesSelector = createSelector( - [langSelector], - lang => (lang === 'en' ? rules : rulesFr) + state => state.lang, + state => state.rules, + (lang, rules) => rules || (lang === 'en' ? baseRulesEn : baseRulesFr) ) let parsedRulesSelector = createSelector([flatRulesSelector], rules => diff --git a/test/mecanisms.test.js b/test/mecanisms.test.js index b7e4cb98d..ed82766b3 100644 --- a/test/mecanisms.test.js +++ b/test/mecanisms.test.js @@ -10,7 +10,7 @@ import { analyse, parseAll } from '../source/engine/traverse' import { collectMissingVariables } from '../source/engine/generateQuestions' import testSuites from './load-mecanism-tests' import * as R from 'ramda' -import { isFloat } from '../source/components/rule/Examples' +import { isFloat } from '../source/utils' describe('Mécanismes', () => testSuites.map(suite =>