| 123456789101112131415161718192021222324252627282930313233343536 |
- {
- "name": "verify-if-condition-resolvable-path-both-branches",
- "nodes": [
- {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
- {"id": "n2", "name": "Fixture", "type": "code", "position": {"x": 0, "y": 100},
- "config": {"code": "return { status: 'paid', amount: 42 };"}},
- {"id": "ifTrue", "name": "IfTrue", "type": "if-condition", "position": {"x": -150, "y": 200},
- "config": {"conditions": [{"field": "data.result.status", "operator": "equals", "value": "paid"}], "combineWith": "and"}},
- {"id": "ifFalse", "name": "IfFalse", "type": "if-condition", "position": {"x": 150, "y": 200},
- "config": {"conditions": [{"field": "data.result.status", "operator": "equals", "value": "refunded"}], "combineWith": "and"}},
- {"id": "onTrue", "name": "OnTrue", "type": "code", "position": {"x": -200, "y": 300},
- "config": {"code": "return { marker: 'true-branch-ran' };"}},
- {"id": "onTrueUnexpected", "name": "OnTrueUnexpected", "type": "code", "position": {"x": -100, "y": 300},
- "config": {"code": "return { marker: 'should not run' };"}},
- {"id": "onFalseUnexpected", "name": "OnFalseUnexpected", "type": "code", "position": {"x": 100, "y": 300},
- "config": {"code": "return { marker: 'should not run' };"}},
- {"id": "onFalse", "name": "OnFalse", "type": "code", "position": {"x": 200, "y": 300},
- "config": {"code": "return { marker: 'false-branch-ran' };"}}
- ],
- "connections": [
- {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"},
- {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "ifTrue", "targetInput": "data"},
- {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "ifFalse", "targetInput": "data"},
- {"sourceNodeId": "ifTrue", "sourceOutput": "true", "targetNodeId": "onTrue", "targetInput": "data"},
- {"sourceNodeId": "ifTrue", "sourceOutput": "false", "targetNodeId": "onTrueUnexpected", "targetInput": "data"},
- {"sourceNodeId": "ifFalse", "sourceOutput": "true", "targetNodeId": "onFalseUnexpected", "targetInput": "data"},
- {"sourceNodeId": "ifFalse", "sourceOutput": "false", "targetNodeId": "onFalse", "targetInput": "data"}
- ],
- "expect": {
- "ifTrue": {"status": "completed", "output": {"result": true, "_activeBranch": "true"}},
- "ifFalse": {"status": "completed", "output": {"result": false, "_activeBranch": "false"}},
- "onTrue": {"status": "completed", "output": {"result": {"marker": "true-branch-ran"}}},
- "onFalse": {"status": "completed", "output": {"result": {"marker": "false-branch-ran"}}}
- },
- "expectMissing": ["onTrueUnexpected", "onFalseUnexpected"]
- }
|