From 213a0ac803a9b1700d62d5cc990dfaa0a013cf56 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Sat, 4 Nov 2017 12:27:12 +0100 Subject: [PATCH] =?UTF-8?q?:gear:=20Pr=C3=A9parer=20la=20suppression=20de?= =?UTF-8?q?=20buildNextSteps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/generateQuestions.test.js | 16 ++++++++-------- test/reducers.test.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/generateQuestions.test.js b/test/generateQuestions.test.js index c9a2509d5..5937d4134 100644 --- a/test/generateQuestions.test.js +++ b/test/generateQuestions.test.js @@ -2,7 +2,7 @@ import R from 'ramda' import {expect} from 'chai' import {rules as realRules, enrichRule} from '../source/engine/rules' import {analyseSituation, analyseTopDown} from '../source/engine/traverse' -import {buildNextSteps, collectMissingVariables, getObjectives} from '../source/engine/generateQuestions' +import {nextSteps, collectMissingVariables, getObjectives} from '../source/engine/generateQuestions' let stateSelector = (name) => null @@ -218,7 +218,7 @@ describe('collectMissingVariables', function() { }); -describe('buildNextSteps', function() { +describe('nextSteps', function() { it('should generate questions', function() { let rawRules = [ @@ -228,10 +228,10 @@ describe('buildNextSteps', function() { {nom: "ko", espace: "top . sum . evt"}], rules = rawRules.map(enrichRule), situation = analyseTopDown(rules,"sum")(stateSelector), - result = buildNextSteps(stateSelector, rules, situation) + result = nextSteps(stateSelector, rules, situation) expect(result).to.have.lengthOf(1) - expect(R.path(["question","props","label"])(result[0])).to.equal("?") + expect(result[0]).to.equal("top . sum . evt") }); it('should generate questions from the real rules', function() { @@ -239,7 +239,7 @@ describe('buildNextSteps', function() { situation = analyseTopDown(rules,"surcoût CDD")(stateSelector), objectives = getObjectives(stateSelector, situation.root, situation.parsedRules), missing = collectMissingVariables()(stateSelector,situation), - result = buildNextSteps(stateSelector, rules, situation) + result = nextSteps(stateSelector, rules, situation) // expect(objectives).to.have.lengthOf(4) @@ -271,10 +271,10 @@ describe('buildNextSteps', function() { situation = analyseTopDown(rules,"Salaire")(stateSelector), objectives = getObjectives(stateSelector, situation.root, situation.parsedRules), missing = collectMissingVariables()(stateSelector,situation), - result = buildNextSteps(stateSelector, rules, situation) + result = nextSteps(stateSelector, rules, situation) - expect(R.path(["question","props","label"])(result[0])).to.equal("Quel est le salaire brut mensuel ?") - expect(R.path(["question","props","label"])(result[1])).to.equal("Le contrat est-il à temps partiel ?") + expect(result[0]).to.equal("contrat salarié . salaire de base") + expect(result[1]).to.equal("contrat salarié . temps partiel") }); }); diff --git a/test/reducers.test.js b/test/reducers.test.js index a5d535db6..2c2e02dd8 100644 --- a/test/reducers.test.js +++ b/test/reducers.test.js @@ -3,7 +3,7 @@ import R from 'ramda' import {expect} from 'chai' import {rules as realRules, enrichRule} from '../source/engine/rules' import {analyseSituation, analyseTopDown} from '../source/engine/traverse' -import {buildNextSteps, collectMissingVariables, getObjectives} from '../source/engine/generateQuestions' +import {collectMissingVariables, getObjectives} from '../source/engine/generateQuestions' import {reduceSteps} from '../source/reducers'