baseline-if-condition.json 1.4 KB

12345678910111213141516171819202122232425
  1. {
  2. "name": "verify-baseline-if-condition",
  3. "nodes": [
  4. {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
  5. {"id": "n2", "name": "Fixture", "type": "code", "position": {"x": 0, "y": 100},
  6. "config": {"code": "return { status: 'paid', amount: 42 };"}},
  7. {"id": "n3", "name": "If", "type": "if-condition", "position": {"x": 0, "y": 200},
  8. "config": {"conditions": [{"field": "data.result.status", "operator": "equals", "value": "paid"}], "combineWith": "and"}},
  9. {"id": "n4", "name": "OnTrue", "type": "code", "position": {"x": -100, "y": 300},
  10. "config": {"code": "return { marker: 'true-branch' };"}},
  11. {"id": "n5", "name": "OnFalse", "type": "code", "position": {"x": 100, "y": 300},
  12. "config": {"code": "return { marker: 'false-branch' };"}}
  13. ],
  14. "connections": [
  15. {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"},
  16. {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n3", "targetInput": "data"},
  17. {"sourceNodeId": "n3", "sourceOutput": "true", "targetNodeId": "n4", "targetInput": "data"},
  18. {"sourceNodeId": "n3", "sourceOutput": "false", "targetNodeId": "n5", "targetInput": "data"}
  19. ],
  20. "expect": {
  21. "n3": {"status": "completed", "output": {"result": true, "_activeBranch": "true"}},
  22. "n4": {"status": "completed", "output": {"result": {"marker": "true-branch"}}}
  23. },
  24. "expectMissing": ["n5"]
  25. }