@nyaruka/temba-components 0.129.8 → 0.129.10
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 +37 -3
- package/demo/data/flows/sample-flow.json +186 -96
- package/demo/test-colorpicker.html +30 -0
- package/dist/temba-components.js +1126 -1111
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/events.js.map +1 -1
- package/out-tsc/src/excellent/helpers.js +2 -2
- package/out-tsc/src/excellent/helpers.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +25 -7
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +11 -1
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +133 -290
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/actions/add_input_labels.js +40 -0
- package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -1
- package/out-tsc/src/flow/actions/call_llm.js +56 -3
- package/out-tsc/src/flow/actions/call_llm.js.map +1 -1
- package/out-tsc/src/flow/actions/call_webhook.js +1 -1
- package/out-tsc/src/flow/actions/call_webhook.js.map +1 -1
- package/out-tsc/src/flow/actions/open_ticket.js +65 -3
- package/out-tsc/src/flow/actions/open_ticket.js.map +1 -1
- package/out-tsc/src/flow/actions/set_run_result.js +75 -0
- package/out-tsc/src/flow/actions/set_run_result.js.map +1 -1
- package/out-tsc/src/flow/config.js +4 -0
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +227 -0
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -0
- package/out-tsc/src/flow/nodes/split_by_ticket.js +18 -0
- package/out-tsc/src/flow/nodes/split_by_ticket.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_response.js +27 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/flow/types.js +0 -65
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +63 -117
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/BaseListEditor.js +4 -3
- package/out-tsc/src/form/BaseListEditor.js.map +1 -1
- package/out-tsc/src/form/Checkbox.js +77 -24
- package/out-tsc/src/form/Checkbox.js.map +1 -1
- package/out-tsc/src/form/ColorPicker.js +28 -40
- package/out-tsc/src/form/ColorPicker.js.map +1 -1
- package/out-tsc/src/form/Completion.js +44 -53
- package/out-tsc/src/form/Completion.js.map +1 -1
- package/out-tsc/src/form/Compose.js +7 -8
- package/out-tsc/src/form/Compose.js.map +1 -1
- package/out-tsc/src/form/ContactSearch.js +3 -4
- package/out-tsc/src/form/ContactSearch.js.map +1 -1
- package/out-tsc/src/form/DatePicker.js +29 -36
- package/out-tsc/src/form/DatePicker.js.map +1 -1
- package/out-tsc/src/form/{FormField.js → FieldElement.js} +81 -53
- package/out-tsc/src/form/FieldElement.js.map +1 -0
- package/out-tsc/src/form/FieldRenderer.js +306 -0
- package/out-tsc/src/form/FieldRenderer.js.map +1 -0
- package/out-tsc/src/form/ImagePicker.js +122 -126
- package/out-tsc/src/form/ImagePicker.js.map +1 -1
- package/out-tsc/src/form/KeyValueEditor.js +41 -37
- package/out-tsc/src/form/KeyValueEditor.js.map +1 -1
- package/out-tsc/src/form/MessageEditor.js +55 -63
- package/out-tsc/src/form/MessageEditor.js.map +1 -1
- package/out-tsc/src/form/TembaSlider.js +3 -3
- package/out-tsc/src/form/TembaSlider.js.map +1 -1
- package/out-tsc/src/form/TemplateEditor.js +3 -3
- package/out-tsc/src/form/TemplateEditor.js.map +1 -1
- package/out-tsc/src/form/TextInput.js +23 -27
- package/out-tsc/src/form/TextInput.js.map +1 -1
- package/out-tsc/src/form/select/Select.js +57 -35
- package/out-tsc/src/form/select/Select.js.map +1 -1
- package/out-tsc/src/form/select/UserSelect.js +8 -9
- package/out-tsc/src/form/select/UserSelect.js.map +1 -1
- package/out-tsc/src/form/select/WorkspaceSelect.js +7 -8
- package/out-tsc/src/form/select/WorkspaceSelect.js.map +1 -1
- package/out-tsc/src/live/ContactChat.js +62 -44
- package/out-tsc/src/live/ContactChat.js.map +1 -1
- package/out-tsc/src/live/ContactFieldEditor.js.map +1 -1
- package/out-tsc/src/markdown.js +13 -11
- package/out-tsc/src/markdown.js.map +1 -1
- package/out-tsc/temba-modules.js +3 -2
- package/out-tsc/temba-modules.js.map +1 -1
- package/out-tsc/test/ActionHelper.js +2 -0
- package/out-tsc/test/ActionHelper.js.map +1 -1
- package/out-tsc/test/NodeHelper.js +148 -0
- package/out-tsc/test/NodeHelper.js.map +1 -0
- package/out-tsc/test/actions/call_llm.test.js +103 -0
- package/out-tsc/test/actions/call_llm.test.js.map +1 -0
- package/out-tsc/test/nodes/split_by_llm_categorize.test.js +532 -0
- package/out-tsc/test/nodes/split_by_llm_categorize.test.js.map +1 -0
- package/out-tsc/test/nodes/split_by_random.test.js +150 -0
- package/out-tsc/test/nodes/split_by_random.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_digits.test.js +150 -0
- package/out-tsc/test/nodes/wait_for_digits.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_response.test.js +171 -0
- package/out-tsc/test/nodes/wait_for_response.test.js.map +1 -0
- package/out-tsc/test/temba-add-input-labels.test.js +70 -0
- package/out-tsc/test/temba-add-input-labels.test.js.map +1 -0
- package/out-tsc/test/temba-checkbox.test.js +16 -0
- package/out-tsc/test/temba-checkbox.test.js.map +1 -1
- package/out-tsc/test/temba-field-renderer.test.js +296 -0
- package/out-tsc/test/temba-field-renderer.test.js.map +1 -0
- package/out-tsc/test/temba-integration-markdown.test.js +2 -4
- package/out-tsc/test/temba-integration-markdown.test.js.map +1 -1
- package/out-tsc/test/temba-markdown.test.js +1 -1
- package/out-tsc/test/temba-markdown.test.js.map +1 -1
- package/out-tsc/test/temba-node-editor.test.js +400 -0
- package/out-tsc/test/temba-node-editor.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +6 -3
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/temba-slider.test.js +0 -1
- package/out-tsc/test/temba-slider.test.js.map +1 -1
- package/out-tsc/test/temba-webchat.test.js +1 -1
- package/out-tsc/test/temba-webchat.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/information-extraction.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/sentiment-analysis.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/summarization.png +0 -0
- package/screenshots/truth/actions/call_llm/editor/translation-task.png +0 -0
- package/screenshots/truth/actions/call_llm/render/information-extraction.png +0 -0
- package/screenshots/truth/actions/call_llm/render/sentiment-analysis.png +0 -0
- package/screenshots/truth/actions/call_llm/render/summarization.png +0 -0
- package/screenshots/truth/actions/call_llm/render/translation-task.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/editor/single-group.png +0 -0
- package/screenshots/truth/actions/send_email/editor/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
- package/screenshots/truth/checkbox/checkbox-label-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-no-label-no-background-hover.png +0 -0
- package/screenshots/truth/checkbox/checkbox-with-help-text.png +0 -0
- package/screenshots/truth/checkbox/checked.png +0 -0
- package/screenshots/truth/checkbox/default.png +0 -0
- package/screenshots/truth/colorpicker/default.png +0 -0
- package/screenshots/truth/colorpicker/focused.png +0 -0
- package/screenshots/truth/colorpicker/initialized.png +0 -0
- package/screenshots/truth/colorpicker/selected.png +0 -0
- package/screenshots/truth/editor/router.png +0 -0
- package/screenshots/truth/editor/send_msg.png +0 -0
- package/screenshots/truth/editor/set_contact_language.png +0 -0
- package/screenshots/truth/editor/set_contact_name.png +0 -0
- package/screenshots/truth/editor/set_run_result.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-checked.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-unchecked.png +0 -0
- package/screenshots/truth/field-renderer/checkbox-with-errors.png +0 -0
- package/screenshots/truth/field-renderer/context-comparison.png +0 -0
- package/screenshots/truth/field-renderer/key-value-with-label.png +0 -0
- package/screenshots/truth/field-renderer/message-editor-with-label.png +0 -0
- package/screenshots/truth/field-renderer/select-multi.png +0 -0
- package/screenshots/truth/field-renderer/select-no-label.png +0 -0
- package/screenshots/truth/field-renderer/select-with-label.png +0 -0
- package/screenshots/truth/field-renderer/text-evaluated.png +0 -0
- package/screenshots/truth/field-renderer/text-no-label.png +0 -0
- package/screenshots/truth/field-renderer/text-with-errors.png +0 -0
- package/screenshots/truth/field-renderer/text-with-label.png +0 -0
- package/screenshots/truth/field-renderer/textarea-evaluated.png +0 -0
- package/screenshots/truth/field-renderer/textarea-with-label.png +0 -0
- package/screenshots/truth/integration/checkbox-markdown-errors.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/verification-code.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/verification-code.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/short-timeout.png +0 -0
- package/screenshots/truth/omnibox/selected.png +0 -0
- package/screenshots/truth/run-list/basic.png +0 -0
- package/screenshots/truth/select/functions.png +0 -0
- package/screenshots/truth/select/multi-with-endpoint.png +0 -0
- package/screenshots/truth/select/search-enabled.png +0 -0
- package/src/events.ts +12 -6
- package/src/excellent/helpers.ts +2 -2
- package/src/flow/CanvasNode.ts +22 -1
- package/src/flow/Editor.ts +12 -1
- package/src/flow/NodeEditor.ts +186 -374
- package/src/flow/actions/add_input_labels.ts +45 -0
- package/src/flow/actions/call_llm.ts +57 -3
- package/src/flow/actions/call_webhook.ts +1 -1
- package/src/flow/actions/open_ticket.ts +74 -3
- package/src/flow/actions/set_run_result.ts +83 -0
- package/src/flow/config.ts +4 -0
- package/src/flow/nodes/split_by_llm_categorize.ts +277 -0
- package/src/flow/nodes/split_by_ticket.ts +19 -0
- package/src/flow/nodes/wait_for_response.ts +28 -1
- package/src/flow/types.ts +26 -127
- package/src/form/ArrayEditor.ts +79 -139
- package/src/form/BaseListEditor.ts +4 -4
- package/src/form/Checkbox.ts +81 -24
- package/src/form/ColorPicker.ts +31 -43
- package/src/form/Completion.ts +49 -56
- package/src/form/Compose.ts +8 -8
- package/src/form/ContactSearch.ts +3 -4
- package/src/form/DatePicker.ts +32 -38
- package/src/form/{FormField.ts → FieldElement.ts} +108 -55
- package/src/form/FieldRenderer.ts +466 -0
- package/src/form/ImagePicker.ts +107 -110
- package/src/form/KeyValueEditor.ts +43 -39
- package/src/form/MessageEditor.ts +61 -67
- package/src/form/TembaSlider.ts +3 -3
- package/src/form/TemplateEditor.ts +3 -3
- package/src/form/TextInput.ts +26 -29
- package/src/form/select/Select.ts +63 -37
- package/src/form/select/UserSelect.ts +10 -11
- package/src/form/select/WorkspaceSelect.ts +9 -10
- package/src/live/ContactChat.ts +62 -47
- package/src/live/ContactFieldEditor.ts +2 -2
- package/src/markdown.ts +19 -11
- package/src/store/flow-definition.d.ts +5 -2
- package/static/api/labels.json +31 -0
- package/static/api/topics.json +24 -9
- package/static/api/users.json +35 -16
- package/static/css/temba-components.css +3 -3
- package/stress-test.js +18 -13
- package/temba-modules.ts +3 -2
- package/test/ActionHelper.ts +2 -0
- package/test/NodeHelper.ts +184 -0
- package/test/actions/call_llm.test.ts +137 -0
- package/test/nodes/README.md +78 -0
- package/test/nodes/split_by_llm_categorize.test.ts +698 -0
- package/test/nodes/split_by_random.test.ts +177 -0
- package/test/nodes/wait_for_digits.test.ts +176 -0
- package/test/nodes/wait_for_response.test.ts +206 -0
- package/test/temba-add-input-labels.test.ts +87 -0
- package/test/temba-checkbox.test.ts +26 -0
- package/test/temba-field-renderer.test.ts +482 -0
- package/test/temba-integration-markdown.test.ts +2 -4
- package/test/temba-markdown.test.ts +1 -1
- package/test/temba-node-editor.test.ts +496 -0
- package/test/temba-select.test.ts +6 -6
- package/test/temba-slider.test.ts +0 -1
- package/test/temba-webchat.test.ts +1 -1
- package/test-assets/contacts/history.json +7 -20
- package/test-assets/select/llms.json +18 -0
- package/web-dev-mock.mjs +96 -6
- package/web-dev-server.config.mjs +29 -7
- package/out-tsc/src/form/FormElement.js +0 -67
- package/out-tsc/src/form/FormElement.js.map +0 -1
- package/out-tsc/src/form/FormField.js.map +0 -1
- package/out-tsc/test/temba-formfield.test.js +0 -94
- package/out-tsc/test/temba-formfield.test.js.map +0 -1
- package/src/form/FormElement.ts +0 -69
- package/test/temba-flow-editor.test.ts.backup +0 -563
- package/test/temba-formfield.test.ts +0 -121
- package/test/temba-utils-index.test.ts.backup +0 -1737
|
@@ -350,5 +350,405 @@ describe('temba-node-editor', () => {
|
|
|
350
350
|
// Should have arrows for collapsible groups
|
|
351
351
|
expect(arrows.length).to.be.greaterThan(0);
|
|
352
352
|
});
|
|
353
|
+
it('renders split_by_llm_categorize node', async () => {
|
|
354
|
+
const node = {
|
|
355
|
+
uuid: 'test-node-uuid',
|
|
356
|
+
actions: [
|
|
357
|
+
{
|
|
358
|
+
uuid: 'call-llm-uuid',
|
|
359
|
+
type: 'call_llm',
|
|
360
|
+
llm: { uuid: 'llm-123', name: 'Test LLM' },
|
|
361
|
+
input: '@input',
|
|
362
|
+
instructions: '@(prompt("categorize", slice(node.categories, 0, -2)))',
|
|
363
|
+
output_local: '_llm_output'
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
router: {
|
|
367
|
+
type: 'switch',
|
|
368
|
+
operand: '@locals._llm_output',
|
|
369
|
+
result_name: 'Intent',
|
|
370
|
+
categories: [
|
|
371
|
+
{ uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },
|
|
372
|
+
{ uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },
|
|
373
|
+
{ uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },
|
|
374
|
+
{ uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }
|
|
375
|
+
]
|
|
376
|
+
},
|
|
377
|
+
exits: [
|
|
378
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
379
|
+
{ uuid: 'exit-2', destination_uuid: null },
|
|
380
|
+
{ uuid: 'exit-3', destination_uuid: null },
|
|
381
|
+
{ uuid: 'exit-4', destination_uuid: null }
|
|
382
|
+
]
|
|
383
|
+
};
|
|
384
|
+
const nodeUI = { type: 'split_by_llm_categorize' };
|
|
385
|
+
const el = (await fixture(html `
|
|
386
|
+
<temba-node-editor
|
|
387
|
+
.node=${node}
|
|
388
|
+
.nodeUI=${nodeUI}
|
|
389
|
+
.isOpen=${true}
|
|
390
|
+
></temba-node-editor>
|
|
391
|
+
`));
|
|
392
|
+
await el.updateComplete;
|
|
393
|
+
expect(el.shadowRoot).to.not.be.null;
|
|
394
|
+
expect(el.node).to.equal(node);
|
|
395
|
+
expect(el.nodeUI).to.equal(nodeUI);
|
|
396
|
+
// Wait for form data initialization
|
|
397
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
398
|
+
await el.updateComplete;
|
|
399
|
+
// Check if the dialog is rendered with correct header
|
|
400
|
+
const dialog = el.shadowRoot.querySelector('temba-dialog');
|
|
401
|
+
expect(dialog).to.not.be.null;
|
|
402
|
+
expect(dialog.getAttribute('header')).to.equal('Split by AI');
|
|
403
|
+
// Check that the form is rendered
|
|
404
|
+
const form = el.shadowRoot.querySelector('.node-editor-form');
|
|
405
|
+
expect(form).to.not.be.null;
|
|
406
|
+
// Check that all expected form components are rendered
|
|
407
|
+
const selectComponents = el.shadowRoot.querySelectorAll('temba-select');
|
|
408
|
+
const arrayComponents = el.shadowRoot.querySelectorAll('temba-array-editor');
|
|
409
|
+
const completionComponents = el.shadowRoot.querySelectorAll('temba-completion');
|
|
410
|
+
// Should have LLM select field
|
|
411
|
+
expect(selectComponents.length).to.equal(1);
|
|
412
|
+
expect(selectComponents[0].getAttribute('label')).to.equal('LLM');
|
|
413
|
+
// Should have input completion field
|
|
414
|
+
expect(completionComponents.length).to.equal(1);
|
|
415
|
+
expect(completionComponents[0].getAttribute('label')).to.equal('Input');
|
|
416
|
+
// Should have categories array editor
|
|
417
|
+
expect(arrayComponents.length).to.equal(1);
|
|
418
|
+
});
|
|
419
|
+
it('renders wait_for_response node', async () => {
|
|
420
|
+
const node = {
|
|
421
|
+
uuid: 'test-wait-node-uuid',
|
|
422
|
+
actions: [],
|
|
423
|
+
router: {
|
|
424
|
+
type: 'switch',
|
|
425
|
+
wait: {
|
|
426
|
+
type: 'msg',
|
|
427
|
+
timeout: 300 // 5 minutes in seconds
|
|
428
|
+
},
|
|
429
|
+
result_name: 'response',
|
|
430
|
+
categories: []
|
|
431
|
+
},
|
|
432
|
+
exits: []
|
|
433
|
+
};
|
|
434
|
+
const nodeUI = { type: 'wait_for_response' };
|
|
435
|
+
const el = (await fixture(html `
|
|
436
|
+
<temba-node-editor
|
|
437
|
+
.node=${node}
|
|
438
|
+
.nodeUI=${nodeUI}
|
|
439
|
+
.isOpen=${true}
|
|
440
|
+
></temba-node-editor>
|
|
441
|
+
`));
|
|
442
|
+
await el.updateComplete;
|
|
443
|
+
// Wait for form data initialization
|
|
444
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
445
|
+
await el.updateComplete;
|
|
446
|
+
// Check that the dialog is rendered with correct header
|
|
447
|
+
const dialog = el.shadowRoot.querySelector('temba-dialog');
|
|
448
|
+
expect(dialog).to.not.be.null;
|
|
449
|
+
expect(dialog.getAttribute('header')).to.equal('Wait for Response');
|
|
450
|
+
// Check that timeout and result name fields are rendered
|
|
451
|
+
const textComponents = el.shadowRoot.querySelectorAll('temba-textinput');
|
|
452
|
+
expect(textComponents.length).to.equal(1);
|
|
453
|
+
// Verify the field labels
|
|
454
|
+
const labels = Array.from(textComponents).map((comp) => comp.getAttribute('label'));
|
|
455
|
+
expect(labels).to.include('Result Name');
|
|
456
|
+
});
|
|
457
|
+
it('prioritizes node config over action config for non-execute_actions nodes', async () => {
|
|
458
|
+
// Create a split_by_llm_categorize node that has both actions and should use node config
|
|
459
|
+
const node = {
|
|
460
|
+
uuid: 'test-node-uuid',
|
|
461
|
+
actions: [
|
|
462
|
+
{
|
|
463
|
+
uuid: 'call-llm-uuid',
|
|
464
|
+
type: 'call_llm',
|
|
465
|
+
llm: { uuid: 'llm-123', name: 'Test LLM' },
|
|
466
|
+
input: '@input',
|
|
467
|
+
instructions: '@(prompt("categorize", slice(node.categories, 0, -2)))',
|
|
468
|
+
output_local: '_llm_output'
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
router: {
|
|
472
|
+
type: 'switch',
|
|
473
|
+
operand: '@locals._llm_output',
|
|
474
|
+
result_name: 'Intent',
|
|
475
|
+
categories: [
|
|
476
|
+
{ uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },
|
|
477
|
+
{ uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' }
|
|
478
|
+
]
|
|
479
|
+
},
|
|
480
|
+
exits: [
|
|
481
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
482
|
+
{ uuid: 'exit-2', destination_uuid: null }
|
|
483
|
+
]
|
|
484
|
+
};
|
|
485
|
+
const nodeUI = { type: 'split_by_llm_categorize' };
|
|
486
|
+
// Simulate having both node and action set (which happens when editing from flow)
|
|
487
|
+
const el = (await fixture(html `
|
|
488
|
+
<temba-node-editor
|
|
489
|
+
.node=${node}
|
|
490
|
+
.nodeUI=${nodeUI}
|
|
491
|
+
.action=${node.actions[0]}
|
|
492
|
+
.isOpen=${true}
|
|
493
|
+
>
|
|
494
|
+
</temba-node-editor>
|
|
495
|
+
`));
|
|
496
|
+
await el.updateComplete;
|
|
497
|
+
// Wait for form data initialization
|
|
498
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
499
|
+
await el.updateComplete;
|
|
500
|
+
// Should show node editor (Split by AI Categorize), not action editor (Call LLM)
|
|
501
|
+
const dialog = el.shadowRoot.querySelector('temba-dialog');
|
|
502
|
+
expect(dialog.getAttribute('header')).to.equal('Split by AI');
|
|
503
|
+
// Should have node config fields (LLM, Input, Categories, Result Name)
|
|
504
|
+
const selectComponents = el.shadowRoot.querySelectorAll('temba-select');
|
|
505
|
+
const arrayComponents = el.shadowRoot.querySelectorAll('temba-array-editor');
|
|
506
|
+
// Should have LLM select and categories array (node config fields)
|
|
507
|
+
expect(selectComponents.length).to.equal(1);
|
|
508
|
+
expect(arrayComponents.length).to.equal(1);
|
|
509
|
+
});
|
|
510
|
+
it('initializes categories correctly for split_by_llm_categorize', async () => {
|
|
511
|
+
var _a;
|
|
512
|
+
const node = {
|
|
513
|
+
uuid: 'test-node-uuid',
|
|
514
|
+
actions: [
|
|
515
|
+
{
|
|
516
|
+
uuid: 'call-llm-uuid',
|
|
517
|
+
type: 'call_llm',
|
|
518
|
+
llm: { uuid: 'llm-123', name: 'Test LLM' },
|
|
519
|
+
input: '@input',
|
|
520
|
+
instructions: '@(prompt("categorize", slice(node.categories, 0, -2)))',
|
|
521
|
+
output_local: '_llm_output'
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
router: {
|
|
525
|
+
type: 'switch',
|
|
526
|
+
operand: '@locals._llm_output',
|
|
527
|
+
result_name: 'Intent',
|
|
528
|
+
categories: [
|
|
529
|
+
{ uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },
|
|
530
|
+
{ uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },
|
|
531
|
+
{ uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },
|
|
532
|
+
{ uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }
|
|
533
|
+
]
|
|
534
|
+
},
|
|
535
|
+
exits: [
|
|
536
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
537
|
+
{ uuid: 'exit-2', destination_uuid: null },
|
|
538
|
+
{ uuid: 'exit-3', destination_uuid: null },
|
|
539
|
+
{ uuid: 'exit-4', destination_uuid: null }
|
|
540
|
+
]
|
|
541
|
+
};
|
|
542
|
+
const nodeUI = { type: 'split_by_llm_categorize' };
|
|
543
|
+
const el = (await fixture(html `
|
|
544
|
+
<temba-node-editor
|
|
545
|
+
.node=${node}
|
|
546
|
+
.nodeUI=${nodeUI}
|
|
547
|
+
.isOpen=${true}
|
|
548
|
+
></temba-node-editor>
|
|
549
|
+
`));
|
|
550
|
+
await el.updateComplete;
|
|
551
|
+
// Wait for form data initialization
|
|
552
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
553
|
+
await el.updateComplete;
|
|
554
|
+
// Access the component's formData directly to check initialization
|
|
555
|
+
const formData = el.formData;
|
|
556
|
+
// Should have 2 categories (Greeting and Question, excluding Other and Failure)
|
|
557
|
+
expect(formData.categories).to.be.an('array');
|
|
558
|
+
expect(formData.categories.length).to.equal(2);
|
|
559
|
+
expect(formData.categories[0].name).to.equal('Greeting');
|
|
560
|
+
expect(formData.categories[1].name).to.equal('Question');
|
|
561
|
+
// Check that the array editor component receives the correct value
|
|
562
|
+
const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');
|
|
563
|
+
expect(arrayEditor).to.not.be.null;
|
|
564
|
+
// Wait a bit more for the array editor to fully render
|
|
565
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
566
|
+
await el.updateComplete;
|
|
567
|
+
// Check the values of the textinput components within the array items
|
|
568
|
+
const textInputs = (_a = arrayEditor.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('temba-textinput');
|
|
569
|
+
if (textInputs && textInputs.length >= 2) {
|
|
570
|
+
// The first two textinputs should have the category names
|
|
571
|
+
expect(textInputs[0].value).to.equal('Greeting');
|
|
572
|
+
expect(textInputs[1].value).to.equal('Question');
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
it('properly initializes categories when node is set after component creation', async () => {
|
|
576
|
+
var _a;
|
|
577
|
+
// First create the component without any data
|
|
578
|
+
const el = (await fixture(html `
|
|
579
|
+
<temba-node-editor .isOpen=${false}></temba-node-editor>
|
|
580
|
+
`));
|
|
581
|
+
await el.updateComplete;
|
|
582
|
+
// Then set the node data (simulating real usage)
|
|
583
|
+
const node = {
|
|
584
|
+
uuid: 'test-node-uuid',
|
|
585
|
+
actions: [
|
|
586
|
+
{
|
|
587
|
+
uuid: 'call-llm-uuid',
|
|
588
|
+
type: 'call_llm',
|
|
589
|
+
llm: { uuid: 'llm-123', name: 'Test LLM' },
|
|
590
|
+
input: '@input',
|
|
591
|
+
instructions: '@(prompt("categorize", slice(node.categories, 0, -2)))',
|
|
592
|
+
output_local: '_llm_output'
|
|
593
|
+
}
|
|
594
|
+
],
|
|
595
|
+
router: {
|
|
596
|
+
type: 'switch',
|
|
597
|
+
operand: '@locals._llm_output',
|
|
598
|
+
result_name: 'Intent',
|
|
599
|
+
categories: [
|
|
600
|
+
{ uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },
|
|
601
|
+
{ uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },
|
|
602
|
+
{ uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },
|
|
603
|
+
{ uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
exits: [
|
|
607
|
+
{ uuid: 'exit-1', destination_uuid: null },
|
|
608
|
+
{ uuid: 'exit-2', destination_uuid: null },
|
|
609
|
+
{ uuid: 'exit-3', destination_uuid: null },
|
|
610
|
+
{ uuid: 'exit-4', destination_uuid: null }
|
|
611
|
+
]
|
|
612
|
+
};
|
|
613
|
+
const nodeUI = { type: 'split_by_llm_categorize' };
|
|
614
|
+
// Set the properties (this should trigger updated() and openDialog())
|
|
615
|
+
el.node = node;
|
|
616
|
+
el.nodeUI = nodeUI;
|
|
617
|
+
await el.updateComplete;
|
|
618
|
+
// Wait for dialog to open and form data to initialize
|
|
619
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
620
|
+
await el.updateComplete;
|
|
621
|
+
// Check that the form data is properly initialized
|
|
622
|
+
const formData = el.formData;
|
|
623
|
+
expect(formData.categories).to.be.an('array');
|
|
624
|
+
expect(formData.categories.length).to.equal(2);
|
|
625
|
+
expect(formData.categories[0].name).to.equal('Greeting');
|
|
626
|
+
expect(formData.categories[1].name).to.equal('Question');
|
|
627
|
+
// Check that array editor gets the correct values
|
|
628
|
+
const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');
|
|
629
|
+
expect(arrayEditor).to.not.be.null;
|
|
630
|
+
const textInputs = (_a = arrayEditor.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('temba-textinput');
|
|
631
|
+
if (textInputs && textInputs.length >= 2) {
|
|
632
|
+
expect(textInputs[0].value).to.equal('Greeting');
|
|
633
|
+
expect(textInputs[1].value).to.equal('Question');
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
it('preserves UUIDs for unchanged categories in split_by_llm_categorize', async () => {
|
|
637
|
+
const originalNode = {
|
|
638
|
+
uuid: 'test-node-uuid',
|
|
639
|
+
actions: [
|
|
640
|
+
{
|
|
641
|
+
uuid: 'existing-call-llm-uuid',
|
|
642
|
+
type: 'call_llm',
|
|
643
|
+
llm: { uuid: 'llm-123', name: 'Test LLM' },
|
|
644
|
+
input: '@input',
|
|
645
|
+
instructions: '@(prompt("categorize", slice(node.categories, 0, -2)))',
|
|
646
|
+
output_local: '_llm_output'
|
|
647
|
+
}
|
|
648
|
+
],
|
|
649
|
+
router: {
|
|
650
|
+
type: 'switch',
|
|
651
|
+
operand: '@locals._llm_output',
|
|
652
|
+
result_name: 'Intent',
|
|
653
|
+
categories: [
|
|
654
|
+
{
|
|
655
|
+
uuid: 'existing-cat-1',
|
|
656
|
+
name: 'Greeting',
|
|
657
|
+
exit_uuid: 'existing-exit-1'
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
uuid: 'existing-cat-2',
|
|
661
|
+
name: 'Question',
|
|
662
|
+
exit_uuid: 'existing-exit-2'
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
uuid: 'existing-cat-other',
|
|
666
|
+
name: 'Other',
|
|
667
|
+
exit_uuid: 'existing-exit-other'
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
uuid: 'existing-cat-failure',
|
|
671
|
+
name: 'Failure',
|
|
672
|
+
exit_uuid: 'existing-exit-failure'
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
cases: [
|
|
676
|
+
{
|
|
677
|
+
uuid: 'existing-case-1',
|
|
678
|
+
type: 'has_only_text',
|
|
679
|
+
arguments: ['Greeting'],
|
|
680
|
+
category_uuid: 'existing-cat-1'
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
uuid: 'existing-case-2',
|
|
684
|
+
type: 'has_only_text',
|
|
685
|
+
arguments: ['Question'],
|
|
686
|
+
category_uuid: 'existing-cat-2'
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
uuid: 'existing-case-error',
|
|
690
|
+
type: 'has_only_text',
|
|
691
|
+
arguments: ['<ERROR>'],
|
|
692
|
+
category_uuid: 'existing-cat-failure'
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
},
|
|
696
|
+
exits: [
|
|
697
|
+
{ uuid: 'existing-exit-1', destination_uuid: 'some-destination-1' },
|
|
698
|
+
{ uuid: 'existing-exit-2', destination_uuid: 'some-destination-2' },
|
|
699
|
+
{ uuid: 'existing-exit-other', destination_uuid: null },
|
|
700
|
+
{ uuid: 'existing-exit-failure', destination_uuid: null }
|
|
701
|
+
]
|
|
702
|
+
};
|
|
703
|
+
// Import the node config to test fromFormData directly
|
|
704
|
+
const { split_by_llm_categorize } = await import('../src/flow/nodes/split_by_llm_categorize');
|
|
705
|
+
// Test with same categories - should preserve UUIDs
|
|
706
|
+
const formDataSame = {
|
|
707
|
+
llm: [{ value: 'llm-123', name: 'Test LLM' }],
|
|
708
|
+
input: '@input',
|
|
709
|
+
categories: [{ name: 'Greeting' }, { name: 'Question' }],
|
|
710
|
+
result_name: 'Intent'
|
|
711
|
+
};
|
|
712
|
+
const resultSame = split_by_llm_categorize.fromFormData(formDataSame, originalNode);
|
|
713
|
+
// Should preserve existing UUIDs for unchanged categories
|
|
714
|
+
expect(resultSame.actions[0].uuid).to.equal('existing-call-llm-uuid');
|
|
715
|
+
const greetingCategory = resultSame.router.categories.find((cat) => cat.name === 'Greeting');
|
|
716
|
+
const questionCategory = resultSame.router.categories.find((cat) => cat.name === 'Question');
|
|
717
|
+
const otherCategory = resultSame.router.categories.find((cat) => cat.name === 'Other');
|
|
718
|
+
const failureCategory = resultSame.router.categories.find((cat) => cat.name === 'Failure');
|
|
719
|
+
expect(greetingCategory.uuid).to.equal('existing-cat-1');
|
|
720
|
+
expect(greetingCategory.exit_uuid).to.equal('existing-exit-1');
|
|
721
|
+
expect(questionCategory.uuid).to.equal('existing-cat-2');
|
|
722
|
+
expect(questionCategory.exit_uuid).to.equal('existing-exit-2');
|
|
723
|
+
expect(otherCategory.uuid).to.equal('existing-cat-other');
|
|
724
|
+
expect(failureCategory.uuid).to.equal('existing-cat-failure');
|
|
725
|
+
// Should preserve destination UUIDs for exits
|
|
726
|
+
const greetingExit = resultSame.exits.find((exit) => exit.uuid === 'existing-exit-1');
|
|
727
|
+
const questionExit = resultSame.exits.find((exit) => exit.uuid === 'existing-exit-2');
|
|
728
|
+
expect(greetingExit.destination_uuid).to.equal('some-destination-1');
|
|
729
|
+
expect(questionExit.destination_uuid).to.equal('some-destination-2');
|
|
730
|
+
// Test with changed categories - should generate new UUIDs for new categories
|
|
731
|
+
const formDataChanged = {
|
|
732
|
+
llm: [{ value: 'llm-123', name: 'Test LLM' }],
|
|
733
|
+
input: '@input',
|
|
734
|
+
categories: [
|
|
735
|
+
{ name: 'Greeting' }, // unchanged - should keep UUID
|
|
736
|
+
{ name: 'NewCategory' } // new - should get new UUID
|
|
737
|
+
],
|
|
738
|
+
result_name: 'Intent'
|
|
739
|
+
};
|
|
740
|
+
const resultChanged = split_by_llm_categorize.fromFormData(formDataChanged, originalNode);
|
|
741
|
+
const greetingCategoryChanged = resultChanged.router.categories.find((cat) => cat.name === 'Greeting');
|
|
742
|
+
const newCategory = resultChanged.router.categories.find((cat) => cat.name === 'NewCategory');
|
|
743
|
+
// Greeting should keep its existing UUID
|
|
744
|
+
expect(greetingCategoryChanged.uuid).to.equal('existing-cat-1');
|
|
745
|
+
expect(greetingCategoryChanged.exit_uuid).to.equal('existing-exit-1');
|
|
746
|
+
// NewCategory should get a new UUID (not one of the existing ones)
|
|
747
|
+
expect(newCategory.uuid).to.not.equal('existing-cat-1');
|
|
748
|
+
expect(newCategory.uuid).to.not.equal('existing-cat-2');
|
|
749
|
+
expect(newCategory.uuid).to.not.equal('existing-cat-other');
|
|
750
|
+
expect(newCategory.uuid).to.not.equal('existing-cat-failure');
|
|
751
|
+
expect(newCategory.uuid).to.have.length.greaterThan(0);
|
|
752
|
+
});
|
|
353
753
|
});
|
|
354
754
|
//# sourceMappingURL=temba-node-editor.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temba-node-editor.test.js","sourceRoot":"","sources":["../../test/temba-node-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAWzD,MAAM,sBAAsB,GAAG,KAAK,EAClC,EAAqB,EACrB,cAAsB,EACtB,EAAE;IACF,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU;SACzB,aAAa,CAAC,cAAc,CAAC;SAC7B,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAgB,CAAC;IAChE,MAAM,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA;mCACC,IAAI;KAClC,CAAC,CAAsB,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,mBAA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,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QACzD,MAAM,EAAE,CAAC,cAAc,CAAC;QAExB,qDAAqD;QACrD,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;QACjC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;QAEjE,2CAA2C;QAC3C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEnC,4CAA4C;QAC5C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { assertScreenshot, getClip } from './utils.test';\n\n// Define interface for NodeEditor component\ninterface NodeEditorElement extends HTMLElement {\n action?: any;\n node?: any;\n nodeUI?: any;\n isOpen?: boolean;\n updateComplete: Promise<boolean>;\n}\n\nconst assertDialogScreenshot = async (\n el: NodeEditorElement,\n screenshotName: string\n) => {\n const dialog = el.shadowRoot\n .querySelector('temba-dialog')\n .shadowRoot.querySelector('.dialog-container') as HTMLElement;\n await assertScreenshot(screenshotName, getClip(dialog));\n};\n\ndescribe('temba-node-editor', () => {\n it('can be created', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n expect(el).to.exist;\n expect(el.tagName).to.equal('TEMBA-NODE-EDITOR');\n });\n\n it('renders send_msg action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders send_msg action with message editor', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello @contact.name, check this out!',\n attachments: [\n 'image/jpeg:http://example.com/photo.jpg',\n 'image:@fields.profile_pic'\n ],\n quick_replies: ['Yes', 'No']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n\n // Check that the message editor component is rendered\n const messageEditor = el.shadowRoot.querySelector(\n 'temba-message-editor'\n ) as any;\n expect(messageEditor).to.not.be.null;\n expect(messageEditor.value).to.equal(action.text);\n });\n\n it('renders set_run_result action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_run_result',\n name: 'result_name',\n value: 'result_value'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders set_contact_field action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_contact_field',\n field: { key: 'age', name: 'Age' },\n value: '25'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders add_contact_groups action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'add_contact_groups',\n groups: [{ uuid: 'group-1', name: 'Test Group' }]\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders enter_flow action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-1', name: 'Sub Flow' }\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders node with router configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n router: {\n type: 'switch',\n result_name: 'result',\n categories: [{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' }]\n }\n };\n\n const nodeUI = {\n type: 'split_by_expression',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/router');\n });\n\n it('renders node with wait configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n wait: {\n type: 'msg'\n }\n };\n\n const nodeUI = {\n type: 'wait_for_response',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/wait');\n });\n\n it('handles different button actions', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n let saveEventFired = false;\n let cancelEventFired = false;\n\n el.addEventListener('temba-action-saved', () => {\n saveEventFired = true;\n });\n\n el.addEventListener('temba-node-edit-cancelled', () => {\n cancelEventFired = true;\n });\n\n // Get the dialog element inside the node editor\n const dialog = el.shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n\n // Test Save button by dispatching event on the dialog\n const saveEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Save' } },\n bubbles: true\n });\n dialog!.dispatchEvent(saveEvent);\n expect(saveEventFired).to.equal(true);\n\n // Reset for cancel test\n saveEventFired = false;\n\n // Test Cancel button\n const cancelEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Cancel' } },\n bubbles: true\n });\n dialog!.dispatchEvent(cancelEvent);\n expect(cancelEventFired).to.equal(true);\n });\n\n it('handles property updates', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n // Test action property update\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n el.action = action;\n await el.updateComplete;\n expect(el.action).to.equal(action);\n\n // Test node property update\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: []\n };\n\n el.node = node;\n await el.updateComplete;\n expect(el.node).to.equal(node);\n\n // Test nodeUI property update\n const nodeUI = {\n type: 'execute_actions',\n position: { left: 100, top: 100 }\n };\n\n el.nodeUI = nodeUI;\n await el.updateComplete;\n expect(el.nodeUI).to.equal(nodeUI);\n });\n\n it('handles form submission events', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Since the form submission handling is complex and involves internal components,\n // we'll just verify the component renders without errors and has the expected structure\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n\n // Verify dialog is present\n const dialog = shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n });\n\n it('handles form validation', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Test that the component renders form elements\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n });\n\n it('renders different action types correctly', async () => {\n const actionTypes = [\n {\n type: 'send_msg',\n data: { text: 'Message', quick_replies: [] }\n },\n {\n type: 'set_run_result',\n data: { name: 'result', value: 'value' }\n },\n {\n type: 'set_contact_name',\n data: { name: 'John Doe' }\n },\n {\n type: 'set_contact_language',\n data: { language: 'eng' }\n }\n ];\n\n for (const actionType of actionTypes) {\n const action = {\n uuid: `test-${actionType.type}`,\n type: actionType.type,\n ...actionType.data\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .action=${action}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action.type).to.equal(actionType.type);\n\n await assertDialogScreenshot(el, `editor/${actionType.type}`);\n }\n });\n\n it('displays bubble count for group value counts', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: ['Yes', 'No', 'Maybe'],\n attachments: ['image:@contact.photo', 'document:@contact.resume']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data to be fully initialized and re-render to complete\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that bubble counts are displayed\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n\n // Should have bubbles for groups with values\n expect(bubbles.length).to.be.greaterThan(0);\n\n // Check specific bubble values (trim to handle whitespace in rendered text)\n const bubbleTexts = Array.from(bubbles).map((bubble) =>\n bubble.textContent?.trim()\n );\n\n // Runtime attachments group should show bubble when collapsed and has values\n expect(bubbleTexts).to.include('2'); // 2 runtime attachments\n // Note: Quick replies group auto-expands when it has content, so no bubble is shown\n });\n\n it('shows arrow when group has no values', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world'\n // No quick_replies or attachments provided\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that arrows are displayed instead of bubbles\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n const arrows = shadowRoot.querySelectorAll('.group-toggle-icon');\n\n // Should have no bubbles when counts are 0\n expect(bubbles.length).to.equal(0);\n\n // Should have arrows for collapsible groups\n expect(arrows.length).to.be.greaterThan(0);\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"temba-node-editor.test.js","sourceRoot":"","sources":["../../test/temba-node-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAWzD,MAAM,sBAAsB,GAAG,KAAK,EAClC,EAAqB,EACrB,cAAsB,EACtB,EAAE;IACF,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU;SACzB,aAAa,CAAC,cAAc,CAAC;SAC7B,UAAU,CAAC,aAAa,CAAC,mBAAmB,CAAgB,CAAC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GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,UAAU,CACjC,CAAC;QACF,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CACtD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,aAAa,CACpC,CAAC;QAEF,yCAAyC;QACzC,MAAM,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEtE,mEAAmE;QACnE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC9D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import '../temba-modules';\nimport { html, fixture, expect } from '@open-wc/testing';\nimport { assertScreenshot, getClip } from './utils.test';\n\n// Define interface for NodeEditor component\ninterface NodeEditorElement extends HTMLElement {\n action?: any;\n node?: any;\n nodeUI?: any;\n isOpen?: boolean;\n updateComplete: Promise<boolean>;\n}\n\nconst assertDialogScreenshot = async (\n el: NodeEditorElement,\n screenshotName: string\n) => {\n const dialog = el.shadowRoot\n .querySelector('temba-dialog')\n .shadowRoot.querySelector('.dialog-container') as HTMLElement;\n await assertScreenshot(screenshotName, getClip(dialog));\n};\n\ndescribe('temba-node-editor', () => {\n it('can be created', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n expect(el).to.exist;\n expect(el.tagName).to.equal('TEMBA-NODE-EDITOR');\n });\n\n it('renders send_msg action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders send_msg action with message editor', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello @contact.name, check this out!',\n attachments: [\n 'image/jpeg:http://example.com/photo.jpg',\n 'image:@fields.profile_pic'\n ],\n quick_replies: ['Yes', 'No']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n\n // Check that the message editor component is rendered\n const messageEditor = el.shadowRoot.querySelector(\n 'temba-message-editor'\n ) as any;\n expect(messageEditor).to.not.be.null;\n expect(messageEditor.value).to.equal(action.text);\n });\n\n it('renders set_run_result action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_run_result',\n name: 'result_name',\n value: 'result_value'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders set_contact_field action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'set_contact_field',\n field: { key: 'age', name: 'Age' },\n value: '25'\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders add_contact_groups action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'add_contact_groups',\n groups: [{ uuid: 'group-1', name: 'Test Group' }]\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders enter_flow action', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-1', name: 'Sub Flow' }\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action).to.equal(action);\n });\n\n it('renders node with router configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n router: {\n type: 'switch',\n result_name: 'result',\n categories: [{ uuid: 'cat-1', name: 'Category 1', exit_uuid: 'exit-1' }]\n }\n };\n\n const nodeUI = {\n type: 'split_by_expression',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/router');\n });\n\n it('renders node with wait configuration', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: [{ uuid: 'exit-1', name: 'Default' }],\n wait: {\n type: 'msg'\n }\n };\n\n const nodeUI = {\n type: 'wait_for_response',\n position: { left: 100, top: 100 }\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n await assertDialogScreenshot(el, 'editor/wait');\n });\n\n it('handles different button actions', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n let saveEventFired = false;\n let cancelEventFired = false;\n\n el.addEventListener('temba-action-saved', () => {\n saveEventFired = true;\n });\n\n el.addEventListener('temba-node-edit-cancelled', () => {\n cancelEventFired = true;\n });\n\n // Get the dialog element inside the node editor\n const dialog = el.shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n\n // Test Save button by dispatching event on the dialog\n const saveEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Save' } },\n bubbles: true\n });\n dialog!.dispatchEvent(saveEvent);\n expect(saveEventFired).to.equal(true);\n\n // Reset for cancel test\n saveEventFired = false;\n\n // Test Cancel button\n const cancelEvent = new CustomEvent('temba-button-clicked', {\n detail: { button: { name: 'Cancel' } },\n bubbles: true\n });\n dialog!.dispatchEvent(cancelEvent);\n expect(cancelEventFired).to.equal(true);\n });\n\n it('handles property updates', async () => {\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n // Test action property update\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n el.action = action;\n await el.updateComplete;\n expect(el.action).to.equal(action);\n\n // Test node property update\n const node = {\n uuid: 'test-node-uuid',\n actions: [],\n exits: []\n };\n\n el.node = node;\n await el.updateComplete;\n expect(el.node).to.equal(node);\n\n // Test nodeUI property update\n const nodeUI = {\n type: 'execute_actions',\n position: { left: 100, top: 100 }\n };\n\n el.nodeUI = nodeUI;\n await el.updateComplete;\n expect(el.nodeUI).to.equal(nodeUI);\n });\n\n it('handles form submission events', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Since the form submission handling is complex and involves internal components,\n // we'll just verify the component renders without errors and has the expected structure\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n\n // Verify dialog is present\n const dialog = shadowRoot!.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n });\n\n it('handles form validation', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: []\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Test that the component renders form elements\n const shadowRoot = el.shadowRoot;\n expect(shadowRoot).to.not.be.null;\n });\n\n it('renders different action types correctly', async () => {\n const actionTypes = [\n {\n type: 'send_msg',\n data: { text: 'Message', quick_replies: [] }\n },\n {\n type: 'set_run_result',\n data: { name: 'result', value: 'value' }\n },\n {\n type: 'set_contact_name',\n data: { name: 'John Doe' }\n },\n {\n type: 'set_contact_language',\n data: { language: 'eng' }\n }\n ];\n\n for (const actionType of actionTypes) {\n const action = {\n uuid: `test-${actionType.type}`,\n type: actionType.type,\n ...actionType.data\n };\n\n const el = (await fixture(html`\n <temba-node-editor\n .action=${action}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.action.type).to.equal(actionType.type);\n\n await assertDialogScreenshot(el, `editor/${actionType.type}`);\n }\n });\n\n it('displays bubble count for group value counts', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world',\n quick_replies: ['Yes', 'No', 'Maybe'],\n attachments: ['image:@contact.photo', 'document:@contact.resume']\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data to be fully initialized and re-render to complete\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that bubble counts are displayed\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n\n // Should have bubbles for groups with values\n expect(bubbles.length).to.be.greaterThan(0);\n\n // Check specific bubble values (trim to handle whitespace in rendered text)\n const bubbleTexts = Array.from(bubbles).map((bubble) =>\n bubble.textContent?.trim()\n );\n\n // Runtime attachments group should show bubble when collapsed and has values\n expect(bubbleTexts).to.include('2'); // 2 runtime attachments\n // Note: Quick replies group auto-expands when it has content, so no bubble is shown\n });\n\n it('shows arrow when group has no values', async () => {\n const action = {\n uuid: 'test-action-uuid',\n type: 'send_msg',\n text: 'Hello world'\n // No quick_replies or attachments provided\n };\n\n const el = (await fixture(html`\n <temba-node-editor .action=${action} .isOpen=${true}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that arrows are displayed instead of bubbles\n const shadowRoot = el.shadowRoot;\n const bubbles = shadowRoot.querySelectorAll('.group-count-bubble');\n const arrows = shadowRoot.querySelectorAll('.group-toggle-icon');\n\n // Should have no bubbles when counts are 0\n expect(bubbles.length).to.equal(0);\n\n // Should have arrows for collapsible groups\n expect(arrows.length).to.be.greaterThan(0);\n });\n\n it('renders split_by_llm_categorize node', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n expect(el.shadowRoot).to.not.be.null;\n expect(el.node).to.equal(node);\n expect(el.nodeUI).to.equal(nodeUI);\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check if the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Check that the form is rendered\n const form = el.shadowRoot.querySelector('.node-editor-form');\n expect(form).to.not.be.null;\n\n // Check that all expected form components are rendered\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n const completionComponents =\n el.shadowRoot.querySelectorAll('temba-completion');\n\n // Should have LLM select field\n expect(selectComponents.length).to.equal(1);\n expect(selectComponents[0].getAttribute('label')).to.equal('LLM');\n\n // Should have input completion field\n expect(completionComponents.length).to.equal(1);\n expect(completionComponents[0].getAttribute('label')).to.equal('Input');\n\n // Should have categories array editor\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('renders wait_for_response node', async () => {\n const node = {\n uuid: 'test-wait-node-uuid',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n timeout: 300 // 5 minutes in seconds\n },\n result_name: 'response',\n categories: []\n },\n exits: []\n };\n\n const nodeUI = { type: 'wait_for_response' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Check that the dialog is rendered with correct header\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog).to.not.be.null;\n expect(dialog.getAttribute('header')).to.equal('Wait for Response');\n\n // Check that timeout and result name fields are rendered\n const textComponents = el.shadowRoot.querySelectorAll('temba-textinput');\n expect(textComponents.length).to.equal(1);\n\n // Verify the field labels\n const labels = Array.from(textComponents).map((comp) =>\n comp.getAttribute('label')\n );\n expect(labels).to.include('Result Name');\n });\n\n it('prioritizes node config over action config for non-execute_actions nodes', async () => {\n // Create a split_by_llm_categorize node that has both actions and should use node config\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Simulate having both node and action set (which happens when editing from flow)\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .action=${node.actions[0]}\n .isOpen=${true}\n >\n </temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Should show node editor (Split by AI Categorize), not action editor (Call LLM)\n const dialog = el.shadowRoot.querySelector('temba-dialog');\n expect(dialog.getAttribute('header')).to.equal('Split by AI');\n\n // Should have node config fields (LLM, Input, Categories, Result Name)\n const selectComponents = el.shadowRoot.querySelectorAll('temba-select');\n const arrayComponents =\n el.shadowRoot.querySelectorAll('temba-array-editor');\n\n // Should have LLM select and categories array (node config fields)\n expect(selectComponents.length).to.equal(1);\n expect(arrayComponents.length).to.equal(1);\n });\n\n it('initializes categories correctly for split_by_llm_categorize', async () => {\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n const el = (await fixture(html`\n <temba-node-editor\n .node=${node}\n .nodeUI=${nodeUI}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Wait for form data initialization\n await new Promise((resolve) => setTimeout(resolve, 200));\n await el.updateComplete;\n\n // Access the component's formData directly to check initialization\n const formData = (el as any).formData;\n\n // Should have 2 categories (Greeting and Question, excluding Other and Failure)\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that the array editor component receives the correct value\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n // Wait a bit more for the array editor to fully render\n await new Promise((resolve) => setTimeout(resolve, 500));\n await el.updateComplete;\n\n // Check the values of the textinput components within the array items\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n\n if (textInputs && textInputs.length >= 2) {\n // The first two textinputs should have the category names\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('properly initializes categories when node is set after component creation', async () => {\n // First create the component without any data\n const el = (await fixture(html`\n <temba-node-editor .isOpen=${false}></temba-node-editor>\n `)) as NodeEditorElement;\n\n await el.updateComplete;\n\n // Then set the node data (simulating real usage)\n const node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n { uuid: 'cat-1', name: 'Greeting', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Question', exit_uuid: 'exit-2' },\n { uuid: 'cat-3', name: 'Other', exit_uuid: 'exit-3' },\n { uuid: 'cat-4', name: 'Failure', exit_uuid: 'exit-4' }\n ]\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null },\n { uuid: 'exit-3', destination_uuid: null },\n { uuid: 'exit-4', destination_uuid: null }\n ]\n };\n\n const nodeUI = { type: 'split_by_llm_categorize' };\n\n // Set the properties (this should trigger updated() and openDialog())\n el.node = node;\n el.nodeUI = nodeUI;\n\n await el.updateComplete;\n\n // Wait for dialog to open and form data to initialize\n await new Promise((resolve) => setTimeout(resolve, 300));\n await el.updateComplete;\n\n // Check that the form data is properly initialized\n const formData = (el as any).formData;\n\n expect(formData.categories).to.be.an('array');\n expect(formData.categories.length).to.equal(2);\n expect(formData.categories[0].name).to.equal('Greeting');\n expect(formData.categories[1].name).to.equal('Question');\n\n // Check that array editor gets the correct values\n const arrayEditor = el.shadowRoot.querySelector('temba-array-editor');\n expect(arrayEditor).to.not.be.null;\n\n const textInputs =\n arrayEditor.shadowRoot?.querySelectorAll('temba-textinput');\n if (textInputs && textInputs.length >= 2) {\n expect((textInputs[0] as any).value).to.equal('Greeting');\n expect((textInputs[1] as any).value).to.equal('Question');\n }\n });\n\n it('preserves UUIDs for unchanged categories in split_by_llm_categorize', async () => {\n const originalNode: any = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'existing-call-llm-uuid',\n type: 'call_llm',\n llm: { uuid: 'llm-123', name: 'Test LLM' },\n input: '@input',\n instructions:\n '@(prompt(\"categorize\", slice(node.categories, 0, -2)))',\n output_local: '_llm_output'\n }\n ],\n router: {\n type: 'switch',\n operand: '@locals._llm_output',\n result_name: 'Intent',\n categories: [\n {\n uuid: 'existing-cat-1',\n name: 'Greeting',\n exit_uuid: 'existing-exit-1'\n },\n {\n uuid: 'existing-cat-2',\n name: 'Question',\n exit_uuid: 'existing-exit-2'\n },\n {\n uuid: 'existing-cat-other',\n name: 'Other',\n exit_uuid: 'existing-exit-other'\n },\n {\n uuid: 'existing-cat-failure',\n name: 'Failure',\n exit_uuid: 'existing-exit-failure'\n }\n ],\n cases: [\n {\n uuid: 'existing-case-1',\n type: 'has_only_text',\n arguments: ['Greeting'],\n category_uuid: 'existing-cat-1'\n },\n {\n uuid: 'existing-case-2',\n type: 'has_only_text',\n arguments: ['Question'],\n category_uuid: 'existing-cat-2'\n },\n {\n uuid: 'existing-case-error',\n type: 'has_only_text',\n arguments: ['<ERROR>'],\n category_uuid: 'existing-cat-failure'\n }\n ]\n },\n exits: [\n { uuid: 'existing-exit-1', destination_uuid: 'some-destination-1' },\n { uuid: 'existing-exit-2', destination_uuid: 'some-destination-2' },\n { uuid: 'existing-exit-other', destination_uuid: null },\n { uuid: 'existing-exit-failure', destination_uuid: null }\n ]\n };\n\n // Import the node config to test fromFormData directly\n const { split_by_llm_categorize } = await import(\n '../src/flow/nodes/split_by_llm_categorize'\n );\n\n // Test with same categories - should preserve UUIDs\n const formDataSame = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [{ name: 'Greeting' }, { name: 'Question' }],\n result_name: 'Intent'\n };\n\n const resultSame = split_by_llm_categorize.fromFormData(\n formDataSame,\n originalNode\n );\n\n // Should preserve existing UUIDs for unchanged categories\n expect(resultSame.actions[0].uuid).to.equal('existing-call-llm-uuid');\n\n const greetingCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const questionCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Question'\n );\n const otherCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Other'\n );\n const failureCategory = resultSame.router.categories.find(\n (cat) => cat.name === 'Failure'\n );\n\n expect(greetingCategory.uuid).to.equal('existing-cat-1');\n expect(greetingCategory.exit_uuid).to.equal('existing-exit-1');\n expect(questionCategory.uuid).to.equal('existing-cat-2');\n expect(questionCategory.exit_uuid).to.equal('existing-exit-2');\n expect(otherCategory.uuid).to.equal('existing-cat-other');\n expect(failureCategory.uuid).to.equal('existing-cat-failure');\n\n // Should preserve destination UUIDs for exits\n const greetingExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-1'\n );\n const questionExit = resultSame.exits.find(\n (exit) => exit.uuid === 'existing-exit-2'\n );\n expect(greetingExit.destination_uuid).to.equal('some-destination-1');\n expect(questionExit.destination_uuid).to.equal('some-destination-2');\n\n // Test with changed categories - should generate new UUIDs for new categories\n const formDataChanged = {\n llm: [{ value: 'llm-123', name: 'Test LLM' }],\n input: '@input',\n categories: [\n { name: 'Greeting' }, // unchanged - should keep UUID\n { name: 'NewCategory' } // new - should get new UUID\n ],\n result_name: 'Intent'\n };\n\n const resultChanged = split_by_llm_categorize.fromFormData(\n formDataChanged,\n originalNode\n );\n\n const greetingCategoryChanged = resultChanged.router.categories.find(\n (cat) => cat.name === 'Greeting'\n );\n const newCategory = resultChanged.router.categories.find(\n (cat) => cat.name === 'NewCategory'\n );\n\n // Greeting should keep its existing UUID\n expect(greetingCategoryChanged.uuid).to.equal('existing-cat-1');\n expect(greetingCategoryChanged.exit_uuid).to.equal('existing-exit-1');\n\n // NewCategory should get a new UUID (not one of the existing ones)\n expect(newCategory.uuid).to.not.equal('existing-cat-1');\n expect(newCategory.uuid).to.not.equal('existing-cat-2');\n expect(newCategory.uuid).to.not.equal('existing-cat-other');\n expect(newCategory.uuid).to.not.equal('existing-cat-failure');\n expect(newCategory.uuid).to.have.length.greaterThan(0);\n });\n});\n"]}
|
|
@@ -609,7 +609,7 @@ describe('temba-select', () => {
|
|
|
609
609
|
// should have all three pages visible right away
|
|
610
610
|
assert.equal(select.visibleOptions.length, 15);
|
|
611
611
|
});
|
|
612
|
-
|
|
612
|
+
xit('shows cached results', async () => {
|
|
613
613
|
const select = await createSelect(clock, getSelectHTML([], {
|
|
614
614
|
placeholder: 'Select a group',
|
|
615
615
|
endpoint: '/test-assets/select/groups.json',
|
|
@@ -660,10 +660,13 @@ describe('temba-select', () => {
|
|
|
660
660
|
placeholder: 'Select a color',
|
|
661
661
|
searchable: true
|
|
662
662
|
}));
|
|
663
|
-
await assertScreenshot('select/search-enabled',
|
|
663
|
+
await assertScreenshot('select/search-enabled', getClip(select));
|
|
664
664
|
});
|
|
665
665
|
it('should look the same with search enabled and selection made', async () => {
|
|
666
|
-
const select = await createSelect(clock, getSelectHTML(colors, {
|
|
666
|
+
const select = await createSelect(clock, getSelectHTML(colors, {
|
|
667
|
+
placeholder: 'Select a color',
|
|
668
|
+
searchable: true
|
|
669
|
+
}));
|
|
667
670
|
// select the first option
|
|
668
671
|
await openAndClick(clock, select, 1);
|
|
669
672
|
await assertScreenshot('select/search-selected', getClipWithOptions(select));
|