Résolution des tests de reducer

pull/138/head
mama 2017-11-27 12:34:54 +01:00
parent 9b545ee583
commit 4c38280d64
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ describe('fold', function() {
// situation = analyseTopDown(rules,"startHere")(stateSelector({})),
// objectives = getObjectives(stateSelector({}), situation.root, situation.parsedRules),
// missing = collectMissingVariables(stateSelector({}),situation),
result = reducer({},action)
result = reducer({foldedSteps: []},action)
expect(result).to.have.property('currentQuestion')
expect(result.currentQuestion).to.equal("top . aa")
@ -49,7 +49,7 @@ describe('fold', function() {
rules = rawRules.map(enrichRule),
reducer = reduceSteps(tracker, rules, stateSelector)
var step1 = reducer({},{type:'START_CONVERSATION', targetNames: ['startHere']})
var step1 = reducer({foldedSteps: []},{type:'START_CONVERSATION', targetNames: ['startHere']})
fakeState['top . aa'] = 1
var step2 = reducer(step1,{type:'STEP_ACTION', name: 'fold', step: 'top . aa'})
fakeState['top . bb'] = 1
@ -92,7 +92,7 @@ describe('fold', function() {
rules = yaml.safeLoad(rawRules).map(enrichRule),
reducer = reduceSteps(tracker, rules, stateSelector)
var step1 = reducer({},{type:'START_CONVERSATION', targetNames: ['net']})
var step1 = reducer({foldedSteps: []},{type:'START_CONVERSATION', targetNames: ['net']})
expect(step1).to.have.property('currentQuestion')
expect(step1.currentQuestion).to.equal('brut')