@nyaruka/temba-components 0.131.2 → 0.131.3
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.
- package/CHANGELOG.md +14 -0
- package/demo/components/floating-tabs/example.html +400 -0
- package/demo/components/flow/index.html +1 -1
- package/demo/data/flows/sample-flow.json +41 -2
- package/demo/data/flows/voicemail.json +613 -0
- package/demo/index.html +6 -0
- package/dist/locales/es.js +5 -5
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +5 -5
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/locale-codes.js +11 -2
- package/dist/locales/locale-codes.js.map +1 -1
- package/dist/locales/pt.js +5 -5
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +1109 -535
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js +167 -0
- package/out-tsc/src/display/FloatingTab.js.map +1 -0
- package/out-tsc/src/display/ProgressBar.js +22 -2
- package/out-tsc/src/display/ProgressBar.js.map +1 -1
- package/out-tsc/src/events.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +165 -31
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +857 -3
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +239 -19
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/NodeTypeSelector.js +44 -3
- package/out-tsc/src/flow/NodeTypeSelector.js.map +1 -1
- package/out-tsc/src/flow/StickyNote.js +12 -3
- package/out-tsc/src/flow/StickyNote.js.map +1 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js +2 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/add_contact_urn.js +2 -1
- package/out-tsc/src/flow/actions/add_contact_urn.js.map +1 -1
- package/out-tsc/src/flow/actions/add_input_labels.js +2 -1
- package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -1
- package/out-tsc/src/flow/actions/play_audio.js +2 -1
- package/out-tsc/src/flow/actions/play_audio.js.map +1 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js +2 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/request_optin.js +1 -0
- package/out-tsc/src/flow/actions/request_optin.js.map +1 -1
- package/out-tsc/src/flow/actions/say_msg.js +2 -1
- package/out-tsc/src/flow/actions/say_msg.js.map +1 -1
- package/out-tsc/src/flow/actions/send_broadcast.js +2 -1
- package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -1
- package/out-tsc/src/flow/actions/send_email.js +2 -1
- package/out-tsc/src/flow/actions/send_email.js.map +1 -1
- package/out-tsc/src/flow/actions/send_msg.js +93 -3
- package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js +2 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_field.js +2 -1
- package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_language.js +2 -1
- package/out-tsc/src/flow/actions/set_contact_language.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_name.js +2 -1
- package/out-tsc/src/flow/actions/set_contact_name.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_status.js +2 -1
- package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
- package/out-tsc/src/flow/actions/set_run_result.js +2 -1
- package/out-tsc/src/flow/actions/set_run_result.js.map +1 -1
- package/out-tsc/src/flow/actions/start_session.js +2 -1
- package/out-tsc/src/flow/actions/start_session.js.map +1 -1
- package/out-tsc/src/flow/config.js +2 -10
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/shared.js +54 -0
- package/out-tsc/src/flow/nodes/shared.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_airtime.js +9 -3
- package/out-tsc/src/flow/nodes/split_by_airtime.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_contact_field.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_contact_field.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_expression.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_expression.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_groups.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_groups.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_intent.js +3 -2
- package/out-tsc/src/flow/nodes/split_by_intent.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm.js +9 -2
- package/out-tsc/src/flow/nodes/split_by_llm.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +9 -2
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_random.js +8 -2
- package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_resthook.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_resthook.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_run_result.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_run_result.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_scheme.js +8 -3
- package/out-tsc/src/flow/nodes/split_by_scheme.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_subflow.js +8 -2
- package/out-tsc/src/flow/nodes/split_by_subflow.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_ticket.js +8 -2
- package/out-tsc/src/flow/nodes/split_by_ticket.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_webhook.js +8 -2
- package/out-tsc/src/flow/nodes/split_by_webhook.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_digits.js +3 -2
- package/out-tsc/src/flow/nodes/wait_for_digits.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_menu.js +3 -2
- package/out-tsc/src/flow/nodes/wait_for_menu.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js +8 -3
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/flow/types.js +15 -0
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/layout/FloatingWindow.js +346 -0
- package/out-tsc/src/layout/FloatingWindow.js.map +1 -0
- package/out-tsc/src/live/ContactChat.js +3 -19
- package/out-tsc/src/live/ContactChat.js.map +1 -1
- package/out-tsc/src/locales/es.js +5 -5
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +5 -5
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/locale-codes.js +11 -2
- package/out-tsc/src/locales/locale-codes.js.map +1 -1
- package/out-tsc/src/locales/pt.js +5 -5
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/store/AppState.js +67 -0
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/temba-modules.js +4 -0
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/temba-floating-tab.test.js +91 -0
- package/out-tsc/test/temba-floating-tab.test.js.map +1 -0
- package/out-tsc/test/temba-floating-window.test.js +301 -0
- package/out-tsc/test/temba-floating-window.test.js.map +1 -0
- package/out-tsc/test/temba-flow-editor-node.test.js +117 -0
- package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
- package/out-tsc/test/temba-localization.test.js +471 -0
- package/out-tsc/test/temba-localization.test.js.map +1 -0
- package/out-tsc/test/temba-node-type-selector.test.js +150 -0
- package/out-tsc/test/temba-node-type-selector.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +18 -0
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/floating-tab/default.png +0 -0
- package/screenshots/truth/floating-tab/gray.png +0 -0
- package/screenshots/truth/floating-tab/green.png +0 -0
- package/screenshots/truth/floating-tab/hidden.png +0 -0
- package/screenshots/truth/floating-tab/hover.png +0 -0
- package/screenshots/truth/floating-tab/purple.png +0 -0
- package/screenshots/truth/floating-window/chromeless.png +0 -0
- package/screenshots/truth/floating-window/custom-size.png +0 -0
- package/screenshots/truth/floating-window/default.png +0 -0
- package/screenshots/truth/floating-window/with-header.png +0 -0
- package/screenshots/truth/node-type-selector/action-mode.png +0 -0
- package/screenshots/truth/node-type-selector/split-mode.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/src/display/FloatingTab.ts +174 -0
- package/src/display/ProgressBar.ts +22 -2
- package/src/events.ts +2 -4
- package/src/flow/CanvasNode.ts +190 -32
- package/src/flow/Editor.ts +1040 -3
- package/src/flow/NodeEditor.ts +317 -19
- package/src/flow/NodeTypeSelector.ts +47 -3
- package/src/flow/StickyNote.ts +12 -3
- package/src/flow/actions/add_contact_groups.ts +2 -1
- package/src/flow/actions/add_contact_urn.ts +3 -1
- package/src/flow/actions/add_input_labels.ts +2 -1
- package/src/flow/actions/play_audio.ts +2 -1
- package/src/flow/actions/remove_contact_groups.ts +3 -1
- package/src/flow/actions/request_optin.ts +1 -0
- package/src/flow/actions/say_msg.ts +2 -1
- package/src/flow/actions/send_broadcast.ts +2 -1
- package/src/flow/actions/send_email.ts +3 -1
- package/src/flow/actions/send_msg.ts +134 -3
- package/src/flow/actions/set_contact_channel.ts +2 -1
- package/src/flow/actions/set_contact_field.ts +2 -1
- package/src/flow/actions/set_contact_language.ts +3 -1
- package/src/flow/actions/set_contact_name.ts +2 -1
- package/src/flow/actions/set_contact_status.ts +2 -1
- package/src/flow/actions/set_run_result.ts +2 -1
- package/src/flow/actions/start_session.ts +3 -1
- package/src/flow/config.ts +2 -12
- package/src/flow/nodes/shared.ts +70 -1
- package/src/flow/nodes/split_by_airtime.ts +20 -3
- package/src/flow/nodes/split_by_contact_field.ts +13 -3
- package/src/flow/nodes/split_by_expression.ts +13 -3
- package/src/flow/nodes/split_by_groups.ts +13 -3
- package/src/flow/nodes/split_by_intent.ts +3 -2
- package/src/flow/nodes/split_by_llm.ts +19 -2
- package/src/flow/nodes/split_by_llm_categorize.ts +19 -2
- package/src/flow/nodes/split_by_random.ts +12 -2
- package/src/flow/nodes/split_by_resthook.ts +13 -3
- package/src/flow/nodes/split_by_run_result.ts +13 -3
- package/src/flow/nodes/split_by_scheme.ts +13 -3
- package/src/flow/nodes/split_by_subflow.ts +12 -2
- package/src/flow/nodes/split_by_ticket.ts +12 -2
- package/src/flow/nodes/split_by_webhook.ts +12 -2
- package/src/flow/nodes/wait_for_digits.ts +3 -2
- package/src/flow/nodes/wait_for_menu.ts +3 -2
- package/src/flow/nodes/wait_for_response.ts +13 -3
- package/src/flow/types.ts +47 -0
- package/src/layout/FloatingWindow.ts +386 -0
- package/src/live/ContactChat.ts +4 -19
- package/src/locales/es.ts +18 -13
- package/src/locales/fr.ts +18 -13
- package/src/locales/locale-codes.ts +11 -2
- package/src/locales/pt.ts +18 -13
- package/src/store/AppState.ts +104 -0
- package/static/api/llms.json +18 -0
- package/temba-modules.ts +4 -0
- package/test/temba-floating-tab.test.ts +110 -0
- package/test/temba-floating-window.test.ts +477 -0
- package/test/temba-flow-editor-node.test.ts +144 -0
- package/test/temba-localization.test.ts +611 -0
- package/test/temba-node-type-selector.test.ts +203 -0
- package/test/utils.test.ts +20 -0
- package/test-assets/contacts/history.json +5 -6
- package/test-assets/select/llms.json +2 -2
- package/web-dev-server.config.mjs +47 -1
- package/web-test-runner.config.mjs +0 -1
- package/out-tsc/src/flow/nodes/wait_for_audio.js +0 -7
- package/out-tsc/src/flow/nodes/wait_for_audio.js.map +0 -1
- package/out-tsc/src/flow/nodes/wait_for_image.js +0 -7
- package/out-tsc/src/flow/nodes/wait_for_image.js.map +0 -1
- package/out-tsc/src/flow/nodes/wait_for_location.js +0 -7
- package/out-tsc/src/flow/nodes/wait_for_location.js.map +0 -1
- package/out-tsc/src/flow/nodes/wait_for_video.js +0 -7
- package/out-tsc/src/flow/nodes/wait_for_video.js.map +0 -1
- package/src/flow/nodes/wait_for_audio.ts +0 -7
- package/src/flow/nodes/wait_for_image.ts +0 -7
- package/src/flow/nodes/wait_for_location.ts +0 -7
- package/src/flow/nodes/wait_for_video.ts +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temba-floating-window.test.js","sourceRoot":"","sources":["../../test/temba-floating-window.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE9D,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,GAAG,CAAC,MAAM,YAAY,CAChC,uBAAuB,EACvB;YACE,MAAM,EAAE,iBAAiB;YACzB,KAAK,EAAE,GAAG;YACV,SAAS,EAAE,GAAG;YACd,GAAG,EAAE,GAAG;SACT,EACD,4DAA4D,EAC5D,GAAG,EACH,GAAG,CACJ,CAAmB,CAAC;QAErB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjC,iCAAiC;QACjC,MAAM,CAAC,MAAM,GAAG,KAAK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GAAG,EAAE,GAAG;YACR,IAAI,EAAE,GAAG;SACV,EACD,2CAA2C,EAC3C,GAAG,EACH,GAAG,CACJ,CAAmB,CAAC;QAErB,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,MAAM,MAAM,CAAC,cAAc,CAAC;QAE5B,kCAAkC;QAClC,MAAM,qBAAqB,GAAG,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC;QAC1E,MAAM,CAAC,IAAI,GAAG,qBAAqB,GAAG,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;QACxD,MAAM,MAAM,CAAC,cAAc,CAAC;QAE5B,yEAAyE;QACzE,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,MAAM,MAAM,CAAC,cAAc,CAAC;QAE5B,kEAAkE;QAClE,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAC/B,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,CACrE,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, assert } from '@open-wc/testing';\nimport { FloatingWindow } from '../src/layout/FloatingWindow';\nimport { assertScreenshot, getComponent } from './utils.test';\n\ndescribe('temba-floating-window', () => {\n it('can be created', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Phone Simulator',\n width: 250,\n maxHeight: 700,\n top: 100\n },\n '<div style=\"padding: 20px;\">Window content goes here</div>',\n 300,\n 750\n )) as FloatingWindow;\n\n assert.instanceOf(window, FloatingWindow);\n expect(window.header).to.equal('Phone Simulator');\n expect(window.width).to.equal(250);\n expect(window.maxHeight).to.equal(700);\n expect(window.top).to.equal(100);\n\n // show the window for screenshot\n window.hidden = false;\n await window.updateComplete;\n expect(window.hidden).to.equal(false);\n\n // use custom clip for fixed positioned element\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const clip = {\n x: window.left,\n y: window.top,\n width: window.width,\n height: windowElement.offsetHeight\n };\n await assertScreenshot('floating-window/default', clip);\n });\n\n it('starts hidden by default', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test Window'\n },\n '<div>Content</div>'\n )) as FloatingWindow;\n\n expect(window.hidden).to.equal(true);\n expect(window.classList.contains('hidden')).to.equal(true);\n });\n\n it('can be shown and hidden', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test Window',\n hidden: true\n },\n '<div>Content</div>'\n )) as FloatingWindow;\n\n expect(window.hidden).to.equal(true);\n\n window.show();\n await window.updateComplete;\n expect(window.hidden).to.equal(false);\n expect(window.classList.contains('hidden')).to.equal(false);\n\n window.hide();\n await window.updateComplete;\n expect(window.hidden).to.equal(true);\n expect(window.classList.contains('hidden')).to.equal(true);\n });\n\n it('fires close event when close button clicked', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test Window'\n },\n '<div>Content</div>',\n 300,\n 750\n )) as FloatingWindow;\n\n // show the window first\n window.hidden = false;\n await window.updateComplete;\n\n let closed = false;\n window.addEventListener('temba-dialog-hidden', () => {\n closed = true;\n });\n\n const closeButton = window.shadowRoot.querySelector(\n '.close-button'\n ) as HTMLElement;\n expect(closeButton).to.exist;\n\n closeButton.click();\n await window.updateComplete;\n\n expect(closed).to.equal(true);\n expect(window.hidden).to.equal(true);\n });\n\n it('displays header correctly', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Phone Simulator'\n },\n '<div>Content</div>',\n 300,\n 400\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n const titleElement = window.shadowRoot.querySelector('.title');\n expect(titleElement).to.exist;\n expect(titleElement.textContent).to.equal('Phone Simulator');\n\n // use custom clip for fixed positioned element\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const clip = {\n x: window.left,\n y: window.top,\n width: window.width,\n height: windowElement.offsetHeight\n };\n await assertScreenshot('floating-window/with-header', clip);\n });\n\n it('renders slot content', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test'\n },\n '<div class=\"test-content\">Custom content</div>',\n 300,\n 400\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n const slotContent = window.querySelector('.test-content');\n expect(slotContent).to.exist;\n expect(slotContent.textContent).to.equal('Custom content');\n });\n\n it('supports custom dimensions', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Custom Size',\n width: 400,\n maxHeight: 600,\n top: 100,\n left: 100\n },\n '<div>Content</div>',\n 450,\n 650\n )) as FloatingWindow;\n\n window.show();\n await window.updateComplete;\n expect(window.width).to.equal(400);\n expect(window.maxHeight).to.equal(600);\n expect(window.top).to.equal(100);\n expect(window.left).to.equal(100);\n\n // use custom clip for fixed positioned element\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const clip = {\n x: window.left,\n y: window.top,\n width: window.width,\n height: windowElement.offsetHeight\n };\n\n await assertScreenshot('floating-window/custom-size', clip);\n });\n\n it('can be dragged by header', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Draggable Window',\n width: 250,\n maxHeight: 400,\n top: 100,\n left: 100\n },\n '<div>Content</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n const header = window.shadowRoot.querySelector('.header') as HTMLElement;\n expect(header).to.exist;\n\n // simulate drag by setting dragging state\n window.dragging = true;\n await window.updateComplete;\n\n const windowElement = window.shadowRoot.querySelector('.window');\n expect(windowElement.classList.contains('dragging')).to.equal(true);\n });\n\n it('respects viewport bounds when dragging', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Bounded Window',\n width: 250,\n maxHeight: 400,\n top: 100,\n left: 100\n },\n '<div style=\"height: 200px;\">Content with specific height</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n // get actual window height\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const actualHeight = windowElement.offsetHeight;\n\n // simulate dragging near bottom of viewport\n const viewportHeight = window.ownerDocument.defaultView.innerHeight;\n const maxAllowedTop = viewportHeight - actualHeight;\n\n // try to drag below the viewport\n window.top = viewportHeight + 100;\n await window.updateComplete;\n\n // the handleMouseMove should clamp this, but we'll test the logic exists\n expect(actualHeight).to.be.greaterThan(0);\n expect(maxAllowedTop).to.be.lessThan(viewportHeight);\n });\n\n it('maintains consistent starting position', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test',\n width: 250,\n maxHeight: 400,\n top: 100,\n left: 100\n },\n '<div>Content</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n // verify initial position matches properties\n expect(window.top).to.equal(100);\n expect(window.left).to.equal(100);\n\n // change position (simulating drag)\n window.top = 200;\n window.left = 200;\n await window.updateComplete;\n\n // hide and show\n window.hide();\n await window.updateComplete;\n window.show();\n await window.updateComplete;\n\n // position should remain at property values (100, 100) not dragged position\n expect(window.top).to.equal(100);\n expect(window.left).to.equal(100);\n });\n\n it('can disable chrome', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test',\n width: 250,\n maxHeight: 400,\n top: 100,\n left: 100,\n chromeless: true\n },\n '<div style=\"background: white; padding: 20px;\">Chromeless content</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n expect(window.chromeless).to.equal(true);\n\n window.hidden = false;\n await window.updateComplete;\n\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n expect(windowElement.classList.contains('chromeless')).to.equal(true);\n\n // header should not be rendered\n const header = window.shadowRoot.querySelector('.header');\n expect(header).to.not.exist;\n\n // body should have no padding\n const body = window.shadowRoot.querySelector('.body') as HTMLElement;\n const bodyStyles = getComputedStyle(body);\n expect(bodyStyles.padding).to.equal('0px');\n\n // use custom clip for fixed positioned element\n const clip = {\n x: window.left,\n y: window.top,\n width: window.width,\n height: windowElement.offsetHeight\n };\n await assertScreenshot('floating-window/chromeless', clip);\n });\n\n it('defaults to showing chrome', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test'\n },\n '<div>Content</div>'\n )) as FloatingWindow;\n\n expect(window.chromeless).to.equal(false);\n });\n\n it('can close via public close() method', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test',\n chromeless: true\n },\n '<div>Content</div>'\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n expect(window.hidden).to.equal(false);\n\n let eventFired = false;\n window.addEventListener('temba-dialog-hidden', () => {\n eventFired = true;\n });\n\n // call public close() method\n window.close();\n await window.updateComplete;\n\n expect(window.hidden).to.equal(true);\n expect(eventFired).to.equal(true);\n });\n\n it('chromeless window has no borders or shadows', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Test',\n width: 250,\n maxHeight: 400,\n chromeless: true\n },\n '<div>Content</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const styles = getComputedStyle(windowElement);\n\n expect(styles.boxShadow).to.equal('none');\n expect(styles.borderRadius).to.equal('0px');\n expect(styles.background.includes('rgba(0, 0, 0, 0)')).to.be.true;\n });\n\n it('supports min and max height constraints', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Min/Max Test',\n width: 300,\n minHeight: 200,\n maxHeight: 500\n },\n '<div style=\"padding: 20px;\">Content that can vary in height</div>',\n 350,\n 550\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n expect(window.minHeight).to.equal(200);\n expect(window.maxHeight).to.equal(500);\n\n // verify the styles are applied\n const windowElement = window.shadowRoot.querySelector(\n '.window'\n ) as HTMLElement;\n const styles = getComputedStyle(windowElement);\n expect(styles.minHeight).to.equal('200px');\n expect(styles.maxHeight).to.equal('500px');\n });\n\n it('stays on screen when browser is resized', async () => {\n const window = (await getComponent(\n 'temba-floating-window',\n {\n header: 'Resize Test',\n width: 250,\n maxHeight: 400,\n top: 100,\n left: 100\n },\n '<div style=\"height: 200px;\">Content</div>',\n 300,\n 450\n )) as FloatingWindow;\n\n window.hidden = false;\n await window.updateComplete;\n\n // position window near right edge\n const originalViewportWidth = window.ownerDocument.defaultView.innerWidth;\n window.left = originalViewportWidth - window.width - 30;\n await window.updateComplete;\n\n // simulate window resize event (the component should constrain position)\n window.dispatchEvent(new Event('resize', { bubbles: true }));\n await window.updateComplete;\n\n // window should still be within viewport bounds with 20px padding\n const padding = 20;\n expect(window.left).to.be.at.least(padding);\n expect(window.left).to.be.at.most(\n window.ownerDocument.defaultView.innerWidth - window.width - padding\n );\n expect(window.top).to.be.at.least(padding);\n });\n});\n"]}
|
|
@@ -1014,5 +1014,122 @@ describe('EditorNode', () => {
|
|
|
1014
1014
|
expect(rendered).to.exist;
|
|
1015
1015
|
});
|
|
1016
1016
|
});
|
|
1017
|
+
describe('router section graying', () => {
|
|
1018
|
+
it('grays out split nodes when categories not included in translation', async () => {
|
|
1019
|
+
const mockNode = {
|
|
1020
|
+
uuid: 'split-node-1',
|
|
1021
|
+
actions: [],
|
|
1022
|
+
exits: [
|
|
1023
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
1024
|
+
{ uuid: 'exit-2', destination_uuid: null }
|
|
1025
|
+
],
|
|
1026
|
+
router: {
|
|
1027
|
+
type: 'switch',
|
|
1028
|
+
result_name: 'Response',
|
|
1029
|
+
categories: [
|
|
1030
|
+
{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },
|
|
1031
|
+
{ uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }
|
|
1032
|
+
]
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
const mockUI = {
|
|
1036
|
+
position: { left: 0, top: 0 },
|
|
1037
|
+
type: 'split_by_groups'
|
|
1038
|
+
};
|
|
1039
|
+
// Create node
|
|
1040
|
+
const editorNode = await fixture(html `<temba-flow-node
|
|
1041
|
+
.node=${mockNode}
|
|
1042
|
+
.ui=${mockUI}
|
|
1043
|
+
></temba-flow-node>`);
|
|
1044
|
+
// Set fromStore properties directly
|
|
1045
|
+
editorNode.isTranslating = true;
|
|
1046
|
+
editorNode.includeCategoriesInTranslation = false;
|
|
1047
|
+
editorNode.languageCode = 'spa';
|
|
1048
|
+
// Force re-render
|
|
1049
|
+
editorNode.requestUpdate('isTranslating');
|
|
1050
|
+
editorNode.requestUpdate('includeCategoriesInTranslation');
|
|
1051
|
+
await editorNode.updateComplete;
|
|
1052
|
+
// Find the node element
|
|
1053
|
+
const nodeElement = editorNode.querySelector('.node');
|
|
1054
|
+
expect(nodeElement).to.exist;
|
|
1055
|
+
// Verify it has the non-localizable class
|
|
1056
|
+
expect(nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.classList.contains('non-localizable')).to.be.true;
|
|
1057
|
+
});
|
|
1058
|
+
it('does not gray out split nodes when categories are included in translation', async () => {
|
|
1059
|
+
const mockNode = {
|
|
1060
|
+
uuid: 'split-node-2',
|
|
1061
|
+
actions: [],
|
|
1062
|
+
exits: [
|
|
1063
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
1064
|
+
{ uuid: 'exit-2', destination_uuid: null }
|
|
1065
|
+
],
|
|
1066
|
+
router: {
|
|
1067
|
+
type: 'switch',
|
|
1068
|
+
result_name: 'Response',
|
|
1069
|
+
categories: [
|
|
1070
|
+
{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },
|
|
1071
|
+
{ uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }
|
|
1072
|
+
]
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
const mockUI = {
|
|
1076
|
+
position: { left: 0, top: 0 },
|
|
1077
|
+
type: 'split_by_groups'
|
|
1078
|
+
};
|
|
1079
|
+
// Create node
|
|
1080
|
+
const editorNode = await fixture(html `<temba-flow-node
|
|
1081
|
+
.node=${mockNode}
|
|
1082
|
+
.ui=${mockUI}
|
|
1083
|
+
></temba-flow-node>`);
|
|
1084
|
+
// Set fromStore properties directly
|
|
1085
|
+
editorNode.isTranslating = true;
|
|
1086
|
+
editorNode.includeCategoriesInTranslation = true;
|
|
1087
|
+
editorNode.languageCode = 'spa';
|
|
1088
|
+
await editorNode.requestUpdate();
|
|
1089
|
+
await editorNode.updateComplete;
|
|
1090
|
+
// Find the node element
|
|
1091
|
+
const nodeElement = editorNode.querySelector('.node');
|
|
1092
|
+
expect(nodeElement).to.exist;
|
|
1093
|
+
// Verify it does NOT have the non-localizable class
|
|
1094
|
+
expect(nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.classList.contains('non-localizable')).to.be.false;
|
|
1095
|
+
});
|
|
1096
|
+
it('does not gray out split nodes when not translating', async () => {
|
|
1097
|
+
const mockNode = {
|
|
1098
|
+
uuid: 'split-node-3',
|
|
1099
|
+
actions: [],
|
|
1100
|
+
exits: [
|
|
1101
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
1102
|
+
{ uuid: 'exit-2', destination_uuid: null }
|
|
1103
|
+
],
|
|
1104
|
+
router: {
|
|
1105
|
+
type: 'switch',
|
|
1106
|
+
result_name: 'Response',
|
|
1107
|
+
categories: [
|
|
1108
|
+
{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' },
|
|
1109
|
+
{ uuid: 'cat-2', name: 'Category 2', exit_uuid: 'exit-2' }
|
|
1110
|
+
]
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
const mockUI = {
|
|
1114
|
+
position: { left: 0, top: 0 },
|
|
1115
|
+
type: 'split_by_groups'
|
|
1116
|
+
};
|
|
1117
|
+
// Create node
|
|
1118
|
+
const editorNode = await fixture(html `<temba-flow-node
|
|
1119
|
+
.node=${mockNode}
|
|
1120
|
+
.ui=${mockUI}
|
|
1121
|
+
></temba-flow-node>`);
|
|
1122
|
+
// Set fromStore properties directly
|
|
1123
|
+
editorNode.isTranslating = false;
|
|
1124
|
+
editorNode.languageCode = 'eng';
|
|
1125
|
+
await editorNode.requestUpdate();
|
|
1126
|
+
await editorNode.updateComplete;
|
|
1127
|
+
// Find the node element
|
|
1128
|
+
const nodeElement = editorNode.querySelector('.node');
|
|
1129
|
+
expect(nodeElement).to.exist;
|
|
1130
|
+
// Verify it does NOT have the non-localizable class
|
|
1131
|
+
expect(nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.classList.contains('non-localizable')).to.be.false;
|
|
1132
|
+
});
|
|
1133
|
+
});
|
|
1017
1134
|
});
|
|
1018
1135
|
//# sourceMappingURL=temba-flow-editor-node.test.js.map
|
|
@@ -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,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7B,IAAI,EAAE,mBAAmB;aAC1B,CAAC;YAEF,UAAU,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;YAC9B,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;YAE1B,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QAC5B,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\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"]}
|
|
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,U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AAC,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\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"]}
|