2017-07-02 23:10:48 +00:00
|
|
|
import R from 'ramda'
|
2017-06-27 13:14:30 +00:00
|
|
|
import {expect} from 'chai'
|
2017-07-07 08:35:40 +00:00
|
|
|
import {rules, enrichRule, findVariantsAndRecords} from '../source/engine/rules'
|
2017-07-11 14:00:10 +00:00
|
|
|
import {analyseSituation, analyseTopDown} from '../source/engine/traverse'
|
2017-06-28 14:12:10 +00:00
|
|
|
|
|
|
|
let stateSelector = (state, name) => null
|
2017-06-27 13:14:30 +00:00
|
|
|
|
|
|
|
describe('enrichRule', function() {
|
|
|
|
|
|
|
|
it('should extract the type of the rule', function() {
|
|
|
|
let rule = {cotisation:{}}
|
|
|
|
expect(enrichRule(rule)).to.have.property('type','cotisation')
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should extract the dotted name of the rule', function() {
|
|
|
|
let rule = {espace:"contrat salarié", nom: "CDD"}
|
2017-06-27 14:50:16 +00:00
|
|
|
expect(enrichRule(rule)).to.have.property('name','CDD')
|
2017-06-27 13:14:30 +00:00
|
|
|
expect(enrichRule(rule)).to.have.property('dottedName','contrat salarié . CDD')
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render Markdown in sub-questions', function() {
|
|
|
|
let rule = {"sous-question":"**wut**"}
|
|
|
|
expect(enrichRule(rule)).to.have.property('subquestion','<p><strong>wut</strong></p>\n')
|
|
|
|
});
|
|
|
|
});
|