@nyaruka/temba-components 0.142.1 → 0.142.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/temba-components.js +825 -654
  3. package/dist/temba-components.js.map +1 -1
  4. package/out-tsc/src/Icons.js +1 -0
  5. package/out-tsc/src/Icons.js.map +1 -1
  6. package/out-tsc/src/flow/CanvasMenu.js +30 -35
  7. package/out-tsc/src/flow/CanvasMenu.js.map +1 -1
  8. package/out-tsc/src/flow/CanvasNode.js +13 -8
  9. package/out-tsc/src/flow/CanvasNode.js.map +1 -1
  10. package/out-tsc/src/flow/Editor.js +18 -5
  11. package/out-tsc/src/flow/Editor.js.map +1 -1
  12. package/out-tsc/src/flow/NodeEditor.js +346 -10
  13. package/out-tsc/src/flow/NodeEditor.js.map +1 -1
  14. package/out-tsc/src/flow/NodeTypeSelector.js +2 -0
  15. package/out-tsc/src/flow/NodeTypeSelector.js.map +1 -1
  16. package/out-tsc/src/flow/Plumber.js +3 -1
  17. package/out-tsc/src/flow/Plumber.js.map +1 -1
  18. package/out-tsc/src/flow/actions/add_contact_urn.js +2 -6
  19. package/out-tsc/src/flow/actions/add_contact_urn.js.map +1 -1
  20. package/out-tsc/src/flow/actions/enter_flow.js +2 -2
  21. package/out-tsc/src/flow/actions/enter_flow.js.map +1 -1
  22. package/out-tsc/src/flow/actions/say_msg.js +2 -1
  23. package/out-tsc/src/flow/actions/say_msg.js.map +1 -1
  24. package/out-tsc/src/flow/actions/send_broadcast.js +2 -6
  25. package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -1
  26. package/out-tsc/src/flow/actions/send_email.js +2 -6
  27. package/out-tsc/src/flow/actions/send_email.js.map +1 -1
  28. package/out-tsc/src/flow/actions/send_msg.js +52 -35
  29. package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
  30. package/out-tsc/src/flow/actions/set_contact_channel.js +2 -1
  31. package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
  32. package/out-tsc/src/flow/actions/set_contact_field.js +4 -5
  33. package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
  34. package/out-tsc/src/flow/actions/set_contact_language.js +3 -3
  35. package/out-tsc/src/flow/actions/set_contact_language.js.map +1 -1
  36. package/out-tsc/src/flow/actions/set_contact_name.js +2 -1
  37. package/out-tsc/src/flow/actions/set_contact_name.js.map +1 -1
  38. package/out-tsc/src/flow/actions/set_contact_status.js +2 -1
  39. package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
  40. package/out-tsc/src/flow/actions/set_run_result.js +3 -3
  41. package/out-tsc/src/flow/actions/set_run_result.js.map +1 -1
  42. package/out-tsc/src/flow/actions/start_session.js +2 -2
  43. package/out-tsc/src/flow/actions/start_session.js.map +1 -1
  44. package/out-tsc/src/flow/nodes/split_by_llm.js +4 -5
  45. package/out-tsc/src/flow/nodes/split_by_llm.js.map +1 -1
  46. package/out-tsc/src/flow/nodes/split_by_resthook.js +3 -8
  47. package/out-tsc/src/flow/nodes/split_by_resthook.js.map +1 -1
  48. package/out-tsc/src/flow/nodes/split_by_subflow.js +2 -2
  49. package/out-tsc/src/flow/nodes/split_by_subflow.js.map +1 -1
  50. package/out-tsc/src/flow/nodes/split_by_webhook.js +25 -33
  51. package/out-tsc/src/flow/nodes/split_by_webhook.js.map +1 -1
  52. package/out-tsc/src/flow/nodes/wait_for_response.js +1 -0
  53. package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
  54. package/out-tsc/src/flow/types.js.map +1 -1
  55. package/out-tsc/src/flow/utils.js +68 -0
  56. package/out-tsc/src/flow/utils.js.map +1 -1
  57. package/out-tsc/src/form/FieldRenderer.js +17 -2
  58. package/out-tsc/src/form/FieldRenderer.js.map +1 -1
  59. package/out-tsc/src/interfaces.js +1 -0
  60. package/out-tsc/src/interfaces.js.map +1 -1
  61. package/out-tsc/src/simulator/Simulator.js +1 -1
  62. package/out-tsc/src/simulator/Simulator.js.map +1 -1
  63. package/out-tsc/test/temba-canvas-menu.test.js +13 -9
  64. package/out-tsc/test/temba-canvas-menu.test.js.map +1 -1
  65. package/out-tsc/test/temba-flow-reflow.test.js.map +1 -1
  66. package/out-tsc/test/temba-node-editor.test.js +9 -10
  67. package/out-tsc/test/temba-node-editor.test.js.map +1 -1
  68. package/out-tsc/test/temba-node-type-selector.test.js +3 -3
  69. package/out-tsc/test/temba-node-type-selector.test.js.map +1 -1
  70. package/out-tsc/test/temba-simulator.test.js +2 -2
  71. package/out-tsc/test/temba-simulator.test.js.map +1 -1
  72. package/package.json +1 -1
  73. package/screenshots/truth/actions/enter_flow/render/basic-flow.png +0 -0
  74. package/screenshots/truth/actions/enter_flow/render/long-flow-name.png +0 -0
  75. package/screenshots/truth/actions/send_email/render/long-subject.png +0 -0
  76. package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
  77. package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
  78. package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
  79. package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
  80. package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
  81. package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
  82. package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
  83. package/screenshots/truth/actions/send_msg/render/multiline-text-with-replies.png +0 -0
  84. package/screenshots/truth/actions/start_session/render/contact-query.png +0 -0
  85. package/screenshots/truth/actions/start_session/render/contacts-only.png +0 -0
  86. package/screenshots/truth/actions/start_session/render/create-contact.png +0 -0
  87. package/screenshots/truth/actions/start_session/render/groups-and-contacts.png +0 -0
  88. package/screenshots/truth/actions/start_session/render/groups-only.png +0 -0
  89. package/screenshots/truth/actions/start_session/render/many-recipients.png +0 -0
  90. package/screenshots/truth/canvas-menu/open.png +0 -0
  91. package/screenshots/truth/node-type-selector/action-mode.png +0 -0
  92. package/screenshots/truth/node-type-selector/split-mode.png +0 -0
  93. package/screenshots/truth/nodes/split_by_llm/render/information-extraction.png +0 -0
  94. package/screenshots/truth/nodes/split_by_llm/render/sentiment-analysis.png +0 -0
  95. package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
  96. package/screenshots/truth/nodes/split_by_llm_categorize/render/feedback-categorization.png +0 -0
  97. package/src/Icons.ts +1 -0
  98. package/src/flow/CanvasMenu.ts +38 -39
  99. package/src/flow/CanvasNode.ts +16 -8
  100. package/src/flow/Editor.ts +33 -6
  101. package/src/flow/NodeEditor.ts +373 -10
  102. package/src/flow/NodeTypeSelector.ts +2 -0
  103. package/src/flow/Plumber.ts +3 -1
  104. package/src/flow/actions/add_contact_urn.ts +5 -6
  105. package/src/flow/actions/enter_flow.ts +2 -2
  106. package/src/flow/actions/say_msg.ts +2 -1
  107. package/src/flow/actions/send_broadcast.ts +2 -6
  108. package/src/flow/actions/send_email.ts +2 -6
  109. package/src/flow/actions/send_msg.ts +56 -38
  110. package/src/flow/actions/set_contact_channel.ts +5 -1
  111. package/src/flow/actions/set_contact_field.ts +10 -5
  112. package/src/flow/actions/set_contact_language.ts +6 -3
  113. package/src/flow/actions/set_contact_name.ts +5 -1
  114. package/src/flow/actions/set_contact_status.ts +5 -1
  115. package/src/flow/actions/set_run_result.ts +6 -3
  116. package/src/flow/actions/start_session.ts +2 -2
  117. package/src/flow/nodes/split_by_llm.ts +5 -5
  118. package/src/flow/nodes/split_by_resthook.ts +3 -8
  119. package/src/flow/nodes/split_by_subflow.ts +2 -2
  120. package/src/flow/nodes/split_by_webhook.ts +26 -34
  121. package/src/flow/nodes/wait_for_response.ts +1 -0
  122. package/src/flow/types.ts +25 -2
  123. package/src/flow/utils.ts +81 -1
  124. package/src/form/FieldRenderer.ts +32 -3
  125. package/src/interfaces.ts +1 -0
  126. package/src/simulator/Simulator.ts +1 -1
  127. package/test/temba-canvas-menu.test.ts +13 -9
  128. package/test/temba-flow-reflow.test.ts +4 -2
  129. package/test/temba-node-editor.test.ts +9 -10
  130. package/test/temba-node-type-selector.test.ts +3 -3
  131. package/test/temba-simulator.test.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"temba-flow-reflow.test.js","sourceRoot":"","sources":["../../test/temba-flow-reflow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG9E,6CAA6C;AAC7C,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAsC;IACpE,OAAO;QACL,IAAI;QACJ,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,GAAG,IAAI,SAAS,CAAC,EAAE;YACzB,gBAAgB,EAAE,CAAC,CAAC,gBAAgB;SACrC,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC;AAED,8CAA8C;AAC9C,SAAS,YAAY,CAAC,KAAa,EAAE,MAAc;IACjD,OAAO,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,MAAM,GAAG,sBAAsB,CACnC,EAAE,EACF,EAAE,EACF,OAAO,EACP,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CACvB,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,GA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K,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,QAAQ,GAAG,EAAE,EAAE,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA6C,CAAC;YACvE,MAAM,WAAW,GAAG,IAAI,GAAG,EAA6C,CAAC;YAEzE,MAAM,MAAM,GAAG,gBAAgB,CAC7B,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,GAAG,CACJ,CAAC;YAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { calculateLayeredLayout, placeStickyNotes } from '../src/flow/reflow';\nimport { Node, StickyNote } from '../src/store/flow-definition';\n\n// Helper to create a minimal Node with exits\nfunction makeNode(uuid: string, exits: { destination_uuid?: string }[]): Node {\n return {\n uuid,\n actions: [],\n exits: exits.map((e, i) => ({\n uuid: `${uuid}-exit-${i}`,\n destination_uuid: e.destination_uuid\n }))\n };\n}\n\n// Helper to return a fixed size for all nodes\nfunction constantSize(width: number, height: number) {\n return () => ({ width, height });\n}\n\ndescribe('Reflow Layout', () => {\n describe('calculateLayeredLayout', () => {\n it('returns empty object for empty nodes', () => {\n const result = calculateLayeredLayout(\n [],\n {},\n 'start',\n constantSize(200, 100)\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('places a single node at the origin', () => {\n const nodes = [makeNode('A', [])];\n const nodeUIs = { A: { position: { left: 500, top: 500 } } };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['A'].left).to.equal(0);\n expect(result['A'].top).to.equal(0);\n });\n\n it('places a linear chain vertically', () => {\n // A -> B -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All should be at left=0 (centered under parent which is at 0)\n // A at layer 0, B at layer 1, C at layer 2\n expect(result['A'].top).to.equal(0);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n expect(result['C'].top).to.be.greaterThan(result['B'].top);\n });\n\n it('places siblings at the same vertical level', () => {\n // A -> B, A -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', []),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // B and C should be on the same layer (same top)\n expect(result['B'].top).to.equal(result['C'].top);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n // B and C should be side by side\n expect(result['B'].left).to.not.equal(result['C'].left);\n });\n\n it('snaps all positions to grid (multiples of 20)', () => {\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n for (const uuid of Object.keys(result)) {\n expect(result[uuid].left % 20).to.equal(0);\n expect(result[uuid].top % 20).to.equal(0);\n }\n });\n\n it('handles cycles (back-edges) without infinite loops', () => {\n // A -> B -> A (cycle)\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'A' }])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n // A should be above B (layer 0 vs layer 1)\n expect(result['A'].top).to.be.lessThan(result['B'].top);\n });\n\n it('handles diamond-shaped flows (merge nodes)', () => {\n // A -> B, A -> C, B -> D, C -> D\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', [{ destination_uuid: 'D' }]),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 150, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // D should be below both B and C (longest path assignment)\n expect(result['D'].top).to.be.greaterThan(result['B'].top);\n expect(result['D'].top).to.be.greaterThan(result['C'].top);\n // B and C on same layer\n expect(result['B'].top).to.equal(result['C'].top);\n });\n\n it('handles deduplicated exits (same destination from multiple exits)', () => {\n // A has two exits both pointing to B\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'B' }]),\n makeNode('B', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n });\n\n it('handles exits with no destination', () => {\n const nodes = [\n makeNode('A', [\n { destination_uuid: undefined },\n { destination_uuid: 'B' }\n ]),\n makeNode('B', [{ destination_uuid: undefined }])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n });\n\n it('handles disconnected nodes', () => {\n // A -> B, C is disconnected (no edges at all)\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', []),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 300 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All nodes should receive positions\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n expect(result['C']).to.not.be.undefined;\n // C (no edges, inDegree 0) lands in layer 0 alongside start node\n // but gets a 40px vertical offset since it's not the start node\n expect(result['C'].top).to.equal(40);\n });\n\n it('positions all nodes with non-negative coordinates', () => {\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', [{ destination_uuid: 'D' }]),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 150, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n for (const uuid of Object.keys(result)) {\n expect(result[uuid].left).to.be.at.least(0);\n expect(result[uuid].top).to.be.at.least(0);\n }\n });\n\n it('uses different node sizes for layout', () => {\n // A -> B -> C, B is tall\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 500 } }\n };\n const getSize = (uuid: string) => {\n if (uuid === 'B') return { width: 200, height: 300 };\n return { width: 200, height: 100 };\n };\n const result = calculateLayeredLayout(nodes, nodeUIs, 'A', getSize);\n\n // Gap between B and C should account for B's height of 300\n const bBottom = result['B'].top + 300;\n expect(result['C'].top).to.be.greaterThanOrEqual(bBottom);\n });\n\n it('handles a complex flow with self-loops', () => {\n // A -> B, B -> B (self-loop), B -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A'].top).to.equal(0);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n expect(result['C'].top).to.be.greaterThan(result['B'].top);\n });\n\n it('orders sibling nodes using barycenter heuristic', () => {\n // A -> C, B -> D, A and B on layer 0\n // With A first, C should come before D\n const nodes = [\n makeNode('A', [{ destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', []),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 300, top: 0 } },\n C: { position: { left: 0, top: 200 } },\n D: { position: { left: 300, top: 200 } }\n };\n // A and B are both roots (no parents), so both in layer 0\n // But A is the start node\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // C should be left of D (follows parent order)\n expect(result['C'].left).to.be.lessThan(result['D'].left);\n });\n\n it('non-start nodes in first layer are offset down', () => {\n // A and B both in layer 0 (B unreachable from A but has no parents)\n const nodes = [makeNode('A', []), makeNode('B', [])];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 300, top: 0 } }\n };\n // B will end up on a later layer since it's unreachable from A\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // Start node A should be at top=0\n expect(result['A'].top).to.equal(0);\n });\n\n it('wraps siblings to new rows when exceeding max width', () => {\n // A -> B..H: 7 children at 200px each = 200*7 + 60*6 = 1760px\n // Should split into rows of 4 (980px) and 3 (720px)\n const childIds = ['B', 'C', 'D', 'E', 'F', 'G', 'H'];\n const nodes = [\n makeNode(\n 'A',\n childIds.map((id) => ({ destination_uuid: id }))\n ),\n ...childIds.map((id) => makeNode(id, []))\n ];\n const nodeUIs: Record<string, { position: { left: number; top: number } }> =\n { A: { position: { left: 0, top: 0 } } };\n childIds.forEach((id, i) => {\n nodeUIs[id] = { position: { left: i * 260, top: 200 } };\n });\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All children should be below A\n for (const id of childIds) {\n expect(result[id].top).to.be.greaterThan(result['A'].top);\n }\n\n // Children should span multiple rows (not all the same top)\n const tops = new Set(childIds.map((id) => result[id].top));\n expect(tops.size).to.be.greaterThan(1);\n\n // Each visual row should fit within 1200px\n const rowsByTop = new Map<number, string[]>();\n for (const id of childIds) {\n const t = result[id].top;\n const row = rowsByTop.get(t) || [];\n row.push(id);\n rowsByTop.set(t, row);\n }\n for (const [, row] of rowsByTop) {\n const minLeft = Math.min(...row.map((id) => result[id].left));\n const maxRight = Math.max(...row.map((id) => result[id].left + 200));\n expect(maxRight - minLeft).to.be.at.most(1200);\n }\n });\n\n it('handles wider flows with multiple branches', () => {\n // A -> B, A -> C, A -> D\n const nodes = [\n makeNode('A', [\n { destination_uuid: 'B' },\n { destination_uuid: 'C' },\n { destination_uuid: 'D' }\n ]),\n makeNode('B', []),\n makeNode('C', []),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 600, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All three children should be on the same layer\n expect(result['B'].top).to.equal(result['C'].top);\n expect(result['C'].top).to.equal(result['D'].top);\n\n // They should be spread horizontally with gaps\n const lefts = [result['B'].left, result['C'].left, result['D'].left].sort(\n (a, b) => a - b\n );\n expect(lefts[1]).to.be.greaterThan(lefts[0]);\n expect(lefts[2]).to.be.greaterThan(lefts[1]);\n });\n });\n\n describe('placeStickyNotes', () => {\n const makeSticky = (left: number, top: number): StickyNote => ({\n position: { left, top },\n title: '',\n body: '',\n color: 'yellow'\n });\n\n it('returns empty object when no stickies', () => {\n const result = placeStickyNotes(\n {},\n { A: { left: 0, top: 0 } },\n { A: { left: 0, top: 0 } },\n new Map([['A', { width: 200, height: 100 }]]),\n new Map(),\n 'A'\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('returns empty object when no nodes', () => {\n const result = placeStickyNotes(\n { s1: makeSticky(100, 100) },\n {},\n {},\n new Map(),\n new Map(),\n 'A'\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('places sticky to the right of its closest node', () => {\n const stickies = { s1: makeSticky(250, 0) }; // right of node at (0,0)\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed to the right of node A\n expect(result['s1'].left).to.be.greaterThanOrEqual(200);\n });\n\n it('places sticky to the left when it was originally left', () => {\n // Sticky was to the left of node B (not start node)\n const stickies = { s1: makeSticky(0, 0) }; // left of node at (300, 0)\n const oldPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const newPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const nodeSizes = new Map([\n ['A', { width: 200, height: 100 }],\n ['B', { width: 200, height: 100 }]\n ]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n });\n\n it('redirects left-of-start sticky to the right side', () => {\n // Sticky was to the left of the start node — should be placed to the right\n const stickies = { s1: makeSticky(-200, 0) }; // left of start node at (0,0)\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed to the right (not left) of the start node\n expect(result['s1'].left).to.be.greaterThanOrEqual(200);\n });\n\n it('snaps sticky positions to grid', () => {\n const stickies = { s1: makeSticky(250, 5) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1'].left % 20).to.equal(0);\n expect(result['s1'].top % 20).to.equal(0);\n });\n\n it('assigns sticky to closest node', () => {\n // s1 is at (310, 200), closer to B at (300, 200) than A at (0, 0)\n const stickies = { s1: makeSticky(310, 200) };\n const oldPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const newPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const nodeSizes = new Map([\n ['A', { width: 200, height: 100 }],\n ['B', { width: 200, height: 100 }]\n ]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed near node B, not node A\n expect(result['s1'].left).to.be.greaterThan(200);\n });\n\n it('nudges stickies to avoid collisions', () => {\n // Two stickies both closest to node A, both on the right side\n const stickies = {\n s1: makeSticky(250, 0),\n s2: makeSticky(260, 0)\n };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([\n ['s1', { width: 182, height: 100 }],\n ['s2', { width: 182, height: 100 }]\n ]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n // Both stickies should be placed\n expect(result['s1']).to.not.be.undefined;\n expect(result['s2']).to.not.be.undefined;\n\n // If they have the same left, they should be vertically separated\n if (result['s1'].left === result['s2'].left) {\n expect(result['s1'].top).to.not.equal(result['s2'].top);\n }\n });\n\n it('skips stickies without position', () => {\n const stickies = {\n s1: { title: '', body: '', color: 'yellow' as const } as StickyNote\n };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n // Sticky without position should be skipped\n expect(result['s1']).to.be.undefined;\n });\n\n it('ensures non-negative coordinates for stickies', () => {\n const stickies = { s1: makeSticky(250, 0) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1'].left).to.be.at.least(0);\n expect(result['s1'].top).to.be.at.least(0);\n });\n\n it('uses default sizes when not provided', () => {\n const stickies = { s1: makeSticky(250, 0) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map<string, { width: number; height: number }>();\n const stickySizes = new Map<string, { width: number; height: number }>();\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n expect(result['s1'].left).to.be.at.least(0);\n expect(result['s1'].top).to.be.at.least(0);\n });\n });\n});\n"]}
1
+ {"version":3,"file":"temba-flow-reflow.test.js","sourceRoot":"","sources":["../../test/temba-flow-reflow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;A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,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,YAAY,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA6C,CAAC;YACvE,MAAM,WAAW,GAAG,IAAI,GAAG,EAA6C,CAAC;YAEzE,MAAM,MAAM,GAAG,gBAAgB,CAC7B,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,GAAG,CACJ,CAAC;YAEF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { calculateLayeredLayout, placeStickyNotes } from '../src/flow/reflow';\nimport { Node, StickyNote } from '../src/store/flow-definition';\n\n// Helper to create a minimal Node with exits\nfunction makeNode(uuid: string, exits: { destination_uuid?: string }[]): Node {\n return {\n uuid,\n actions: [],\n exits: exits.map((e, i) => ({\n uuid: `${uuid}-exit-${i}`,\n destination_uuid: e.destination_uuid\n }))\n };\n}\n\n// Helper to return a fixed size for all nodes\nfunction constantSize(width: number, height: number) {\n return () => ({ width, height });\n}\n\ndescribe('Reflow Layout', () => {\n describe('calculateLayeredLayout', () => {\n it('returns empty object for empty nodes', () => {\n const result = calculateLayeredLayout(\n [],\n {},\n 'start',\n constantSize(200, 100)\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('places a single node at the origin', () => {\n const nodes = [makeNode('A', [])];\n const nodeUIs = { A: { position: { left: 500, top: 500 } } };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['A'].left).to.equal(0);\n expect(result['A'].top).to.equal(0);\n });\n\n it('places a linear chain vertically', () => {\n // A -> B -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All should be at left=0 (centered under parent which is at 0)\n // A at layer 0, B at layer 1, C at layer 2\n expect(result['A'].top).to.equal(0);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n expect(result['C'].top).to.be.greaterThan(result['B'].top);\n });\n\n it('places siblings at the same vertical level', () => {\n // A -> B, A -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', []),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // B and C should be on the same layer (same top)\n expect(result['B'].top).to.equal(result['C'].top);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n // B and C should be side by side\n expect(result['B'].left).to.not.equal(result['C'].left);\n });\n\n it('snaps all positions to grid (multiples of 20)', () => {\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n for (const uuid of Object.keys(result)) {\n expect(result[uuid].left % 20).to.equal(0);\n expect(result[uuid].top % 20).to.equal(0);\n }\n });\n\n it('handles cycles (back-edges) without infinite loops', () => {\n // A -> B -> A (cycle)\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'A' }])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n // A should be above B (layer 0 vs layer 1)\n expect(result['A'].top).to.be.lessThan(result['B'].top);\n });\n\n it('handles diamond-shaped flows (merge nodes)', () => {\n // A -> B, A -> C, B -> D, C -> D\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', [{ destination_uuid: 'D' }]),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 150, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // D should be below both B and C (longest path assignment)\n expect(result['D'].top).to.be.greaterThan(result['B'].top);\n expect(result['D'].top).to.be.greaterThan(result['C'].top);\n // B and C on same layer\n expect(result['B'].top).to.equal(result['C'].top);\n });\n\n it('handles deduplicated exits (same destination from multiple exits)', () => {\n // A has two exits both pointing to B\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'B' }]),\n makeNode('B', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n });\n\n it('handles exits with no destination', () => {\n const nodes = [\n makeNode('A', [\n { destination_uuid: undefined },\n { destination_uuid: 'B' }\n ]),\n makeNode('B', [{ destination_uuid: undefined }])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n });\n\n it('handles disconnected nodes', () => {\n // A -> B, C is disconnected (no edges at all)\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', []),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 300 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All nodes should receive positions\n expect(result['A']).to.not.be.undefined;\n expect(result['B']).to.not.be.undefined;\n expect(result['C']).to.not.be.undefined;\n // C (no edges, inDegree 0) lands in layer 0 alongside start node\n // but gets a 40px vertical offset since it's not the start node\n expect(result['C'].top).to.equal(40);\n });\n\n it('positions all nodes with non-negative coordinates', () => {\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', [{ destination_uuid: 'D' }]),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 150, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n for (const uuid of Object.keys(result)) {\n expect(result[uuid].left).to.be.at.least(0);\n expect(result[uuid].top).to.be.at.least(0);\n }\n });\n\n it('uses different node sizes for layout', () => {\n // A -> B -> C, B is tall\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 500 } }\n };\n const getSize = (uuid: string) => {\n if (uuid === 'B') return { width: 200, height: 300 };\n return { width: 200, height: 100 };\n };\n const result = calculateLayeredLayout(nodes, nodeUIs, 'A', getSize);\n\n // Gap between B and C should account for B's height of 300\n const bBottom = result['B'].top + 300;\n expect(result['C'].top).to.be.greaterThanOrEqual(bBottom);\n });\n\n it('handles a complex flow with self-loops', () => {\n // A -> B, B -> B (self-loop), B -> C\n const nodes = [\n makeNode('A', [{ destination_uuid: 'B' }]),\n makeNode('B', [{ destination_uuid: 'B' }, { destination_uuid: 'C' }]),\n makeNode('C', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 0, top: 400 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n expect(result['A'].top).to.equal(0);\n expect(result['B'].top).to.be.greaterThan(result['A'].top);\n expect(result['C'].top).to.be.greaterThan(result['B'].top);\n });\n\n it('orders sibling nodes using barycenter heuristic', () => {\n // A -> C, B -> D, A and B on layer 0\n // With A first, C should come before D\n const nodes = [\n makeNode('A', [{ destination_uuid: 'C' }]),\n makeNode('B', [{ destination_uuid: 'D' }]),\n makeNode('C', []),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 300, top: 0 } },\n C: { position: { left: 0, top: 200 } },\n D: { position: { left: 300, top: 200 } }\n };\n // A and B are both roots (no parents), so both in layer 0\n // But A is the start node\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // C should be left of D (follows parent order)\n expect(result['C'].left).to.be.lessThan(result['D'].left);\n });\n\n it('non-start nodes in first layer are offset down', () => {\n // A and B both in layer 0 (B unreachable from A but has no parents)\n const nodes = [makeNode('A', []), makeNode('B', [])];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 300, top: 0 } }\n };\n // B will end up on a later layer since it's unreachable from A\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // Start node A should be at top=0\n expect(result['A'].top).to.equal(0);\n });\n\n it('wraps siblings to new rows when exceeding max width', () => {\n // A -> B..H: 7 children at 200px each = 200*7 + 60*6 = 1760px\n // Should split into rows of 4 (980px) and 3 (720px)\n const childIds = ['B', 'C', 'D', 'E', 'F', 'G', 'H'];\n const nodes = [\n makeNode(\n 'A',\n childIds.map((id) => ({ destination_uuid: id }))\n ),\n ...childIds.map((id) => makeNode(id, []))\n ];\n const nodeUIs: Record<\n string,\n { position: { left: number; top: number } }\n > = { A: { position: { left: 0, top: 0 } } };\n childIds.forEach((id, i) => {\n nodeUIs[id] = { position: { left: i * 260, top: 200 } };\n });\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All children should be below A\n for (const id of childIds) {\n expect(result[id].top).to.be.greaterThan(result['A'].top);\n }\n\n // Children should span multiple rows (not all the same top)\n const tops = new Set(childIds.map((id) => result[id].top));\n expect(tops.size).to.be.greaterThan(1);\n\n // Each visual row should fit within 1200px\n const rowsByTop = new Map<number, string[]>();\n for (const id of childIds) {\n const t = result[id].top;\n const row = rowsByTop.get(t) || [];\n row.push(id);\n rowsByTop.set(t, row);\n }\n for (const [, row] of rowsByTop) {\n const minLeft = Math.min(...row.map((id) => result[id].left));\n const maxRight = Math.max(...row.map((id) => result[id].left + 200));\n expect(maxRight - minLeft).to.be.at.most(1200);\n }\n });\n\n it('handles wider flows with multiple branches', () => {\n // A -> B, A -> C, A -> D\n const nodes = [\n makeNode('A', [\n { destination_uuid: 'B' },\n { destination_uuid: 'C' },\n { destination_uuid: 'D' }\n ]),\n makeNode('B', []),\n makeNode('C', []),\n makeNode('D', [])\n ];\n const nodeUIs = {\n A: { position: { left: 0, top: 0 } },\n B: { position: { left: 0, top: 200 } },\n C: { position: { left: 300, top: 200 } },\n D: { position: { left: 600, top: 200 } }\n };\n const result = calculateLayeredLayout(\n nodes,\n nodeUIs,\n 'A',\n constantSize(200, 100)\n );\n\n // All three children should be on the same layer\n expect(result['B'].top).to.equal(result['C'].top);\n expect(result['C'].top).to.equal(result['D'].top);\n\n // They should be spread horizontally with gaps\n const lefts = [result['B'].left, result['C'].left, result['D'].left].sort(\n (a, b) => a - b\n );\n expect(lefts[1]).to.be.greaterThan(lefts[0]);\n expect(lefts[2]).to.be.greaterThan(lefts[1]);\n });\n });\n\n describe('placeStickyNotes', () => {\n const makeSticky = (left: number, top: number): StickyNote => ({\n position: { left, top },\n title: '',\n body: '',\n color: 'yellow'\n });\n\n it('returns empty object when no stickies', () => {\n const result = placeStickyNotes(\n {},\n { A: { left: 0, top: 0 } },\n { A: { left: 0, top: 0 } },\n new Map([['A', { width: 200, height: 100 }]]),\n new Map(),\n 'A'\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('returns empty object when no nodes', () => {\n const result = placeStickyNotes(\n { s1: makeSticky(100, 100) },\n {},\n {},\n new Map(),\n new Map(),\n 'A'\n );\n expect(Object.keys(result)).to.have.length(0);\n });\n\n it('places sticky to the right of its closest node', () => {\n const stickies = { s1: makeSticky(250, 0) }; // right of node at (0,0)\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed to the right of node A\n expect(result['s1'].left).to.be.greaterThanOrEqual(200);\n });\n\n it('places sticky to the left when it was originally left', () => {\n // Sticky was to the left of node B (not start node)\n const stickies = { s1: makeSticky(0, 0) }; // left of node at (300, 0)\n const oldPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const newPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const nodeSizes = new Map([\n ['A', { width: 200, height: 100 }],\n ['B', { width: 200, height: 100 }]\n ]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n });\n\n it('redirects left-of-start sticky to the right side', () => {\n // Sticky was to the left of the start node — should be placed to the right\n const stickies = { s1: makeSticky(-200, 0) }; // left of start node at (0,0)\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed to the right (not left) of the start node\n expect(result['s1'].left).to.be.greaterThanOrEqual(200);\n });\n\n it('snaps sticky positions to grid', () => {\n const stickies = { s1: makeSticky(250, 5) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1'].left % 20).to.equal(0);\n expect(result['s1'].top % 20).to.equal(0);\n });\n\n it('assigns sticky to closest node', () => {\n // s1 is at (310, 200), closer to B at (300, 200) than A at (0, 0)\n const stickies = { s1: makeSticky(310, 200) };\n const oldPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const newPositions = {\n A: { left: 0, top: 0 },\n B: { left: 300, top: 200 }\n };\n const nodeSizes = new Map([\n ['A', { width: 200, height: 100 }],\n ['B', { width: 200, height: 100 }]\n ]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n // Should be placed near node B, not node A\n expect(result['s1'].left).to.be.greaterThan(200);\n });\n\n it('nudges stickies to avoid collisions', () => {\n // Two stickies both closest to node A, both on the right side\n const stickies = {\n s1: makeSticky(250, 0),\n s2: makeSticky(260, 0)\n };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([\n ['s1', { width: 182, height: 100 }],\n ['s2', { width: 182, height: 100 }]\n ]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n // Both stickies should be placed\n expect(result['s1']).to.not.be.undefined;\n expect(result['s2']).to.not.be.undefined;\n\n // If they have the same left, they should be vertically separated\n if (result['s1'].left === result['s2'].left) {\n expect(result['s1'].top).to.not.equal(result['s2'].top);\n }\n });\n\n it('skips stickies without position', () => {\n const stickies = {\n s1: { title: '', body: '', color: 'yellow' as const } as StickyNote\n };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n // Sticky without position should be skipped\n expect(result['s1']).to.be.undefined;\n });\n\n it('ensures non-negative coordinates for stickies', () => {\n const stickies = { s1: makeSticky(250, 0) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map([['A', { width: 200, height: 100 }]]);\n const stickySizes = new Map([['s1', { width: 182, height: 100 }]]);\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1'].left).to.be.at.least(0);\n expect(result['s1'].top).to.be.at.least(0);\n });\n\n it('uses default sizes when not provided', () => {\n const stickies = { s1: makeSticky(250, 0) };\n const oldPositions = { A: { left: 0, top: 0 } };\n const newPositions = { A: { left: 0, top: 0 } };\n const nodeSizes = new Map<string, { width: number; height: number }>();\n const stickySizes = new Map<string, { width: number; height: number }>();\n\n const result = placeStickyNotes(\n stickies,\n oldPositions,\n newPositions,\n nodeSizes,\n stickySizes,\n 'A'\n );\n\n expect(result['s1']).to.not.be.undefined;\n expect(result['s1'].left).to.be.at.least(0);\n expect(result['s1'].top).to.be.at.least(0);\n });\n });\n});\n"]}
@@ -270,7 +270,7 @@ describe('temba-node-editor', () => {
270
270
  const shadowRoot = el.shadowRoot;
271
271
  expect(shadowRoot).to.not.be.null;
272
272
  });
273
- it('displays bubble count for group value counts', async () => {
273
+ it('displays bubble count for accordion value counts', async () => {
274
274
  const action = {
275
275
  uuid: 'test-action-uuid',
276
276
  type: 'send_msg',
@@ -285,18 +285,17 @@ describe('temba-node-editor', () => {
285
285
  // Wait for form data to be fully initialized and re-render to complete
286
286
  await new Promise((resolve) => setTimeout(resolve, 200));
287
287
  await el.updateComplete;
288
- // Check that bubble counts are displayed
288
+ // Check that bubble counts are displayed in accordion sections
289
289
  const shadowRoot = el.shadowRoot;
290
- const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');
291
- // Should have bubbles for groups with values
290
+ const bubbles = shadowRoot.querySelectorAll('.accordion-count-bubble');
291
+ // Should have bubbles for sections with values
292
292
  expect(bubbles.length).to.be.greaterThan(0);
293
293
  // Check specific bubble values (trim to handle whitespace in rendered text)
294
294
  const bubbleTexts = Array.from(bubbles).map((bubble) => { var _a; return (_a = bubble.textContent) === null || _a === void 0 ? void 0 : _a.trim(); });
295
- // Runtime attachments group should show bubble when collapsed and has values
295
+ // Runtime attachments section should show bubble when collapsed and has values
296
296
  expect(bubbleTexts).to.include('2'); // 2 runtime attachments
297
- // Note: Quick replies group auto-expands when it has content, so no bubble is shown
298
297
  });
299
- it('shows arrow when group has no values', async () => {
298
+ it('shows arrow when accordion section has no values', async () => {
300
299
  const action = {
301
300
  uuid: 'test-action-uuid',
302
301
  type: 'send_msg',
@@ -312,11 +311,11 @@ describe('temba-node-editor', () => {
312
311
  await el.updateComplete;
313
312
  // Check that arrows are displayed instead of bubbles
314
313
  const shadowRoot = el.shadowRoot;
315
- const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');
316
- const arrows = shadowRoot.querySelectorAll('.group-toggle-icon');
314
+ const bubbles = shadowRoot.querySelectorAll('.accordion-count-bubble');
315
+ const arrows = shadowRoot.querySelectorAll('.accordion-toggle-icon');
317
316
  // Should have no bubbles when counts are 0
318
317
  expect(bubbles.length).to.equal(0);
319
- // Should have arrows for collapsible groups
318
+ // Should have arrows for accordion sections
320
319
  expect(arrows.length).to.be.greaterThan(0);
321
320
  });
322
321
  it('renders split_by_llm_categorize node', async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"temba-node-editor.test.js","sourceRoot":"","sources":["../../test/temba-node-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OA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,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { assertScreenshot, getClip } from './utils.test';\n\n// Define interface for NodeEditor component\ninterface NodeEditorElement extends HTMLElement {\n action?: any;\n node?: any;\n nodeUI?: any;\n isOpen?: boolean;\n updateComplete: Promise<boolean>;\n}\n\nconst assertDialogScreenshot = async (\n el: NodeEditorElement,\n screenshotName: string\n) => {\n const dialog = el.shadowRoot\n .querySelector('temba-dialog')\n .shadowRoot.querySelector('.dialog-container') as HTMLElement;\n const clip = getClip(dialog);\n // Adjust width to show full dialog with proper padding\n const dialogRect = dialog.getBoundingClientRect();\n // Use scrollWidth to get the actual content width (including overflow)\n const contentWidth = Math.max(dialogRect.width, dialog.scrollWidth);\n clip.width = contentWidth + 20; // 10px padding on each side\n await assertScreenshot(screenshotName, clip);\n};\n\ndescribe('temba-node-editor', () => {\n it('can be created', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n expect(el).to.exist;\n expect(el.tagName).to.equal('TEMBA-NODE-EDITOR');\n });\n\n it('renders send_msg action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders send_msg action with message editor', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello @contact.name, check this out!',\n attachments: [\n 'image/jpeg:http://example.com/photo.jpg',\n 'image:@fields.profile_pic'\n ],\n quick_replies: ['Yes', 'No']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n\n // Check that the message editor component is rendered\n const messageEditor = el.shadowRoot.querySelector(\n 'temba-message-editor'\n ) as any;\n expect(messageEditor).to.not.be.null;\n expect(messageEditor.value).to.equal(action.text);\n });\n\n it('renders set_run_result action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_run_result',\n name: 'result_name',\n value: 'result_value'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders set_contact_field action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_contact_field',\n field: { key: 'age', name: 'Age' },\n value: '25'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders add_contact_groups action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'add_contact_groups',\n groups: [{ uuid: 'group-1', name: 'Test Group' }]\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders enter_flow action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-1', name: 'Sub Flow' }\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders node with router configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n router: {\n type: 'switch',\n result_name: 'result',\n categories: [{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' }]\n }\n };\n\n const nodeUI = {\n type: 'split_by_expression',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/router');\n });\n\n it('renders node with wait configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n wait: {\n type: 'msg'\n }\n };\n\n const nodeUI = {\n type: 'wait_for_response',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/wait');\n });\n\n it('handles different button actions', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n let saveEventFired = false;\n let cancelEventFired = false;\n\n el.addEventListener('temba-action-saved', () => {\n saveEventFired = true;\n });\n\n el.addEventListener('temba-node-edit-cancelled', () => {\n cancelEventFired = true;\n });\n\n // Get the dialog element inside the node editor\n const dialog = el.shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n\n // Test Save button by dispatching event on the dialog\n const saveEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Save' } },\n bubbles: true\n });\n dialog!.dispatchEvent(saveEvent);\n expect(saveEventFired).to.equal(true);\n\n // Reset for cancel test\n saveEventFired = false;\n\n // Test Cancel button\n const cancelEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Cancel' } },\n bubbles: true\n });\n dialog!.dispatchEvent(cancelEvent);\n expect(cancelEventFired).to.equal(true);\n });\n\n it('handles property updates', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n // Test action property update\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n el.action = action;\n await el.updateComplete;\n expect(el.action).to.equal(action);\n\n // Test node property update\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: []\n };\n\n el.node = node;\n await el.updateComplete;\n expect(el.node).to.equal(node);\n\n // Test nodeUI property update\n const nodeUI = {\n type: 'execute_actions',\n position: { left: 100, top: 100 }\n };\n\n el.nodeUI = nodeUI;\n await el.updateComplete;\n expect(el.nodeUI).to.equal(nodeUI);\n });\n\n it('handles form submission events', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Since the form submission handling is complex and involves internal components,\n // we'll just verify the component renders without errors and has the expected structure\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n\n // Verify dialog is present\n const dialog = shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n });\n\n it('handles form validation', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Test that the component renders form elements\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n });\n\n it('displays bubble count for group value counts', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: ['Yes', 'No', 'Maybe'],\n attachments: ['image:@contact.photo', 'document:@contact.resume']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data to be fully initialized and re-render to complete\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that bubble counts are displayed\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n\n // Should have bubbles for groups with values\n expect(bubbles.length).to.be.greaterThan(0);\n\n // Check specific bubble values (trim to handle whitespace in rendered text)\n const bubbleTexts = Array.from(bubbles).map((bubble) =>\n bubble.textContent?.trim()\n );\n\n // Runtime attachments group should show bubble when collapsed and has values\n expect(bubbleTexts).to.include('2'); // 2 runtime attachments\n // Note: Quick replies group auto-expands when it has content, so no bubble is shown\n });\n\n it('shows arrow when group has no values', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world'\n // No quick_replies or attachments provided\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that arrows are displayed instead of bubbles\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n const arrows = shadowRoot.querySelectorAll('.group-toggle-icon');\n\n // Should have no bubbles when counts are 0\n expect(bubbles.length).to.equal(0);\n\n // Should have arrows for collapsible groups\n expect(arrows.length).to.be.greaterThan(0);\n });\n\n it('renders split_by_llm_categorize node', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check if the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Check that the form is rendered\n const form = el.shadowRoot.querySelector('.node-editor-form');\n expect(form).to.not.be.null;\n\n // Check that all expected form components are rendered\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n const completionComponents =\n el.shadowRoot.querySelectorAll('temba-completion');\n\n // Should have LLM select field\n expect(selectComponents.length).to.equal(1);\n expect(selectComponents[0].getAttribute('label')).to.equal('LLM');\n\n // Should have input completion field\n expect(completionComponents.length).to.equal(1);\n expect(completionComponents[0].getAttribute('label')).to.equal('Input');\n\n // Should have categories array editor\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('renders wait_for_response node', async () => {\n const node = {\n uuid: 'test-wait-node-uuid',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n timeout: 300 // 5 minutes in seconds\n },\n result_name: 'response',\n categories: []\n },\n exits: []\n };\n\n const nodeUI = { type: 'wait_for_response' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Wait for Response');\n\n // Check that timeout and result name fields are rendered\n const textComponents = el.shadowRoot.querySelectorAll('temba-textinput');\n expect(textComponents.length).to.equal(1);\n\n // Verify the field labels\n const labels = Array.from(textComponents).map((comp) =>\n comp.getAttribute('label')\n );\n expect(labels).to.include('Result Name');\n });\n\n it('prioritizes node config over action config for non-execute_actions nodes', async () => {\n // Create a split_by_llm_categorize node that has both actions and should use node config\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Simulate having both node and action set (which happens when editing from flow)\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .action=${node.actions[0]}\n .isOpen=${true}\n >\n </temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Should show node editor (Split by AI Categorize), not action editor (Call LLM)\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Should have node config fields (LLM, Input, Categories, Result Name)\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n\n // Should have LLM select and categories array (node config fields)\n expect(selectComponents.length).to.equal(1);\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('initializes categories correctly for split_by_llm_categorize', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Access the component's formData directly to check initialization\n const formData = (el as any).formData;\n\n // Should have 2 categories (Greeting and Question, excluding Other and Failure)\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that the array editor component receives the correct value\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n // Wait a bit more for the array editor to fully render\n await new Promise((resolve) => setTimeout(resolve, 500));\n await el.updateComplete;\n\n // Check the values of the textinput components within the array items\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n\n if (textInputs && textInputs.length >= 2) {\n // The first two textinputs should have the category names\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('properly initializes categories when node is set after component creation', async () => {\n // First create the component without any data\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${false}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Then set the node data (simulating real usage)\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Set the properties (this should trigger updated() and openDialog())\n el.node = node;\n el.nodeUI = nodeUI;\n\n await el.updateComplete;\n\n // Wait for dialog to open and form data to initialize\n await new Promise((resolve) => setTimeout(resolve, 300));\n await el.updateComplete;\n\n // Check that the form data is properly initialized\n const formData = (el as any).formData;\n\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that array editor gets the correct values\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n if (textInputs && textInputs.length >= 2) {\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('preserves UUIDs for unchanged categories in split_by_llm_categorize', async () => {\n const originalNode: any = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'existing-call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n {\n uuid: 'existing-cat-1',\n name: 'Greeting',\n exit_uuid: 'existing-exit-1'\n },\n {\n uuid: 'existing-cat-2',\n name: 'Question',\n exit_uuid: 'existing-exit-2'\n },\n {\n uuid: 'existing-cat-other',\n name: 'Other',\n exit_uuid: 'existing-exit-other'\n },\n {\n uuid: 'existing-cat-failure',\n name: 'Failure',\n exit_uuid: 'existing-exit-failure'\n }\n ],\n cases: [\n {\n uuid: 'existing-case-1',\n type: 'has_only_text',\n arguments: ['Greeting'],\n category_uuid: 'existing-cat-1'\n },\n {\n uuid: 'existing-case-2',\n type: 'has_only_text',\n arguments: ['Question'],\n category_uuid: 'existing-cat-2'\n },\n {\n uuid: 'existing-case-error',\n type: 'has_only_text',\n arguments: ['<ERROR>'],\n category_uuid: 'existing-cat-failure'\n }\n ]\n },\n exits: [\n { uuid: 'existing-exit-1', destination_uuid: 'some-destination-1' },\n { uuid: 'existing-exit-2', destination_uuid: 'some-destination-2' },\n { uuid: 'existing-exit-other', destination_uuid: null },\n { uuid: 'existing-exit-failure', destination_uuid: null }\n ]\n };\n\n // Import the node config to test fromFormData directly\n const { split_by_llm_categorize } = await import(\n '../src/flow/nodes/split_by_llm_categorize'\n );\n\n // Test with same categories - should preserve UUIDs\n const formDataSame = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [{ name: 'Greeting' }, { name: 'Question' }],\n result_name: 'Intent'\n };\n\n const resultSame = split_by_llm_categorize.fromFormData(\n formDataSame,\n originalNode\n );\n\n // Should preserve existing UUIDs for unchanged categories\n expect(resultSame.actions[0].uuid).to.equal('existing-call-llm-uuid');\n\n const greetingCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const questionCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Question'\n );\n const otherCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Other'\n );\n const failureCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Failure'\n );\n\n expect(greetingCategory.uuid).to.equal('existing-cat-1');\n expect(greetingCategory.exit_uuid).to.equal('existing-exit-1');\n expect(questionCategory.uuid).to.equal('existing-cat-2');\n expect(questionCategory.exit_uuid).to.equal('existing-exit-2');\n expect(otherCategory.uuid).to.equal('existing-cat-other');\n expect(failureCategory.uuid).to.equal('existing-cat-failure');\n\n // Should preserve destination UUIDs for exits\n const greetingExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-1'\n );\n const questionExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-2'\n );\n expect(greetingExit.destination_uuid).to.equal('some-destination-1');\n expect(questionExit.destination_uuid).to.equal('some-destination-2');\n\n // Test with changed categories - should generate new UUIDs for new categories\n const formDataChanged = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [\n { name: 'Greeting' }, // unchanged - should keep UUID\n { name: 'NewCategory' } // new - should get new UUID\n ],\n result_name: 'Intent'\n };\n\n const resultChanged = split_by_llm_categorize.fromFormData(\n formDataChanged,\n originalNode\n );\n\n const greetingCategoryChanged = resultChanged.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const newCategory = resultChanged.router.categories.find(\n (cat) => cat.name === 'NewCategory'\n );\n\n // Greeting should keep its existing UUID\n expect(greetingCategoryChanged.uuid).to.equal('existing-cat-1');\n expect(greetingCategoryChanged.exit_uuid).to.equal('existing-exit-1');\n\n // NewCategory should get a new UUID (not one of the existing ones)\n expect(newCategory.uuid).to.not.equal('existing-cat-1');\n expect(newCategory.uuid).to.not.equal('existing-cat-2');\n expect(newCategory.uuid).to.not.equal('existing-cat-other');\n expect(newCategory.uuid).to.not.equal('existing-cat-failure');\n expect(newCategory.uuid).to.have.length.greaterThan(0);\n });\n});\n"]}
1
+ {"version":3,"file":"temba-node-editor.test.js","sourceRoot":"","sources":["../../test/temba-node-editor.test.ts"],"names":[],"mapp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,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { assertScreenshot, getClip } from './utils.test';\n\n// Define interface for NodeEditor component\ninterface NodeEditorElement extends HTMLElement {\n action?: any;\n node?: any;\n nodeUI?: any;\n isOpen?: boolean;\n updateComplete: Promise<boolean>;\n}\n\nconst assertDialogScreenshot = async (\n el: NodeEditorElement,\n screenshotName: string\n) => {\n const dialog = el.shadowRoot\n .querySelector('temba-dialog')\n .shadowRoot.querySelector('.dialog-container') as HTMLElement;\n const clip = getClip(dialog);\n // Adjust width to show full dialog with proper padding\n const dialogRect = dialog.getBoundingClientRect();\n // Use scrollWidth to get the actual content width (including overflow)\n const contentWidth = Math.max(dialogRect.width, dialog.scrollWidth);\n clip.width = contentWidth + 20; // 10px padding on each side\n await assertScreenshot(screenshotName, clip);\n};\n\ndescribe('temba-node-editor', () => {\n it('can be created', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n expect(el).to.exist;\n expect(el.tagName).to.equal('TEMBA-NODE-EDITOR');\n });\n\n it('renders send_msg action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders send_msg action with message editor', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello @contact.name, check this out!',\n attachments: [\n 'image/jpeg:http://example.com/photo.jpg',\n 'image:@fields.profile_pic'\n ],\n quick_replies: ['Yes', 'No']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n\n // Check that the message editor component is rendered\n const messageEditor = el.shadowRoot.querySelector(\n 'temba-message-editor'\n ) as any;\n expect(messageEditor).to.not.be.null;\n expect(messageEditor.value).to.equal(action.text);\n });\n\n it('renders set_run_result action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_run_result',\n name: 'result_name',\n value: 'result_value'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders set_contact_field action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_contact_field',\n field: { key: 'age', name: 'Age' },\n value: '25'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders add_contact_groups action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'add_contact_groups',\n groups: [{ uuid: 'group-1', name: 'Test Group' }]\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders enter_flow action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-1', name: 'Sub Flow' }\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders node with router configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n router: {\n type: 'switch',\n result_name: 'result',\n categories: [{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' }]\n }\n };\n\n const nodeUI = {\n type: 'split_by_expression',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/router');\n });\n\n it('renders node with wait configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n wait: {\n type: 'msg'\n }\n };\n\n const nodeUI = {\n type: 'wait_for_response',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/wait');\n });\n\n it('handles different button actions', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n let saveEventFired = false;\n let cancelEventFired = false;\n\n el.addEventListener('temba-action-saved', () => {\n saveEventFired = true;\n });\n\n el.addEventListener('temba-node-edit-cancelled', () => {\n cancelEventFired = true;\n });\n\n // Get the dialog element inside the node editor\n const dialog = el.shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n\n // Test Save button by dispatching event on the dialog\n const saveEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Save' } },\n bubbles: true\n });\n dialog!.dispatchEvent(saveEvent);\n expect(saveEventFired).to.equal(true);\n\n // Reset for cancel test\n saveEventFired = false;\n\n // Test Cancel button\n const cancelEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Cancel' } },\n bubbles: true\n });\n dialog!.dispatchEvent(cancelEvent);\n expect(cancelEventFired).to.equal(true);\n });\n\n it('handles property updates', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n // Test action property update\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n el.action = action;\n await el.updateComplete;\n expect(el.action).to.equal(action);\n\n // Test node property update\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: []\n };\n\n el.node = node;\n await el.updateComplete;\n expect(el.node).to.equal(node);\n\n // Test nodeUI property update\n const nodeUI = {\n type: 'execute_actions',\n position: { left: 100, top: 100 }\n };\n\n el.nodeUI = nodeUI;\n await el.updateComplete;\n expect(el.nodeUI).to.equal(nodeUI);\n });\n\n it('handles form submission events', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Since the form submission handling is complex and involves internal components,\n // we'll just verify the component renders without errors and has the expected structure\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n\n // Verify dialog is present\n const dialog = shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n });\n\n it('handles form validation', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Test that the component renders form elements\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n });\n\n it('displays bubble count for accordion value counts', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: ['Yes', 'No', 'Maybe'],\n attachments: ['image:@contact.photo', 'document:@contact.resume']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data to be fully initialized and re-render to complete\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that bubble counts are displayed in accordion sections\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.accordion-count-bubble');\n\n // Should have bubbles for sections with values\n expect(bubbles.length).to.be.greaterThan(0);\n\n // Check specific bubble values (trim to handle whitespace in rendered text)\n const bubbleTexts = Array.from(bubbles).map((bubble) =>\n bubble.textContent?.trim()\n );\n\n // Runtime attachments section should show bubble when collapsed and has values\n expect(bubbleTexts).to.include('2'); // 2 runtime attachments\n });\n\n it('shows arrow when accordion section has no values', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world'\n // No quick_replies or attachments provided\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that arrows are displayed instead of bubbles\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.accordion-count-bubble');\n const arrows = shadowRoot.querySelectorAll('.accordion-toggle-icon');\n\n // Should have no bubbles when counts are 0\n expect(bubbles.length).to.equal(0);\n\n // Should have arrows for accordion sections\n expect(arrows.length).to.be.greaterThan(0);\n });\n\n it('renders split_by_llm_categorize node', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check if the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Check that the form is rendered\n const form = el.shadowRoot.querySelector('.node-editor-form');\n expect(form).to.not.be.null;\n\n // Check that all expected form components are rendered\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n const completionComponents =\n el.shadowRoot.querySelectorAll('temba-completion');\n\n // Should have LLM select field\n expect(selectComponents.length).to.equal(1);\n expect(selectComponents[0].getAttribute('label')).to.equal('LLM');\n\n // Should have input completion field\n expect(completionComponents.length).to.equal(1);\n expect(completionComponents[0].getAttribute('label')).to.equal('Input');\n\n // Should have categories array editor\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('renders wait_for_response node', async () => {\n const node = {\n uuid: 'test-wait-node-uuid',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n timeout: 300 // 5 minutes in seconds\n },\n result_name: 'response',\n categories: []\n },\n exits: []\n };\n\n const nodeUI = { type: 'wait_for_response' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Wait for Response');\n\n // Check that timeout and result name fields are rendered\n const textComponents = el.shadowRoot.querySelectorAll('temba-textinput');\n expect(textComponents.length).to.equal(1);\n\n // Verify the field labels\n const labels = Array.from(textComponents).map((comp) =>\n comp.getAttribute('label')\n );\n expect(labels).to.include('Result Name');\n });\n\n it('prioritizes node config over action config for non-execute_actions nodes', async () => {\n // Create a split_by_llm_categorize node that has both actions and should use node config\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Simulate having both node and action set (which happens when editing from flow)\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .action=${node.actions[0]}\n .isOpen=${true}\n >\n </temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Should show node editor (Split by AI Categorize), not action editor (Call LLM)\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Should have node config fields (LLM, Input, Categories, Result Name)\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n\n // Should have LLM select and categories array (node config fields)\n expect(selectComponents.length).to.equal(1);\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('initializes categories correctly for split_by_llm_categorize', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Access the component's formData directly to check initialization\n const formData = (el as any).formData;\n\n // Should have 2 categories (Greeting and Question, excluding Other and Failure)\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that the array editor component receives the correct value\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n // Wait a bit more for the array editor to fully render\n await new Promise((resolve) => setTimeout(resolve, 500));\n await el.updateComplete;\n\n // Check the values of the textinput components within the array items\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n\n if (textInputs && textInputs.length >= 2) {\n // The first two textinputs should have the category names\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('properly initializes categories when node is set after component creation', async () => {\n // First create the component without any data\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${false}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Then set the node data (simulating real usage)\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Set the properties (this should trigger updated() and openDialog())\n el.node = node;\n el.nodeUI = nodeUI;\n\n await el.updateComplete;\n\n // Wait for dialog to open and form data to initialize\n await new Promise((resolve) => setTimeout(resolve, 300));\n await el.updateComplete;\n\n // Check that the form data is properly initialized\n const formData = (el as any).formData;\n\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that array editor gets the correct values\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n if (textInputs && textInputs.length >= 2) {\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('preserves UUIDs for unchanged categories in split_by_llm_categorize', async () => {\n const originalNode: any = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'existing-call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n {\n uuid: 'existing-cat-1',\n name: 'Greeting',\n exit_uuid: 'existing-exit-1'\n },\n {\n uuid: 'existing-cat-2',\n name: 'Question',\n exit_uuid: 'existing-exit-2'\n },\n {\n uuid: 'existing-cat-other',\n name: 'Other',\n exit_uuid: 'existing-exit-other'\n },\n {\n uuid: 'existing-cat-failure',\n name: 'Failure',\n exit_uuid: 'existing-exit-failure'\n }\n ],\n cases: [\n {\n uuid: 'existing-case-1',\n type: 'has_only_text',\n arguments: ['Greeting'],\n category_uuid: 'existing-cat-1'\n },\n {\n uuid: 'existing-case-2',\n type: 'has_only_text',\n arguments: ['Question'],\n category_uuid: 'existing-cat-2'\n },\n {\n uuid: 'existing-case-error',\n type: 'has_only_text',\n arguments: ['<ERROR>'],\n category_uuid: 'existing-cat-failure'\n }\n ]\n },\n exits: [\n { uuid: 'existing-exit-1', destination_uuid: 'some-destination-1' },\n { uuid: 'existing-exit-2', destination_uuid: 'some-destination-2' },\n { uuid: 'existing-exit-other', destination_uuid: null },\n { uuid: 'existing-exit-failure', destination_uuid: null }\n ]\n };\n\n // Import the node config to test fromFormData directly\n const { split_by_llm_categorize } = await import(\n '../src/flow/nodes/split_by_llm_categorize'\n );\n\n // Test with same categories - should preserve UUIDs\n const formDataSame = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [{ name: 'Greeting' }, { name: 'Question' }],\n result_name: 'Intent'\n };\n\n const resultSame = split_by_llm_categorize.fromFormData(\n formDataSame,\n originalNode\n );\n\n // Should preserve existing UUIDs for unchanged categories\n expect(resultSame.actions[0].uuid).to.equal('existing-call-llm-uuid');\n\n const greetingCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const questionCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Question'\n );\n const otherCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Other'\n );\n const failureCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Failure'\n );\n\n expect(greetingCategory.uuid).to.equal('existing-cat-1');\n expect(greetingCategory.exit_uuid).to.equal('existing-exit-1');\n expect(questionCategory.uuid).to.equal('existing-cat-2');\n expect(questionCategory.exit_uuid).to.equal('existing-exit-2');\n expect(otherCategory.uuid).to.equal('existing-cat-other');\n expect(failureCategory.uuid).to.equal('existing-cat-failure');\n\n // Should preserve destination UUIDs for exits\n const greetingExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-1'\n );\n const questionExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-2'\n );\n expect(greetingExit.destination_uuid).to.equal('some-destination-1');\n expect(questionExit.destination_uuid).to.equal('some-destination-2');\n\n // Test with changed categories - should generate new UUIDs for new categories\n const formDataChanged = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [\n { name: 'Greeting' }, // unchanged - should keep UUID\n { name: 'NewCategory' } // new - should get new UUID\n ],\n result_name: 'Intent'\n };\n\n const resultChanged = split_by_llm_categorize.fromFormData(\n formDataChanged,\n originalNode\n );\n\n const greetingCategoryChanged = resultChanged.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const newCategory = resultChanged.router.categories.find(\n (cat) => cat.name === 'NewCategory'\n );\n\n // Greeting should keep its existing UUID\n expect(greetingCategoryChanged.uuid).to.equal('existing-cat-1');\n expect(greetingCategoryChanged.exit_uuid).to.equal('existing-exit-1');\n\n // NewCategory should get a new UUID (not one of the existing ones)\n expect(newCategory.uuid).to.not.equal('existing-cat-1');\n expect(newCategory.uuid).to.not.equal('existing-cat-2');\n expect(newCategory.uuid).to.not.equal('existing-cat-other');\n expect(newCategory.uuid).to.not.equal('existing-cat-failure');\n expect(newCategory.uuid).to.have.length.greaterThan(0);\n });\n});\n"]}
@@ -139,7 +139,7 @@ describe('temba-node-type-selector', () => {
139
139
  expect(titles).to.not.include('Say Message');
140
140
  expect(titles).to.not.include('Play Recording');
141
141
  });
142
- it('filters splits by flow type - message flow should show wait for response', async () => {
142
+ it('filters splits by flow type - message flow should not show wait for response in split dialog', async () => {
143
143
  var _a;
144
144
  const selector = await createSelector();
145
145
  selector.flowType = 'message';
@@ -149,8 +149,8 @@ describe('temba-node-type-selector', () => {
149
149
  // get all node item titles
150
150
  const nodeItems = (_a = selector.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.node-item-title');
151
151
  const titles = Array.from(nodeItems || []).map((item) => { var _a; return (_a = item.textContent) === null || _a === void 0 ? void 0 : _a.trim(); });
152
- // message flow should have Wait for Response
153
- expect(titles).to.include('Wait for Response');
152
+ // Wait for Response is now promoted to the context menu, not in split dialog
153
+ expect(titles).to.not.include('Wait for Response');
154
154
  });
155
155
  it('filters splits by flow type - voice flow should not show wait for response', async () => {
156
156
  var _a;