@nyaruka/temba-components 0.137.0 → 0.138.0

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 (37) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/temba-components.js +392 -258
  3. package/dist/temba-components.js.map +1 -1
  4. package/out-tsc/src/display/FloatingTab.js +2 -2
  5. package/out-tsc/src/display/FloatingTab.js.map +1 -1
  6. package/out-tsc/src/flow/CanvasNode.js +45 -24
  7. package/out-tsc/src/flow/CanvasNode.js.map +1 -1
  8. package/out-tsc/src/flow/Editor.js +305 -16
  9. package/out-tsc/src/flow/Editor.js.map +1 -1
  10. package/out-tsc/src/flow/Plumber.js +110 -64
  11. package/out-tsc/src/flow/Plumber.js.map +1 -1
  12. package/out-tsc/src/simulator/Simulator.js +11 -4
  13. package/out-tsc/src/simulator/Simulator.js.map +1 -1
  14. package/out-tsc/src/store/AppState.js +12 -2
  15. package/out-tsc/src/store/AppState.js.map +1 -1
  16. package/out-tsc/test/temba-flow-editor-node.test.js +2 -1
  17. package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
  18. package/out-tsc/test/temba-flow-editor-revisions.test.js +106 -0
  19. package/out-tsc/test/temba-flow-editor-revisions.test.js.map +1 -0
  20. package/out-tsc/test/temba-flow-editor.test.js +14 -10
  21. package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
  22. package/out-tsc/test/temba-flow-plumber-connections.test.js +7 -1
  23. package/out-tsc/test/temba-flow-plumber-connections.test.js.map +1 -1
  24. package/out-tsc/test/temba-flow-plumber.test.js +6 -0
  25. package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/display/FloatingTab.ts +2 -2
  28. package/src/flow/CanvasNode.ts +54 -29
  29. package/src/flow/Editor.ts +357 -17
  30. package/src/flow/Plumber.ts +123 -69
  31. package/src/simulator/Simulator.ts +11 -5
  32. package/src/store/AppState.ts +13 -2
  33. package/test/temba-flow-editor-node.test.ts +2 -1
  34. package/test/temba-flow-editor-revisions.test.ts +134 -0
  35. package/test/temba-flow-editor.test.ts +16 -10
  36. package/test/temba-flow-plumber-connections.test.ts +7 -1
  37. package/test/temba-flow-plumber.test.ts +6 -0
@@ -1 +1 @@
1
- {"version":3,"file":"temba-flow-editor-node.test.js","sourceRoot":"","sources":["../../test/temba-flow-editor-node.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,UAAsB,CAAC;IAC3B,IAAI,WAAgB,CAAC;IAErB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,eAAe;QACf,WAAW,GAAG;YACZ,UAAU,EAAE,IAAI,EAAE;YAClB,UAAU,EAAE,IAAI,EAAE;YAClB,UAAU,EAAE,IAAI,EAAE;SACnB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;YACpC,MAAM,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,C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AC;YACjC,MAAM,UAAU,CAAC,cAAc,CAAC;YAEhC,wBAAwB;YACxB,MAAM,WAAW,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACtD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YAE7B,oDAAoD;YACpD,MAAM,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { CanvasNode } from '../src/flow/CanvasNode';\nimport {\n Node,\n NodeUI,\n Action,\n Exit,\n Router\n} from '../src/store/flow-definition.d';\nimport { stub, restore, useFakeTimers } from 'sinon';\nimport { CustomEventType } from '../src/interfaces';\nimport { ACTION_GROUPS } from '../src/flow/types';\n\ndescribe('EditorNode', () => {\n let editorNode: CanvasNode;\n let mockPlumber: any;\n\n beforeEach(async () => {\n // Mock plumber\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub()\n };\n });\n\n afterEach(() => {\n restore();\n });\n\n describe('basic functionality', () => {\n it('creates render root as element itself', () => {\n const editorNode = new CanvasNode();\n expect(editorNode.createRenderRoot()).to.equal(editorNode);\n });\n });\n\n describe('renderAction', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders action with known config', () => {\n const mockNode: Node = {\n uuid: 'test-node-3',\n actions: [],\n exits: []\n };\n\n const action: any = {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Test message',\n quick_replies: []\n };\n\n const result = (editorNode as any).renderAction(mockNode, action, 0);\n expect(result).to.exist;\n });\n\n it('renders action with unknown config', () => {\n const mockNode: Node = {\n uuid: 'test-node-4',\n actions: [],\n exits: []\n };\n\n const action: Action = {\n type: 'unknown_action' as any,\n uuid: 'action-1'\n };\n\n const result = (editorNode as any).renderAction(mockNode, action, 1);\n expect(result).to.exist;\n });\n });\n\n describe('renderRouter', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders router with result name', () => {\n const mockRouter: Router = {\n type: 'switch',\n result_name: 'test_result',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'wait_for_response'\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.exist;\n });\n\n it('renders router without result name', () => {\n const mockRouter: Router = {\n type: 'switch',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'wait_for_response'\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.exist;\n });\n\n it('returns undefined for router with unknown UI type', () => {\n const mockRouter: Router = {\n type: 'switch',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'unknown_type' as any\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.be.undefined;\n });\n });\n\n describe('renderCategories', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('returns null when no router', () => {\n const mockNode: Node = {\n uuid: 'test-node-7',\n actions: [],\n exits: []\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.be.null;\n });\n\n it('returns null when no categories', () => {\n const mockNode: Node = {\n uuid: 'test-node-8',\n actions: [],\n exits: [],\n router: {\n type: 'switch',\n categories: undefined as any\n }\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.be.null;\n });\n\n it('renders categories with exits', () => {\n const mockNode: Node = {\n uuid: 'test-node-9',\n actions: [],\n exits: [{ uuid: 'exit-1' }, { uuid: 'exit-2' }],\n router: {\n type: 'switch',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.exist;\n });\n });\n\n describe('renderExit', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders exit with connected class when destination exists', async () => {\n const exit: Exit = {\n uuid: 'exit-connected',\n destination_uuid: 'destination-node'\n };\n\n const result = (editorNode as any).renderExit(exit);\n const container = await fixture(html`<div>${result}</div>`);\n\n const exitElement = container.querySelector('.exit');\n expect(exitElement).to.exist;\n expect(exitElement?.classList.contains('connected')).to.be.true;\n expect(exitElement?.getAttribute('id')).to.equal('exit-connected');\n });\n\n it('renders exit without connected class when no destination', async () => {\n const exit: Exit = {\n uuid: 'exit-unconnected'\n };\n\n const result = (editorNode as any).renderExit(exit);\n const container = await fixture(html`<div>${result}</div>`);\n\n const exitElement = container.querySelector('.exit');\n expect(exitElement).to.exist;\n expect(exitElement?.classList.contains('connected')).to.be.false;\n expect(exitElement?.getAttribute('id')).to.equal('exit-unconnected');\n });\n });\n\n describe('renderTitle', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders title with config color and name', async () => {\n const config = {\n name: 'Test Action',\n group: ACTION_GROUPS.send // Uses 'send' group which has color '#3498db'\n };\n\n const mockAction: Action = {\n type: 'send_msg',\n uuid: 'test-action'\n };\n\n const result = (editorNode as any).renderTitle(config, mockAction, 0);\n const container = await fixture(html`<div>${result}</div>`);\n\n const title = container.querySelector('.cn-title');\n expect(title).to.exist;\n\n const nameElement = title?.querySelector('.name');\n expect(nameElement?.textContent?.trim()).to.equal('Test Action');\n // The 'send' group has color '#3498db' from ACTION_GROUP_METADATA\n expect(title?.getAttribute('style')).to.contain('background:#3498db');\n });\n });\n\n describe('updated lifecycle', () => {\n it('handles updated without node changes', () => {\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n\n const changes = new Map();\n changes.set('other', true);\n\n // Should not throw and not call plumber methods\n expect(() => {\n (editorNode as any).updated(changes);\n }).to.not.throw();\n\n expect(mockPlumber.makeTarget).to.not.have.been.called;\n });\n\n it('verifies updated method exists', () => {\n editorNode = new CanvasNode();\n expect(typeof (editorNode as any).updated).to.equal('function');\n });\n\n it('processes node changes and calls plumber methods', () => {\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n\n const mockNode: Node = {\n uuid: 'test-node-10',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-2' },\n { uuid: 'exit-2' } // This should call makeSource\n ]\n };\n\n // Mock querySelector to return a mock element with getBoundingClientRect\n const mockElement = {\n getBoundingClientRect: stub().returns({ width: 200, height: 100 })\n };\n stub(editorNode, 'querySelector').returns(mockElement as any);\n\n // Simulate the updated lifecycle\n (editorNode as any).node = mockNode;\n\n const changes = new Map();\n changes.set('node', true);\n\n // Test just the plumber method calls without store dependency\n // by directly calling the logic that would be in updated\n if ((editorNode as any).plumber && mockNode) {\n (editorNode as any).plumber.makeTarget(mockNode.uuid);\n\n for (const exit of mockNode.exits) {\n if (!exit.destination_uuid) {\n (editorNode as any).plumber.makeSource(exit.uuid);\n } else {\n (editorNode as any).plumber.connectIds(\n exit.uuid,\n exit.destination_uuid\n );\n }\n }\n }\n\n expect(mockPlumber.makeTarget).to.have.been.calledWith('test-node-10');\n expect(mockPlumber.makeSource).to.have.been.calledWith('exit-2');\n expect(mockPlumber.connectIds).to.have.been.calledWith(\n 'exit-1',\n 'node-2'\n );\n });\n });\n\n describe('basic integration', () => {\n it('can create and verify structure without full rendering', () => {\n const mockNode: Node = {\n uuid: 'integration-test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: 'next-node' }]\n };\n\n // Test individual render methods work\n editorNode = new CanvasNode();\n\n // Test renderAction\n const actionResult = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n expect(actionResult).to.exist;\n\n // Test renderExit\n const exitResult = (editorNode as any).renderExit(mockNode.exits[0]);\n expect(exitResult).to.exist;\n\n // Verify the node structure is as expected\n expect(mockNode.uuid).to.equal('integration-test-node');\n expect(mockNode.actions).to.have.length(1);\n expect(mockNode.exits).to.have.length(1);\n });\n });\n\n describe('drag and drop functionality', () => {\n let editorNode: CanvasNode;\n\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders actions with sortable class and proper IDs', async () => {\n const mockNode: Node = {\n uuid: 'sortable-test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n // Test that renderAction includes sortable class and proper ID\n const result1 = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n const result2 = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[1],\n 1\n );\n\n expect(result1).to.exist;\n expect(result2).to.exist;\n\n // Render the template to check the actual DOM\n const container1 = await fixture(html`<div>${result1}</div>`);\n const container2 = await fixture(html`<div>${result2}</div>`);\n\n const actionElement1 = container1.querySelector('.action');\n const actionElement2 = container2.querySelector('.action');\n\n expect(actionElement1).to.exist;\n expect(actionElement1?.classList.contains('sortable')).to.be.true;\n expect(actionElement1?.id).to.equal('action-0');\n\n expect(actionElement2).to.exist;\n expect(actionElement2?.classList.contains('sortable')).to.be.true;\n expect(actionElement2?.id).to.equal('action-1');\n });\n\n it('includes drag handle in rendered actions', async () => {\n const mockNode: Node = {\n uuid: 'drag-handle-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n let editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${{ position: { left: 0, top: 0 } }}\n ></temba-flow-node>`\n );\n\n // No drag handle should be present if only one action\n let dragHandle = editorNode.querySelector('.drag-handle');\n expect(dragHandle).to.not.exist;\n\n // Now add a second action to verify drag handle appears\n mockNode.actions.push({\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any);\n\n editorNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${{ position: { left: 0, top: 0 } }}\n ></temba-flow-node>`\n );\n\n dragHandle = editorNode.querySelector('.drag-handle');\n expect(dragHandle).to.exist;\n });\n\n it('renders SortableList when actions are present', async () => {\n const mockNode: Node = {\n uuid: 'sortable-list-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n const renderResult = editorNode.render();\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${renderResult}</div>`);\n\n const sortableList = container.querySelector('temba-sortable-list');\n expect(sortableList).to.exist;\n });\n\n it('does not render SortableList when no actions', async () => {\n const mockNode: Node = {\n uuid: 'no-actions-test',\n actions: [],\n exits: [{ uuid: 'exit-1' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n const renderResult = editorNode.render();\n\n // Check that template does not include temba-sortable-list\n expect(renderResult.strings.join('')).to.not.contain(\n 'temba-sortable-list'\n );\n });\n\n it('handles order changed events correctly', async () => {\n const mockNode: Node = {\n uuid: 'order-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'First',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Second',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-3',\n text: 'Third',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n (editorNode as any).node = mockNode;\n\n // Create a mock order changed event (swap first and last actions)\n const orderChangedEvent = new CustomEvent(CustomEventType.OrderChanged, {\n detail: { swap: [0, 2] }\n });\n\n // Call the handler directly\n (editorNode as any).handleActionOrderChanged(orderChangedEvent);\n\n // Verify the actions were reordered correctly\n expect((editorNode as any).node.actions).to.have.length(3);\n expect(((editorNode as any).node.actions[0] as any).text).to.equal(\n 'Second'\n );\n expect(((editorNode as any).node.actions[1] as any).text).to.equal(\n 'Third'\n );\n expect(((editorNode as any).node.actions[2] as any).text).to.equal(\n 'First'\n );\n });\n\n it('preserves action data during reordering', () => {\n const mockNode: Node = {\n uuid: 'preserve-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Message 1',\n quick_replies: ['Yes', 'No']\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Message 2',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n (editorNode as any).node = mockNode;\n\n // Swap the two actions\n const orderChangedEvent = new CustomEvent(CustomEventType.OrderChanged, {\n detail: { swap: [0, 1] }\n });\n\n (editorNode as any).handleActionOrderChanged(orderChangedEvent);\n\n // Verify all action data is preserved\n expect((editorNode as any).node.actions).to.have.length(2);\n expect(((editorNode as any).node.actions[0] as any).text).to.equal(\n 'Message 2'\n );\n expect(\n ((editorNode as any).node.actions[0] as any).quick_replies\n ).to.deep.equal([]);\n expect(((editorNode as any).node.actions[1] as any).text).to.equal(\n 'Message 1'\n );\n expect(\n ((editorNode as any).node.actions[1] as any).quick_replies\n ).to.deep.equal(['Yes', 'No']);\n });\n\n it('integrates with SortableList for full drag functionality', async () => {\n const mockNode: Node = {\n uuid: 'integration-drag-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'First Action',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Second Action',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-3',\n text: 'Third Action',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Render the full component\n const renderResult = editorNode.render();\n const container = await fixture(html`<div>${renderResult}</div>`);\n\n // Find the sortable list\n const sortableList = container.querySelector('temba-sortable-list');\n expect(sortableList).to.exist;\n\n // Verify all actions are rendered as sortable items\n const sortableItems = container.querySelectorAll('.sortable');\n expect(sortableItems).to.have.length(3);\n\n // Verify each action has correct ID and structure\n expect(sortableItems[0].id).to.equal('action-0');\n expect(sortableItems[1].id).to.equal('action-1');\n expect(sortableItems[2].id).to.equal('action-2');\n\n // Verify drag handles are present\n const dragHandles = container.querySelectorAll('.drag-handle');\n expect(dragHandles).to.have.length(3);\n });\n });\n\n describe('exit disconnection', () => {\n let mockStore: any;\n let mockUpdateNode: any;\n\n beforeEach(() => {\n mockUpdateNode = stub();\n mockStore = {\n getState: stub().returns({\n updateNode: mockUpdateNode\n })\n };\n\n // Mock the plumber with disconnect capabilities\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub(),\n removeExitConnection: stub().returns(true),\n setConnectionRemovingState: stub().returns(true)\n };\n\n (window as any).getStore = () => mockStore;\n\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n });\n\n afterEach(() => {\n // Restore any stubbed functions\n if ((window as any).originalGetStore) {\n (window as any).getStore = (window as any).originalGetStore;\n }\n });\n\n it('handles exit click to initiate disconnection', async () => {\n // Create a node with a connected exit\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: 'target-node' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Mock querySelector to return the exit element\n const exitElement = document.createElement('div');\n exitElement.id = 'exit-1';\n exitElement.classList.add('exit', 'connected');\n (editorNode as any).querySelector = stub().returns(exitElement);\n\n // Create a mock event\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub(),\n currentTarget: exitElement\n } as any;\n\n // Mock getStore directly in the disconnectExit method\n const originalDisconnectExit = (editorNode as any).disconnectExit;\n (editorNode as any).disconnectExit = function (exit: any) {\n // Call original but override the store logic\n this.plumber.removeExitConnection(exit.uuid);\n mockUpdateNode.call(null, this.node.uuid, {\n ...this.node,\n exits: this.node.exits.map((e: any) =>\n e.uuid === exit.uuid ? { ...e, destination_uuid: null } : e\n )\n });\n };\n\n // Call the click handler directly to initiate removal\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the exit is marked for removal in the component state\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.true;\n\n // Verify a timeout was set\n expect((editorNode as any).exitRemovalTimeouts.has('exit-1')).to.be.true;\n\n // Now click again to confirm disconnection\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the plumber was called to remove the connection\n expect(mockPlumber.removeExitConnection).to.have.been.calledWith(\n 'exit-1'\n );\n\n // Verify the node was updated with disconnected exit\n expect(mockUpdateNode).to.have.been.called;\n\n // Restore original method\n (editorNode as any).disconnectExit = originalDisconnectExit;\n });\n\n it('cancels disconnection after timeout', async () => {\n // Create a fake timer for this test\n const clock = useFakeTimers();\n\n try {\n // Create a node with a connected exit\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: 'target-node' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Mock querySelector to return the exit element\n const exitElement = document.createElement('div');\n exitElement.id = 'exit-1';\n exitElement.classList.add('exit', 'connected');\n (editorNode as any).querySelector = stub().returns(exitElement);\n\n // Create a mock event\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub(),\n currentTarget: exitElement\n } as any;\n\n // Call the click handler to initiate disconnection\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the exit is marked for removal\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.true;\n\n // Advance the clock past the timeout (1500ms is the default timeout)\n clock.tick(1501);\n\n // Verify the removing state is cleared after the timeout\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.false;\n expect(mockPlumber.setConnectionRemovingState).to.have.been.calledWith(\n 'exit-1',\n false\n );\n } finally {\n // Always restore the clock\n clock.restore();\n }\n });\n });\n\n describe('action removal', () => {\n let editorNode: CanvasNode;\n let mockPlumber: any;\n let getStoreStub: any;\n\n beforeEach(() => {\n editorNode = new CanvasNode();\n\n // Mock plumber\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub(),\n removeExitConnection: stub()\n };\n editorNode['plumber'] = mockPlumber;\n });\n\n afterEach(() => {\n if (getStoreStub) {\n getStoreStub.restore();\n }\n });\n\n it('handles action removal state management', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Initially, no action should be in removing state\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .false;\n\n // Call the click handler to initiate removal\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n // Verify the action is marked for removal\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n\n // Verify event handlers were called\n expect(mockEvent.preventDefault).to.have.been.called;\n expect(mockEvent.stopPropagation).to.have.been.called;\n });\n\n it('cancels action removal after timeout', async () => {\n const clock = useFakeTimers();\n\n try {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Call the click handler to initiate removal\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n // Verify the action is marked for removal\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n\n // Advance the clock past the timeout (1000ms is the action removal timeout)\n clock.tick(1001);\n\n // Verify the removing state is cleared after the timeout\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .false;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .false;\n } finally {\n // Always restore the clock\n clock.restore();\n }\n });\n\n it('clears timeouts on disconnect', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Start a removal process\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n\n // Disconnect the component\n editorNode.disconnectedCallback();\n\n // Verify all state is cleared\n expect((editorNode as any).actionRemovingState.size).to.equal(0);\n expect((editorNode as any).actionRemovalTimeouts.size).to.equal(0);\n });\n\n it('renders action with remove button', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n // Test that renderAction includes remove button\n const result = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n\n expect(result).to.exist;\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${result}</div>`);\n const removeButton = container.querySelector('.remove-button');\n\n expect(removeButton).to.exist;\n expect(removeButton?.textContent?.trim()).to.equal('✕');\n expect(removeButton?.getAttribute('title')).to.equal('Remove action');\n });\n\n it('shows removing state in UI', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n // Set action to removing state\n (editorNode as any).actionRemovingState.add('action-1');\n\n // Test that renderAction shows removing state\n const result = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n\n expect(result).to.exist;\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${result}</div>`);\n const actionElement = container.querySelector('.action');\n\n expect(actionElement).to.exist;\n expect(actionElement?.classList.contains('removing')).to.be.true;\n\n // Check that title shows \"Remove?\"\n const titleElement = container.querySelector('.cn-title .name');\n expect(titleElement?.textContent?.trim()).to.equal('Remove?');\n });\n\n it('handles multiple action removal states independently', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Start removal for first action\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovingState.has('action-2')).to.be\n .false;\n\n // Start removal for second action\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[1],\n 1\n );\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovingState.has('action-2')).to.be\n .true;\n\n // Both actions should have timeouts\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-2')).to.be\n .true;\n });\n\n it('properly reroutes JSPlumb connections when removing node with connections', async () => {\n // This test verifies that the connection rerouting logic works correctly\n // by testing the specific logic within removeNodeWithConnections\n\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-after', destination_uuid: 'node-after' }]\n };\n\n editorNode['node'] = mockNode;\n\n // Mock the flow definition that would be returned by getStore\n const mockFlowDefinition = {\n nodes: [\n {\n uuid: 'node-before',\n exits: [\n { uuid: 'exit-before-1', destination_uuid: 'test-node' },\n { uuid: 'exit-before-2', destination_uuid: 'test-node' }\n ]\n },\n mockNode,\n {\n uuid: 'node-after',\n exits: []\n }\n ]\n };\n\n // Test the connection rerouting logic directly by simulating what happens\n // when a node with incoming and outgoing connections is removed\n const nodeUuid = mockNode.uuid;\n const incomingConnections: {\n exitUuid: string;\n sourceNodeUuid: string;\n }[] = [];\n const outgoingExits = mockNode.exits.filter(\n (exit) => exit.destination_uuid\n );\n\n // Find incoming connections (same logic as in removeNodeWithConnections)\n for (const node of mockFlowDefinition.nodes) {\n if (node.uuid !== nodeUuid) {\n for (const exit of node.exits) {\n if (exit.destination_uuid === nodeUuid) {\n incomingConnections.push({\n exitUuid: exit.uuid,\n sourceNodeUuid: node.uuid\n });\n }\n }\n }\n }\n\n // Verify we found the expected incoming connections\n expect(incomingConnections).to.have.length(2);\n expect(incomingConnections[0].exitUuid).to.equal('exit-before-1');\n expect(incomingConnections[1].exitUuid).to.equal('exit-before-2');\n\n // Verify we found the expected outgoing connections\n expect(outgoingExits).to.have.length(1);\n expect(outgoingExits[0].destination_uuid).to.equal('node-after');\n\n // Simulate the rerouting logic\n if (incomingConnections.length > 0 && outgoingExits.length > 0) {\n const firstDestination = outgoingExits[0].destination_uuid;\n\n // Verify the destination is correct for rerouting\n expect(firstDestination).to.equal('node-after');\n }\n\n // This test verifies the rerouting logic is correct. The actual fix ensures that:\n // 1. Old JSPlumb connections are removed with removeExitConnection\n // 2. Store is updated with updateConnection\n // 3. New JSPlumb connections are created with connectIds\n // This sequence ensures JSPlumb visuals stay in sync with the flow definition\n });\n\n it('reroutes connections when removing node with multiple exits pointing to same destination', async () => {\n // Test case: node with multiple exits, but all point to the same destination\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after' },\n { uuid: 'exit-2', destination_uuid: 'node-after' },\n { uuid: 'exit-3', destination_uuid: 'node-after' }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state - node-before points to test-node\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes to trigger the rerouting logic\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that node-before's exit was rerouted to node-after\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.equal(\n 'node-after'\n );\n });\n\n it('does not reroute connections when node has exits with different destinations', async () => {\n // Test case: node with multiple exits pointing to different destinations\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after-1' },\n { uuid: 'exit-2', destination_uuid: 'node-after-2' }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after-1',\n actions: [],\n exits: []\n },\n {\n uuid: 'node-after-2',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that incoming connection was cleared (set to null), not rerouted\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.be.null;\n });\n\n it('does not reroute connections when node has exits with null destinations', async () => {\n // Test case: node with some exits having null destinations\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after' },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that incoming connection was cleared (set to null), not rerouted\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.be.null;\n });\n });\n\n describe('add action button', () => {\n beforeEach(async () => {\n editorNode = new CanvasNode();\n editorNode['plumber'] = mockPlumber;\n });\n\n it('handleAddActionClick fires AddActionRequested event', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n let eventFired = false;\n let eventDetail: any = null;\n\n editorNode.addEventListener(CustomEventType.AddActionRequested, (e) => {\n eventFired = true;\n eventDetail = (e as CustomEvent).detail;\n });\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Call the add action click handler\n (editorNode as any).handleAddActionClick(mockEvent);\n\n // Verify the event was fired with correct detail\n expect(eventFired).to.be.true;\n expect(eventDetail).to.exist;\n expect(eventDetail.nodeUuid).to.equal('test-node');\n\n // Verify event handlers were called\n expect(mockEvent.preventDefault).to.have.been.called;\n expect(mockEvent.stopPropagation).to.have.been.called;\n });\n\n it('renders add action button for execute_actions nodes', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'execute_actions'\n };\n\n editorNode['node'] = mockNode;\n editorNode['ui'] = mockUI;\n\n const rendered = editorNode.render();\n expect(rendered).to.exist;\n });\n\n it('renders correctly for non-execute_actions nodes', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: null }],\n router: {\n type: 'switch',\n categories: []\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'wait_for_response'\n };\n\n editorNode['node'] = mockNode;\n editorNode['ui'] = mockUI;\n\n const rendered = editorNode.render();\n expect(rendered).to.exist;\n });\n });\n\n describe('router section graying', () => {\n it('grays out split nodes when categories not included in translation', async () => {\n const mockNode: Node = {\n uuid: 'split-node-1',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = true;\n (editorNode as any).includeCategoriesInTranslation = false;\n (editorNode as any).languageCode = 'spa';\n\n // Force re-render\n editorNode.requestUpdate('isTranslating');\n editorNode.requestUpdate('includeCategoriesInTranslation');\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it has the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.true;\n });\n\n it('does not gray out split nodes when categories are included in translation', async () => {\n const mockNode: Node = {\n uuid: 'split-node-2',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = true;\n (editorNode as any).includeCategoriesInTranslation = true;\n (editorNode as any).languageCode = 'spa';\n\n await editorNode.requestUpdate();\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it does NOT have the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.false;\n });\n\n it('does not gray out split nodes when not translating', async () => {\n const mockNode: Node = {\n uuid: 'split-node-3',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = false;\n (editorNode as any).languageCode = 'eng';\n\n await editorNode.requestUpdate();\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it does NOT have the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.false;\n });\n });\n});\n"]}
1
+ {"version":3,"file":"temba-flow-editor-node.test.js","sourceRoot":"","sources":["../../test/temba-flow-editor-node.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,UAAsB,CAAC;IAC3B,IAAI,WAAgB,CAAC;IAErB,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,eAAe;QACf,WAAW,GA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AE,QAAQ,EAAE;wBAC1D,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE;qBAC3D;iBACF;aACF,CAAC;YAEF,MAAM,MAAM,GAAW;gBACrB,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;gBAC7B,IAAI,EAAE,iBAAiB;aACxB,CAAC;YAEF,cAAc;YACd,MAAM,UAAU,GAAe,MAAM,OAAO,CAC1C,IAAI,CAAA;kBACM,QAAQ;gBACV,MAAM;4BACM,CACrB,CAAC;YAEF,oCAAoC;YACnC,UAAkB,CAAC,aAAa,GAAG,KAAK,CAAC;YACzC,UAAkB,CAAC,YAAY,GAAG,KAAK,CAAC;YAEzC,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC;YACjC,MAAM,UAAU,CAAC,cAAc,CAAC;YAEhC,wBAAwB;YACxB,MAAM,WAAW,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACtD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YAE7B,oDAAoD;YACpD,MAAM,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { CanvasNode } from '../src/flow/CanvasNode';\nimport {\n Node,\n NodeUI,\n Action,\n Exit,\n Router\n} from '../src/store/flow-definition.d';\nimport { stub, restore, useFakeTimers } from 'sinon';\nimport { CustomEventType } from '../src/interfaces';\nimport { ACTION_GROUPS } from '../src/flow/types';\n\ndescribe('EditorNode', () => {\n let editorNode: CanvasNode;\n let mockPlumber: any;\n\n beforeEach(async () => {\n // Mock plumber\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub()\n };\n });\n\n afterEach(() => {\n restore();\n });\n\n describe('basic functionality', () => {\n it('creates render root as element itself', () => {\n const editorNode = new CanvasNode();\n expect(editorNode.createRenderRoot()).to.equal(editorNode);\n });\n });\n\n describe('renderAction', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders action with known config', () => {\n const mockNode: Node = {\n uuid: 'test-node-3',\n actions: [],\n exits: []\n };\n\n const action: any = {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Test message',\n quick_replies: []\n };\n\n const result = (editorNode as any).renderAction(mockNode, action, 0);\n expect(result).to.exist;\n });\n\n it('renders action with unknown config', () => {\n const mockNode: Node = {\n uuid: 'test-node-4',\n actions: [],\n exits: []\n };\n\n const action: Action = {\n type: 'unknown_action' as any,\n uuid: 'action-1'\n };\n\n const result = (editorNode as any).renderAction(mockNode, action, 1);\n expect(result).to.exist;\n });\n });\n\n describe('renderRouter', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders router with result name', () => {\n const mockRouter: Router = {\n type: 'switch',\n result_name: 'test_result',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'wait_for_response'\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.exist;\n });\n\n it('renders router without result name', () => {\n const mockRouter: Router = {\n type: 'switch',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'wait_for_response'\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.exist;\n });\n\n it('returns undefined for router with unknown UI type', () => {\n const mockRouter: Router = {\n type: 'switch',\n categories: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 50, top: 100 },\n type: 'unknown_type' as any\n };\n\n const result = (editorNode as any).renderRouter(mockRouter, mockUI);\n expect(result).to.be.undefined;\n });\n });\n\n describe('renderCategories', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('returns null when no router', () => {\n const mockNode: Node = {\n uuid: 'test-node-7',\n actions: [],\n exits: []\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.be.null;\n });\n\n it('returns null when no categories', () => {\n const mockNode: Node = {\n uuid: 'test-node-8',\n actions: [],\n exits: [],\n router: {\n type: 'switch',\n categories: undefined as any\n }\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.be.null;\n });\n\n it('renders categories with exits', () => {\n const mockNode: Node = {\n uuid: 'test-node-9',\n actions: [],\n exits: [{ uuid: 'exit-1' }, { uuid: 'exit-2' }],\n router: {\n type: 'switch',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const result = (editorNode as any).renderCategories(mockNode);\n expect(result).to.exist;\n });\n });\n\n describe('renderExit', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders exit with connected class when destination exists', async () => {\n const exit: Exit = {\n uuid: 'exit-connected',\n destination_uuid: 'destination-node'\n };\n\n const result = (editorNode as any).renderExit(exit);\n const container = await fixture(html`<div>${result}</div>`);\n\n const exitElement = container.querySelector('.exit');\n expect(exitElement).to.exist;\n expect(exitElement?.classList.contains('connected')).to.be.true;\n expect(exitElement?.getAttribute('id')).to.equal('exit-connected');\n });\n\n it('renders exit without connected class when no destination', async () => {\n const exit: Exit = {\n uuid: 'exit-unconnected'\n };\n\n const result = (editorNode as any).renderExit(exit);\n const container = await fixture(html`<div>${result}</div>`);\n\n const exitElement = container.querySelector('.exit');\n expect(exitElement).to.exist;\n expect(exitElement?.classList.contains('connected')).to.be.false;\n expect(exitElement?.getAttribute('id')).to.equal('exit-unconnected');\n });\n });\n\n describe('renderTitle', () => {\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders title with config color and name', async () => {\n const config = {\n name: 'Test Action',\n group: ACTION_GROUPS.send // Uses 'send' group which has color '#3498db'\n };\n\n const mockAction: Action = {\n type: 'send_msg',\n uuid: 'test-action'\n };\n\n const result = (editorNode as any).renderTitle(config, mockAction, 0);\n const container = await fixture(html`<div>${result}</div>`);\n\n const title = container.querySelector('.cn-title');\n expect(title).to.exist;\n\n const nameElement = title?.querySelector('.name');\n expect(nameElement?.textContent?.trim()).to.equal('Test Action');\n // The 'send' group has color '#3498db' from ACTION_GROUP_METADATA\n expect(title?.getAttribute('style')).to.contain('background:#3498db');\n });\n });\n\n describe('updated lifecycle', () => {\n it('handles updated without node changes', () => {\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n\n const changes = new Map();\n changes.set('other', true);\n\n // Should not throw and not call plumber methods\n expect(() => {\n (editorNode as any).updated(changes);\n }).to.not.throw();\n\n expect(mockPlumber.makeTarget).to.not.have.been.called;\n });\n\n it('verifies updated method exists', () => {\n editorNode = new CanvasNode();\n expect(typeof (editorNode as any).updated).to.equal('function');\n });\n\n it('processes node changes and calls plumber methods', () => {\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n\n const mockNode: Node = {\n uuid: 'test-node-10',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-2' },\n { uuid: 'exit-2' } // This should call makeSource\n ]\n };\n\n // Mock querySelector to return a mock element with getBoundingClientRect\n const mockElement = {\n getBoundingClientRect: stub().returns({ width: 200, height: 100 })\n };\n stub(editorNode, 'querySelector').returns(mockElement as any);\n\n // Simulate the updated lifecycle\n (editorNode as any).node = mockNode;\n\n const changes = new Map();\n changes.set('node', true);\n\n // Test just the plumber method calls without store dependency\n // by directly calling the logic that would be in updated\n if ((editorNode as any).plumber && mockNode) {\n (editorNode as any).plumber.makeTarget(mockNode.uuid);\n\n for (const exit of mockNode.exits) {\n if (!exit.destination_uuid) {\n (editorNode as any).plumber.makeSource(exit.uuid);\n } else {\n (editorNode as any).plumber.connectIds(\n exit.uuid,\n exit.destination_uuid\n );\n }\n }\n }\n\n expect(mockPlumber.makeTarget).to.have.been.calledWith('test-node-10');\n expect(mockPlumber.makeSource).to.have.been.calledWith('exit-2');\n expect(mockPlumber.connectIds).to.have.been.calledWith(\n 'exit-1',\n 'node-2'\n );\n });\n });\n\n describe('basic integration', () => {\n it('can create and verify structure without full rendering', () => {\n const mockNode: Node = {\n uuid: 'integration-test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: 'next-node' }]\n };\n\n // Test individual render methods work\n editorNode = new CanvasNode();\n\n // Test renderAction\n const actionResult = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n expect(actionResult).to.exist;\n\n // Test renderExit\n const exitResult = (editorNode as any).renderExit(mockNode.exits[0]);\n expect(exitResult).to.exist;\n\n // Verify the node structure is as expected\n expect(mockNode.uuid).to.equal('integration-test-node');\n expect(mockNode.actions).to.have.length(1);\n expect(mockNode.exits).to.have.length(1);\n });\n });\n\n describe('drag and drop functionality', () => {\n let editorNode: CanvasNode;\n\n beforeEach(() => {\n editorNode = new CanvasNode();\n });\n\n it('renders actions with sortable class and proper IDs', async () => {\n const mockNode: Node = {\n uuid: 'sortable-test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n // Test that renderAction includes sortable class and proper ID\n const result1 = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n const result2 = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[1],\n 1\n );\n\n expect(result1).to.exist;\n expect(result2).to.exist;\n\n // Render the template to check the actual DOM\n const container1 = await fixture(html`<div>${result1}</div>`);\n const container2 = await fixture(html`<div>${result2}</div>`);\n\n const actionElement1 = container1.querySelector('.action');\n const actionElement2 = container2.querySelector('.action');\n\n expect(actionElement1).to.exist;\n expect(actionElement1?.classList.contains('sortable')).to.be.true;\n expect(actionElement1?.id).to.equal('action-0');\n\n expect(actionElement2).to.exist;\n expect(actionElement2?.classList.contains('sortable')).to.be.true;\n expect(actionElement2?.id).to.equal('action-1');\n });\n\n it('includes drag handle in rendered actions', async () => {\n const mockNode: Node = {\n uuid: 'drag-handle-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n let editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${{ position: { left: 0, top: 0 } }}\n ></temba-flow-node>`\n );\n\n // No drag handle should be present if only one action\n let dragHandle = editorNode.querySelector('.drag-handle');\n expect(dragHandle).to.not.exist;\n\n // Now add a second action to verify drag handle appears\n mockNode.actions.push({\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any);\n\n editorNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${{ position: { left: 0, top: 0 } }}\n ></temba-flow-node>`\n );\n\n dragHandle = editorNode.querySelector('.drag-handle');\n expect(dragHandle).to.exist;\n });\n\n it('renders SortableList when actions are present', async () => {\n const mockNode: Node = {\n uuid: 'sortable-list-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n const renderResult = editorNode.render();\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${renderResult}</div>`);\n\n const sortableList = container.querySelector('temba-sortable-list');\n expect(sortableList).to.exist;\n });\n\n it('does not render SortableList when no actions', async () => {\n const mockNode: Node = {\n uuid: 'no-actions-test',\n actions: [],\n exits: [{ uuid: 'exit-1' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n const renderResult = editorNode.render();\n\n // Check that template does not include temba-sortable-list\n expect(renderResult.strings.join('')).to.not.contain(\n 'temba-sortable-list'\n );\n });\n\n it('handles order changed events correctly', async () => {\n const mockNode: Node = {\n uuid: 'order-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'First',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Second',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-3',\n text: 'Third',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n (editorNode as any).node = mockNode;\n\n // Create a mock order changed event (swap first and last actions)\n const orderChangedEvent = new CustomEvent(CustomEventType.OrderChanged, {\n detail: { swap: [0, 2] }\n });\n\n // Call the handler directly\n (editorNode as any).handleActionOrderChanged(orderChangedEvent);\n\n // Verify the actions were reordered correctly\n expect((editorNode as any).node.actions).to.have.length(3);\n expect(((editorNode as any).node.actions[0] as any).text).to.equal(\n 'Second'\n );\n expect(((editorNode as any).node.actions[1] as any).text).to.equal(\n 'Third'\n );\n expect(((editorNode as any).node.actions[2] as any).text).to.equal(\n 'First'\n );\n });\n\n it('preserves action data during reordering', () => {\n const mockNode: Node = {\n uuid: 'preserve-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Message 1',\n quick_replies: ['Yes', 'No']\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Message 2',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n (editorNode as any).node = mockNode;\n\n // Swap the two actions\n const orderChangedEvent = new CustomEvent(CustomEventType.OrderChanged, {\n detail: { swap: [0, 1] }\n });\n\n (editorNode as any).handleActionOrderChanged(orderChangedEvent);\n\n // Verify all action data is preserved\n expect((editorNode as any).node.actions).to.have.length(2);\n expect(((editorNode as any).node.actions[0] as any).text).to.equal(\n 'Message 2'\n );\n expect(\n ((editorNode as any).node.actions[0] as any).quick_replies\n ).to.deep.equal([]);\n expect(((editorNode as any).node.actions[1] as any).text).to.equal(\n 'Message 1'\n );\n expect(\n ((editorNode as any).node.actions[1] as any).quick_replies\n ).to.deep.equal(['Yes', 'No']);\n });\n\n it('integrates with SortableList for full drag functionality', async () => {\n const mockNode: Node = {\n uuid: 'integration-drag-test',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'First Action',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'Second Action',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-3',\n text: 'Third Action',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n // Set properties on the component\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Render the full component\n const renderResult = editorNode.render();\n const container = await fixture(html`<div>${renderResult}</div>`);\n\n // Find the sortable list\n const sortableList = container.querySelector('temba-sortable-list');\n expect(sortableList).to.exist;\n\n // Verify all actions are rendered as sortable items\n const sortableItems = container.querySelectorAll('.sortable');\n expect(sortableItems).to.have.length(3);\n\n // Verify each action has correct ID and structure\n expect(sortableItems[0].id).to.equal('action-0');\n expect(sortableItems[1].id).to.equal('action-1');\n expect(sortableItems[2].id).to.equal('action-2');\n\n // Verify drag handles are present\n const dragHandles = container.querySelectorAll('.drag-handle');\n expect(dragHandles).to.have.length(3);\n });\n });\n\n describe('exit disconnection', () => {\n let mockStore: any;\n let mockUpdateNode: any;\n\n beforeEach(() => {\n mockUpdateNode = stub();\n mockStore = {\n getState: stub().returns({\n updateNode: mockUpdateNode\n })\n };\n\n // Mock the plumber with disconnect capabilities\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub(),\n removeExitConnection: stub().returns(true),\n setConnectionRemovingState: stub().returns(true)\n };\n\n (window as any).getStore = () => mockStore;\n\n editorNode = new CanvasNode();\n (editorNode as any).plumber = mockPlumber;\n });\n\n afterEach(() => {\n // Restore any stubbed functions\n if ((window as any).originalGetStore) {\n (window as any).getStore = (window as any).originalGetStore;\n }\n });\n\n it('handles exit click to initiate disconnection', async () => {\n // Create a node with a connected exit\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: 'target-node' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Mock querySelector to return the exit element\n const exitElement = document.createElement('div');\n exitElement.id = 'exit-1';\n exitElement.classList.add('exit', 'connected');\n (editorNode as any).querySelector = stub().returns(exitElement);\n\n // Create a mock event\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub(),\n currentTarget: exitElement\n } as any;\n\n // Mock getStore directly in the disconnectExit method\n const originalDisconnectExit = (editorNode as any).disconnectExit;\n (editorNode as any).disconnectExit = function (exit: any) {\n // Call original but override the store logic\n this.plumber.removeExitConnection(exit.uuid);\n mockUpdateNode.call(null, this.node.uuid, {\n ...this.node,\n exits: this.node.exits.map((e: any) =>\n e.uuid === exit.uuid ? { ...e, destination_uuid: null } : e\n )\n });\n };\n\n // Call the click handler directly to initiate removal\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the exit is marked for removal in the component state\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.true;\n\n // Verify a timeout was set\n expect((editorNode as any).exitRemovalTimeouts.has('exit-1')).to.be.true;\n\n // Now click again to confirm disconnection\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the plumber was called to remove the connection\n expect(mockPlumber.removeExitConnection).to.have.been.calledWith(\n 'exit-1'\n );\n\n // Verify the node was updated with disconnected exit\n expect(mockUpdateNode).to.have.been.called;\n\n // Restore original method\n (editorNode as any).disconnectExit = originalDisconnectExit;\n });\n\n it('cancels disconnection after timeout', async () => {\n // Create a fake timer for this test\n const clock = useFakeTimers();\n\n try {\n // Create a node with a connected exit\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: 'target-node' }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 100, top: 200 },\n type: 'execute_actions'\n };\n\n (editorNode as any).node = mockNode;\n (editorNode as any).ui = mockUI;\n\n // Mock querySelector to return the exit element\n const exitElement = document.createElement('div');\n exitElement.id = 'exit-1';\n exitElement.classList.add('exit', 'connected');\n (editorNode as any).querySelector = stub().returns(exitElement);\n\n // Create a mock event\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub(),\n currentTarget: exitElement\n } as any;\n\n // Call the click handler to initiate disconnection\n (editorNode as any).handleExitClick(mockEvent, mockNode.exits[0]);\n\n // Verify the exit is marked for removal\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.true;\n\n // Advance the clock past the timeout (1500ms is the default timeout)\n clock.tick(1501);\n\n // Verify the removing state is cleared after the timeout\n expect((editorNode as any).exitRemovingState.has('exit-1')).to.be.false;\n expect(mockPlumber.setConnectionRemovingState).to.have.been.calledWith(\n 'exit-1',\n false\n );\n } finally {\n // Always restore the clock\n clock.restore();\n }\n });\n });\n\n describe('action removal', () => {\n let editorNode: CanvasNode;\n let mockPlumber: any;\n let getStoreStub: any;\n\n beforeEach(() => {\n editorNode = new CanvasNode();\n\n // Mock plumber\n mockPlumber = {\n makeTarget: stub(),\n makeSource: stub(),\n connectIds: stub(),\n removeExitConnection: stub(),\n forgetNode: stub()\n };\n editorNode['plumber'] = mockPlumber;\n });\n\n afterEach(() => {\n if (getStoreStub) {\n getStoreStub.restore();\n }\n });\n\n it('handles action removal state management', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Initially, no action should be in removing state\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .false;\n\n // Call the click handler to initiate removal\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n // Verify the action is marked for removal\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n\n // Verify event handlers were called\n expect(mockEvent.preventDefault).to.have.been.called;\n expect(mockEvent.stopPropagation).to.have.been.called;\n });\n\n it('cancels action removal after timeout', async () => {\n const clock = useFakeTimers();\n\n try {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Call the click handler to initiate removal\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n // Verify the action is marked for removal\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n\n // Advance the clock past the timeout (1000ms is the action removal timeout)\n clock.tick(1001);\n\n // Verify the removing state is cleared after the timeout\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .false;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .false;\n } finally {\n // Always restore the clock\n clock.restore();\n }\n });\n\n it('clears timeouts on disconnect', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Start a removal process\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n\n // Disconnect the component\n editorNode.disconnectedCallback();\n\n // Verify all state is cleared\n expect((editorNode as any).actionRemovingState.size).to.equal(0);\n expect((editorNode as any).actionRemovalTimeouts.size).to.equal(0);\n });\n\n it('renders action with remove button', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n // Test that renderAction includes remove button\n const result = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n\n expect(result).to.exist;\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${result}</div>`);\n const removeButton = container.querySelector('.remove-button');\n\n expect(removeButton).to.exist;\n expect(removeButton?.textContent?.trim()).to.equal('✕');\n expect(removeButton?.getAttribute('title')).to.equal('Remove action');\n });\n\n it('shows removing state in UI', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n // Set action to removing state\n (editorNode as any).actionRemovingState.add('action-1');\n\n // Test that renderAction shows removing state\n const result = (editorNode as any).renderAction(\n mockNode,\n mockNode.actions[0],\n 0\n );\n\n expect(result).to.exist;\n\n // Render the template to check the actual DOM\n const container = await fixture(html`<div>${result}</div>`);\n const actionElement = container.querySelector('.action');\n\n expect(actionElement).to.exist;\n expect(actionElement?.classList.contains('removing')).to.be.true;\n\n // Check that title shows \"Remove?\"\n const titleElement = container.querySelector('.cn-title .name');\n expect(titleElement?.textContent?.trim()).to.equal('Remove?');\n });\n\n it('handles multiple action removal states independently', async () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any,\n {\n type: 'send_msg',\n uuid: 'action-2',\n text: 'World',\n quick_replies: []\n } as any\n ],\n exits: []\n };\n\n editorNode['node'] = mockNode;\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Start removal for first action\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[0],\n 0\n );\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovingState.has('action-2')).to.be\n .false;\n\n // Start removal for second action\n (editorNode as any).handleActionRemoveClick(\n mockEvent,\n mockNode.actions[1],\n 1\n );\n expect((editorNode as any).actionRemovingState.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovingState.has('action-2')).to.be\n .true;\n\n // Both actions should have timeouts\n expect((editorNode as any).actionRemovalTimeouts.has('action-1')).to.be\n .true;\n expect((editorNode as any).actionRemovalTimeouts.has('action-2')).to.be\n .true;\n });\n\n it('properly reroutes JSPlumb connections when removing node with connections', async () => {\n // This test verifies that the connection rerouting logic works correctly\n // by testing the specific logic within removeNodeWithConnections\n\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-after', destination_uuid: 'node-after' }]\n };\n\n editorNode['node'] = mockNode;\n\n // Mock the flow definition that would be returned by getStore\n const mockFlowDefinition = {\n nodes: [\n {\n uuid: 'node-before',\n exits: [\n { uuid: 'exit-before-1', destination_uuid: 'test-node' },\n { uuid: 'exit-before-2', destination_uuid: 'test-node' }\n ]\n },\n mockNode,\n {\n uuid: 'node-after',\n exits: []\n }\n ]\n };\n\n // Test the connection rerouting logic directly by simulating what happens\n // when a node with incoming and outgoing connections is removed\n const nodeUuid = mockNode.uuid;\n const incomingConnections: {\n exitUuid: string;\n sourceNodeUuid: string;\n }[] = [];\n const outgoingExits = mockNode.exits.filter(\n (exit) => exit.destination_uuid\n );\n\n // Find incoming connections (same logic as in removeNodeWithConnections)\n for (const node of mockFlowDefinition.nodes) {\n if (node.uuid !== nodeUuid) {\n for (const exit of node.exits) {\n if (exit.destination_uuid === nodeUuid) {\n incomingConnections.push({\n exitUuid: exit.uuid,\n sourceNodeUuid: node.uuid\n });\n }\n }\n }\n }\n\n // Verify we found the expected incoming connections\n expect(incomingConnections).to.have.length(2);\n expect(incomingConnections[0].exitUuid).to.equal('exit-before-1');\n expect(incomingConnections[1].exitUuid).to.equal('exit-before-2');\n\n // Verify we found the expected outgoing connections\n expect(outgoingExits).to.have.length(1);\n expect(outgoingExits[0].destination_uuid).to.equal('node-after');\n\n // Simulate the rerouting logic\n if (incomingConnections.length > 0 && outgoingExits.length > 0) {\n const firstDestination = outgoingExits[0].destination_uuid;\n\n // Verify the destination is correct for rerouting\n expect(firstDestination).to.equal('node-after');\n }\n\n // This test verifies the rerouting logic is correct. The actual fix ensures that:\n // 1. Old JSPlumb connections are removed with removeExitConnection\n // 2. Store is updated with updateConnection\n // 3. New JSPlumb connections are created with connectIds\n // This sequence ensures JSPlumb visuals stay in sync with the flow definition\n });\n\n it('reroutes connections when removing node with multiple exits pointing to same destination', async () => {\n // Test case: node with multiple exits, but all point to the same destination\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after' },\n { uuid: 'exit-2', destination_uuid: 'node-after' },\n { uuid: 'exit-3', destination_uuid: 'node-after' }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state - node-before points to test-node\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes to trigger the rerouting logic\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that node-before's exit was rerouted to node-after\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.equal(\n 'node-after'\n );\n });\n\n it('does not reroute connections when node has exits with different destinations', async () => {\n // Test case: node with multiple exits pointing to different destinations\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after-1' },\n { uuid: 'exit-2', destination_uuid: 'node-after-2' }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after-1',\n actions: [],\n exits: []\n },\n {\n uuid: 'node-after-2',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that incoming connection was cleared (set to null), not rerouted\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.be.null;\n });\n\n it('does not reroute connections when node has exits with null destinations', async () => {\n // Test case: node with some exits having null destinations\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [\n { uuid: 'exit-1', destination_uuid: 'node-after' },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const mockFlowDefinition = {\n language: 'en',\n localization: {},\n name: 'Test Flow',\n type: 'messaging' as const,\n uuid: 'test-uuid',\n revision: 1,\n spec_version: '14.3',\n nodes: [\n {\n uuid: 'node-before',\n actions: [],\n exits: [{ uuid: 'exit-before', destination_uuid: 'test-node' }]\n },\n mockNode,\n {\n uuid: 'node-after',\n actions: [],\n exits: []\n }\n ],\n _ui: {\n nodes: {},\n languages: []\n }\n };\n\n // Set up the zustand store with our test flow\n const { zustand } = await import('../src/store/AppState');\n zustand.setState({\n flowDefinition: mockFlowDefinition as any\n });\n\n // Verify initial state\n const initialNodeBefore = zustand\n .getState()\n .flowDefinition.nodes.find((n) => n.uuid === 'node-before');\n expect(initialNodeBefore.exits[0].destination_uuid).to.equal('test-node');\n\n // Call removeNodes\n zustand.getState().removeNodes(['test-node']);\n\n // Verify that the node was removed\n const remainingNodes = zustand.getState().flowDefinition.nodes;\n expect(remainingNodes.find((n) => n.uuid === 'test-node')).to.be\n .undefined;\n\n // Verify that incoming connection was cleared (set to null), not rerouted\n const updatedNodeBefore = remainingNodes.find(\n (n) => n.uuid === 'node-before'\n );\n expect(updatedNodeBefore.exits[0].destination_uuid).to.be.null;\n });\n });\n\n describe('add action button', () => {\n beforeEach(async () => {\n editorNode = new CanvasNode();\n editorNode['plumber'] = mockPlumber;\n });\n\n it('handleAddActionClick fires AddActionRequested event', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n editorNode['node'] = mockNode;\n\n let eventFired = false;\n let eventDetail: any = null;\n\n editorNode.addEventListener(CustomEventType.AddActionRequested, (e) => {\n eventFired = true;\n eventDetail = (e as CustomEvent).detail;\n });\n\n const mockEvent = {\n preventDefault: stub(),\n stopPropagation: stub()\n } as any;\n\n // Call the add action click handler\n (editorNode as any).handleAddActionClick(mockEvent);\n\n // Verify the event was fired with correct detail\n expect(eventFired).to.be.true;\n expect(eventDetail).to.exist;\n expect(eventDetail.nodeUuid).to.equal('test-node');\n\n // Verify event handlers were called\n expect(mockEvent.preventDefault).to.have.been.called;\n expect(mockEvent.stopPropagation).to.have.been.called;\n });\n\n it('renders add action button for execute_actions nodes', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n type: 'send_msg',\n uuid: 'action-1',\n text: 'Hello',\n quick_replies: []\n } as any\n ],\n exits: [{ uuid: 'exit-1', destination_uuid: null }]\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'execute_actions'\n };\n\n editorNode['node'] = mockNode;\n editorNode['ui'] = mockUI;\n\n const rendered = editorNode.render();\n expect(rendered).to.exist;\n });\n\n it('renders correctly for non-execute_actions nodes', () => {\n const mockNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: [{ uuid: 'exit-1', destination_uuid: null }],\n router: {\n type: 'switch',\n categories: []\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'wait_for_response'\n };\n\n editorNode['node'] = mockNode;\n editorNode['ui'] = mockUI;\n\n const rendered = editorNode.render();\n expect(rendered).to.exist;\n });\n });\n\n describe('router section graying', () => {\n it('grays out split nodes when categories not included in translation', async () => {\n const mockNode: Node = {\n uuid: 'split-node-1',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = true;\n (editorNode as any).includeCategoriesInTranslation = false;\n (editorNode as any).languageCode = 'spa';\n\n // Force re-render\n editorNode.requestUpdate('isTranslating');\n editorNode.requestUpdate('includeCategoriesInTranslation');\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it has the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.true;\n });\n\n it('does not gray out split nodes when categories are included in translation', async () => {\n const mockNode: Node = {\n uuid: 'split-node-2',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = true;\n (editorNode as any).includeCategoriesInTranslation = true;\n (editorNode as any).languageCode = 'spa';\n\n await editorNode.requestUpdate();\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it does NOT have the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.false;\n });\n\n it('does not gray out split nodes when not translating', async () => {\n const mockNode: Node = {\n uuid: 'split-node-3',\n actions: [],\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ],\n router: {\n type: 'switch',\n result_name: 'Response',\n categories: [\n { uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }\n ]\n }\n };\n\n const mockUI: NodeUI = {\n position: { left: 0, top: 0 },\n type: 'split_by_groups'\n };\n\n // Create node\n const editorNode: CanvasNode = await fixture(\n html`<temba-flow-node\n .node=${mockNode}\n .ui=${mockUI}\n ></temba-flow-node>`\n );\n\n // Set fromStore properties directly\n (editorNode as any).isTranslating = false;\n (editorNode as any).languageCode = 'eng';\n\n await editorNode.requestUpdate();\n await editorNode.updateComplete;\n\n // Find the node element\n const nodeElement = editorNode.querySelector('.node');\n expect(nodeElement).to.exist;\n\n // Verify it does NOT have the non-localizable class\n expect(nodeElement?.classList.contains('non-localizable')).to.be.false;\n });\n });\n});\n"]}
@@ -0,0 +1,106 @@
1
+ import { html, fixture, expect } from '@open-wc/testing';
2
+ import { Editor } from '../src/flow/Editor';
3
+ import { stub, restore } from 'sinon';
4
+ customElements.define('temba-flow-editor-revisions', Editor);
5
+ describe('Editor Revisions', () => {
6
+ let element;
7
+ let fetchStub;
8
+ beforeEach(async () => {
9
+ restore();
10
+ fetchStub = stub(window, 'fetch');
11
+ // Initialize without 'flow' attribute to prevent firstUpdated from calling getStore().getState()
12
+ element = await fixture(html `<temba-flow-editor-revisions></temba-flow-editor-revisions>`);
13
+ element.flow = 'test-flow';
14
+ });
15
+ afterEach(() => {
16
+ restore();
17
+ });
18
+ it('should exclude the most recent revision from the list', async () => {
19
+ const mockRevisions = [
20
+ {
21
+ id: 3,
22
+ created_on: '2023-01-03',
23
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
24
+ },
25
+ {
26
+ id: 2,
27
+ created_on: '2023-01-02',
28
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
29
+ },
30
+ {
31
+ id: 1,
32
+ created_on: '2023-01-01',
33
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
34
+ }
35
+ ];
36
+ // Mock the fetch response for the revisions list
37
+ const mockResponse = new Response(JSON.stringify({ results: mockRevisions }), {
38
+ status: 200,
39
+ headers: { 'Content-Type': 'application/json' }
40
+ });
41
+ fetchStub.resolves(mockResponse);
42
+ // Call fetchRevisions (private)
43
+ // Note: fetchRevisions calls fetchResults -> fetchResultsPage -> fetch
44
+ await element.fetchRevisions();
45
+ const revisions = element.revisions;
46
+ expect(revisions.length).to.equal(2);
47
+ expect(revisions[0].id).to.equal(2);
48
+ expect(revisions[1].id).to.equal(1);
49
+ });
50
+ it('should handle empty revisions list', async () => {
51
+ const mockResponse = new Response(JSON.stringify({ results: [] }), {
52
+ status: 200
53
+ });
54
+ fetchStub.resolves(mockResponse);
55
+ await element.fetchRevisions();
56
+ const revisions = element.revisions;
57
+ expect(revisions.length).to.equal(0);
58
+ });
59
+ it('should handle single revision in list', async () => {
60
+ const mockRevisions = [
61
+ {
62
+ id: 1,
63
+ created_on: '2023-01-01',
64
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
65
+ }
66
+ ];
67
+ const mockResponse = new Response(JSON.stringify({ results: mockRevisions }), { status: 200 });
68
+ fetchStub.resolves(mockResponse);
69
+ await element.fetchRevisions();
70
+ const revisions = element.revisions;
71
+ expect(revisions.length).to.equal(0);
72
+ });
73
+ it('should have purple color for revisions tab and blue for selected item', async () => {
74
+ // Force revisions window to show
75
+ element.revisionsWindowHidden = false;
76
+ element.localizationWindowHidden = true;
77
+ // Mock revisions so we can see list items
78
+ const mockRevisions = [
79
+ {
80
+ id: 2,
81
+ created_on: '2023-01-02',
82
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
83
+ },
84
+ {
85
+ id: 1,
86
+ created_on: '2023-01-01',
87
+ user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }
88
+ }
89
+ ];
90
+ element.revisions = mockRevisions;
91
+ element.viewingRevision = mockRevisions[0]; // Select the first one
92
+ await element.requestUpdate();
93
+ // Check tab color
94
+ const tab = element.querySelector('#revisions-tab');
95
+ expect(tab).to.exist;
96
+ expect(tab.getAttribute('color')).to.equal('rgb(142, 94, 167)');
97
+ // Check selected item styles
98
+ const selectedItem = element.querySelector('.revision-item.selected');
99
+ expect(selectedItem).to.exist;
100
+ // We need to check inline styles because they are set in the template
101
+ const style = selectedItem.getAttribute('style');
102
+ expect(style).to.contain('#f0f6ff'); // Blue background
103
+ expect(style).to.contain('#a4cafe'); // Blue border
104
+ });
105
+ });
106
+ //# sourceMappingURL=temba-flow-editor-revisions.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temba-flow-editor-revisions.test.js","sourceRoot":"","sources":["../../test/temba-flow-editor-revisions.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,M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AAC,eAAe,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB;QAE5E,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;QAE9B,kBAAkB;QAClB,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QACpD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAEhE,6BAA6B;QAC7B,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CACxC,yBAAyB,CACX,CAAC;QACjB,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAE9B,sEAAsE;QACtE,MAAM,KAAK,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB;QACvD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html, fixture, expect } from '@open-wc/testing';\nimport { Editor } from '../src/flow/Editor';\nimport { stub, restore, SinonStub } from 'sinon';\n\ncustomElements.define('temba-flow-editor-revisions', Editor);\n\ndescribe('Editor Revisions', () => {\n let element: Editor;\n let fetchStub: SinonStub;\n\n beforeEach(async () => {\n restore();\n fetchStub = stub(window, 'fetch');\n // Initialize without 'flow' attribute to prevent firstUpdated from calling getStore().getState()\n element = await fixture(\n html`<temba-flow-editor-revisions></temba-flow-editor-revisions>`\n );\n element.flow = 'test-flow';\n });\n\n afterEach(() => {\n restore();\n });\n\n it('should exclude the most recent revision from the list', async () => {\n const mockRevisions = [\n {\n id: 3,\n created_on: '2023-01-03',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n },\n {\n id: 2,\n created_on: '2023-01-02',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n },\n {\n id: 1,\n created_on: '2023-01-01',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n }\n ];\n\n // Mock the fetch response for the revisions list\n const mockResponse = new Response(\n JSON.stringify({ results: mockRevisions }),\n {\n status: 200,\n headers: { 'Content-Type': 'application/json' }\n }\n );\n\n fetchStub.resolves(mockResponse);\n\n // Call fetchRevisions (private)\n // Note: fetchRevisions calls fetchResults -> fetchResultsPage -> fetch\n await (element as any).fetchRevisions();\n\n const revisions = (element as any).revisions;\n expect(revisions.length).to.equal(2);\n expect(revisions[0].id).to.equal(2);\n expect(revisions[1].id).to.equal(1);\n });\n\n it('should handle empty revisions list', async () => {\n const mockResponse = new Response(JSON.stringify({ results: [] }), {\n status: 200\n });\n fetchStub.resolves(mockResponse);\n\n await (element as any).fetchRevisions();\n const revisions = (element as any).revisions;\n expect(revisions.length).to.equal(0);\n });\n\n it('should handle single revision in list', async () => {\n const mockRevisions = [\n {\n id: 1,\n created_on: '2023-01-01',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n }\n ];\n const mockResponse = new Response(\n JSON.stringify({ results: mockRevisions }),\n { status: 200 }\n );\n fetchStub.resolves(mockResponse);\n\n await (element as any).fetchRevisions();\n const revisions = (element as any).revisions;\n expect(revisions.length).to.equal(0);\n });\n\n it('should have purple color for revisions tab and blue for selected item', async () => {\n // Force revisions window to show\n (element as any).revisionsWindowHidden = false;\n (element as any).localizationWindowHidden = true;\n\n // Mock revisions so we can see list items\n const mockRevisions = [\n {\n id: 2,\n created_on: '2023-01-02',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n },\n {\n id: 1,\n created_on: '2023-01-01',\n user: { id: 1, first_name: 'A', last_name: 'B', username: 'ab' }\n }\n ];\n (element as any).revisions = mockRevisions;\n (element as any).viewingRevision = mockRevisions[0]; // Select the first one\n\n await element.requestUpdate();\n\n // Check tab color\n const tab = element.querySelector('#revisions-tab');\n expect(tab).to.exist;\n expect(tab.getAttribute('color')).to.equal('rgb(142, 94, 167)');\n\n // Check selected item styles\n const selectedItem = element.querySelector(\n '.revision-item.selected'\n ) as HTMLElement;\n expect(selectedItem).to.exist;\n\n // We need to check inline styles because they are set in the template\n const style = selectedItem.getAttribute('style');\n expect(style).to.contain('#f0f6ff'); // Blue background\n expect(style).to.contain('#a4cafe'); // Blue border\n });\n});\n"]}