Tester les questions posées par la simulation Salaire

pull/25/head
Laurent Bossavit 2017-07-28 16:25:07 +02:00
parent 7ccc8e4e1f
commit a88a460dfc
1 changed files with 14 additions and 0 deletions

View File

@ -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 ?")
});
});