✅ Tester la logique n-conditions, corriger l'aiguillage, supprimer le warning https://fb.me/react-warning-keys
parent
a7d5f3dc55
commit
9b427690ec
|
@ -61,3 +61,14 @@ describe('analyseSituation on raw rules', function() {
|
|||
*/
|
||||
|
||||
});
|
||||
|
||||
describe('analyseSituation with mecanisms', function() {
|
||||
|
||||
it('should handle n-way "or"', function() {
|
||||
let rawRules = [
|
||||
{nom: "startHere", formule: {"une de ces conditions": ["1 > 2", "1 > 0", "0 > 2"]}}],
|
||||
rules = rawRules.map(enrichRule)
|
||||
expect(analyseSituation(rules,"startHere")(stateSelector)).to.have.property('nodeValue',true)
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -286,7 +286,7 @@ let treat = (situationGate, rules, rule) => rawNode => {
|
|||
value={result.nodeValue}
|
||||
child={
|
||||
<ul>
|
||||
{result.explanation.map(item => <li key={item.name}>{item.jsx}</li>)}
|
||||
{result.explanation.map(item => <li key={item.name || item.text}>{item.jsx}</li>)}
|
||||
</ul>
|
||||
}
|
||||
/>
|
||||
|
@ -713,8 +713,8 @@ let treat = (situationGate, rules, rule) => rawNode => {
|
|||
let onNodeType = R.cond([
|
||||
[R.is(String), treatString],
|
||||
[R.is(Number), treatNumber],
|
||||
[!R.is(Object), treatOther],
|
||||
[R.T, treatObject]
|
||||
[R.is(Object), treatObject],
|
||||
[R.T, treatOther]
|
||||
])
|
||||
return onNodeType(rawNode)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue