@@ -687,7 +687,7 @@ describe("Engine: event", () => {
687
687
await engine . run ( ) ;
688
688
const ruleResult = successSpy . mock . calls [ 0 ] [ 2 ] ;
689
689
const expected =
690
- '{"conditions":{"priority":1,"any":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true},{"operator":"equal","value":true,"fact":"qualified","factResult":false,"result":false}]},"event":{"type":"setDrinkingFlag","params":{"canOrderDrinks":true}},"priority":100,"result":true}' ;
690
+ '{"conditions":{"priority":1,"any":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true},{"operator":"equal","value":true,"fact":"qualified","factResult":false,"valueResult":true ,"result":false}]},"event":{"type":"setDrinkingFlag","params":{"canOrderDrinks":true}},"priority":100,"result":true}' ;
691
691
expect ( JSON . stringify ( ruleResult ) ) . toBe ( expected ) ;
692
692
} ) ;
693
693
} ) ;
@@ -696,7 +696,7 @@ describe("Engine: event", () => {
696
696
beforeEach ( ( ) => setupWithConditionReference ( ) )
697
697
it ( 'serializes properties' , async ( ) => {
698
698
const { results : [ ruleResult ] } = await engine . run ( )
699
- const expected = '{"conditions":{"priority":1,"any":[{"priority":1,"all":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true}]}]},"event":{"type":"awesome"},"priority":100,"result":true}'
699
+ const expected = '{"conditions":{"priority":1,"any":[{"priority":1,"all":[{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true}]}]},"event":{"type":"awesome"},"priority":100,"result":true}'
700
700
expect ( JSON . stringify ( ruleResult ) ) . toEqual ( expected )
701
701
} )
702
702
} )
@@ -707,7 +707,7 @@ describe("Engine: event", () => {
707
707
const { results : [ ruleResult ] } = await engine . run ( )
708
708
const { conditions : { any : [ conditionReference ] } } = ruleResult
709
709
expect ( conditionReference . result ) . toEqual ( false )
710
- const expected = '{"conditions":{"priority":1,"any":[{"name":"nameOfTheUndefinedConditionReference","condition":"conditionThatIsNotDefined"},{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"result":true}]},"event":{"type":"awesome"},"priority":100,"result":true}'
710
+ const expected = '{"conditions":{"priority":1,"any":[{"name":"nameOfTheUndefinedConditionReference","condition":"conditionThatIsNotDefined"},{"name":"over 21","operator":"greaterThanInclusive","value":21,"fact":"age","factResult":21,"valueResult":21," result":true}]},"event":{"type":"awesome"},"priority":100,"result":true}'
711
711
expect ( JSON . stringify ( ruleResult ) ) . toEqual ( expected )
712
712
} )
713
713
} )
0 commit comments