From a88a460dfccb0d2cb5866113f108b4ff301f2240 Mon Sep 17 00:00:00 2001 From: Laurent Bossavit Date: Fri, 28 Jul 2017 16:25:07 +0200 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20Tester=20les=20questio?= =?UTF-8?q?ns=20pos=C3=A9es=20par=20la=20simulation=20Salaire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/generateQuestions.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/generateQuestions.test.js b/test/generateQuestions.test.js index 133a38eae..7eff30c9f 100644 --- a/test/generateQuestions.test.js +++ b/test/generateQuestions.test.js @@ -214,4 +214,18 @@ describe('buildNextSteps', function() { expect(R.path(["question","props","label"])(result[5])).to.equal("Combien de jours de congés ne seront pas pris ?") }); + it('should generate questions from the real rules, experimental version', function() { + let stateSelector = (name) => ({"contrat salarié . CDD . événement . poursuite du CDD en CDI":"oui"})[name] + + let rules = realRules.map(enrichRule), + situation = analyseTopDown(rules,"Salaire")(stateSelector), + objectives = getObjectives(stateSelector, situation.root, situation.parsedRules), + result = buildNextSteps(stateSelector, rules, situation) + + expect(objectives).to.have.lengthOf(2) + expect(result).to.have.lengthOf(2) + expect(R.path(["question","props","label"])(result[0])).to.equal("Quel est le salaire brut ?") + expect(R.path(["question","props","label"])(result[1])).to.equal("Le salarié a-t-il le statut cadre ?") + }); + });