if-condition-optional-field-opts-out.json 1.5 KB

12345678910111213141516171819202122232425
  1. {
  2. "name": "verify-if-condition-optional-field-opts-out",
  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' };"}},
  7. {"id": "n3", "name": "PromoApplied", "type": "if-condition", "position": {"x": 0, "y": 200},
  8. "config": {"conditions": [{"field": "data.result.promo.applied", "operator": "is_true", "value": "", "optional": true}], "combineWith": "and"}},
  9. {"id": "n4", "name": "OnTrue", "type": "code", "position": {"x": -100, "y": 300},
  10. "config": {"code": "return { marker: 'should not run' };"}},
  11. {"id": "n5", "name": "OnFalse", "type": "code", "position": {"x": 100, "y": 300},
  12. "config": {"code": "return { marker: 'no promo, treated as false' };"}}
  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": false, "_activeBranch": "false"}},
  22. "n5": {"status": "completed", "output": {"result": {"marker": "no promo, treated as false"}}}
  23. },
  24. "expectMissing": ["n4"]
  25. }