@nyaruka/temba-components 0.41.7 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/demo/index.html +22 -0
  3. package/dist/{973a6cc2.js → dae3a0ce.js} +398 -158
  4. package/dist/index.js +398 -158
  5. package/dist/sw.js +1 -1
  6. package/dist/sw.js.map +1 -1
  7. package/dist/templates/components-body.html +1 -1
  8. package/dist/templates/components-head.html +1 -1
  9. package/out-tsc/src/aliaseditor/AliasEditor.js +2 -1
  10. package/out-tsc/src/aliaseditor/AliasEditor.js.map +1 -1
  11. package/out-tsc/src/button/Button.js +3 -3
  12. package/out-tsc/src/button/Button.js.map +1 -1
  13. package/out-tsc/src/charcount/CharCount.js +5 -4
  14. package/out-tsc/src/charcount/CharCount.js.map +1 -1
  15. package/out-tsc/src/completion/Completion.js +5 -0
  16. package/out-tsc/src/completion/Completion.js.map +1 -1
  17. package/out-tsc/src/compose/Compose.js +532 -0
  18. package/out-tsc/src/compose/Compose.js.map +1 -0
  19. package/out-tsc/src/contacts/ContactChat.js +73 -69
  20. package/out-tsc/src/contacts/ContactChat.js.map +1 -1
  21. package/out-tsc/src/contacts/ContactHistory.js +1 -1
  22. package/out-tsc/src/contacts/ContactHistory.js.map +1 -1
  23. package/out-tsc/src/contacts/events.js +1 -0
  24. package/out-tsc/src/contacts/events.js.map +1 -1
  25. package/out-tsc/src/interfaces.js +2 -0
  26. package/out-tsc/src/interfaces.js.map +1 -1
  27. package/out-tsc/src/textinput/TextInput.js +3 -1
  28. package/out-tsc/src/textinput/TextInput.js.map +1 -1
  29. package/out-tsc/src/utils/index.js +10 -0
  30. package/out-tsc/src/utils/index.js.map +1 -1
  31. package/out-tsc/src/vectoricon/index.js +1 -0
  32. package/out-tsc/src/vectoricon/index.js.map +1 -1
  33. package/out-tsc/temba-modules.js +2 -0
  34. package/out-tsc/temba-modules.js.map +1 -1
  35. package/out-tsc/test/temba-compose.test.js +432 -0
  36. package/out-tsc/test/temba-compose.test.js.map +1 -0
  37. package/out-tsc/test/temba-contact-chat.test.js +219 -47
  38. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  39. package/out-tsc/test/temba-contact-history.test.js +7 -3
  40. package/out-tsc/test/temba-contact-history.test.js.map +1 -1
  41. package/out-tsc/test/utils.test.js +12 -8
  42. package/out-tsc/test/utils.test.js.map +1 -1
  43. package/package.json +1 -1
  44. package/screenshots/truth/compose/attachments-and-send-button.png +0 -0
  45. package/screenshots/truth/compose/attachments-no-send-button.png +0 -0
  46. package/screenshots/truth/compose/attachments-with-all-files-and-click-send.png +0 -0
  47. package/screenshots/truth/compose/attachments-with-all-files.png +0 -0
  48. package/screenshots/truth/compose/attachments-with-failure-files.png +0 -0
  49. package/screenshots/truth/compose/attachments-with-success-files-and-click-send.png +0 -0
  50. package/screenshots/truth/compose/attachments-with-success-files.png +0 -0
  51. package/screenshots/truth/compose/chatbox-attachments-counter-and-send-button.png +0 -0
  52. package/screenshots/truth/compose/chatbox-attachments-counter-no-send-button.png +0 -0
  53. package/screenshots/truth/compose/chatbox-attachments-no-counter-and-send-button.png +0 -0
  54. package/screenshots/truth/compose/chatbox-attachments-no-counter-no-send-button.png +0 -0
  55. package/screenshots/truth/compose/chatbox-counter-and-send-button.png +0 -0
  56. package/screenshots/truth/compose/chatbox-counter-no-send-button.png +0 -0
  57. package/screenshots/truth/compose/chatbox-no-counter-and-send-button.png +0 -0
  58. package/screenshots/truth/compose/chatbox-no-counter-no-send-button.png +0 -0
  59. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png +0 -0
  60. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files.png +0 -0
  61. package/screenshots/truth/compose/chatbox-no-text-attachments-with-failure-files.png +0 -0
  62. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png +0 -0
  63. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files.png +0 -0
  64. package/screenshots/truth/compose/chatbox-with-text-and-click-send.png +0 -0
  65. package/screenshots/truth/compose/chatbox-with-text-and-hit-enter.png +0 -0
  66. package/screenshots/truth/compose/chatbox-with-text-and-spaces.png +0 -0
  67. package/screenshots/truth/compose/chatbox-with-text-and-url.png +0 -0
  68. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-click-send.png +0 -0
  69. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-hit-enter.png +0 -0
  70. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files.png +0 -0
  71. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png +0 -0
  72. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png +0 -0
  73. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files.png +0 -0
  74. package/screenshots/truth/compose/chatbox-with-text-attachments-with-failure-files.png +0 -0
  75. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-click-send.png +0 -0
  76. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png +0 -0
  77. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files.png +0 -0
  78. package/screenshots/truth/compose/chatbox-with-text-no-spaces.png +0 -0
  79. package/screenshots/truth/compose/chatbox-with-text.png +0 -0
  80. package/screenshots/truth/contacts/badges.png +0 -0
  81. package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
  82. package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
  83. package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
  84. package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
  85. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
  86. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
  87. package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
  88. package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
  89. package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
  90. package/screenshots/truth/contacts/contact-active-default.png +0 -0
  91. package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
  92. package/screenshots/truth/contacts/contact-active-ticket-closed-show-reopen-button.png +0 -0
  93. package/screenshots/truth/contacts/contact-active-ticket-open-show-chatbox.png +0 -0
  94. package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
  95. package/screenshots/truth/contacts/contact-archived-ticket-closed-hide-chatbox.png +0 -0
  96. package/screenshots/truth/contacts/contact-blocked-hide-chatbox.png +0 -0
  97. package/screenshots/truth/contacts/contact-stopped-hide-chatbox.png +0 -0
  98. package/screenshots/truth/contacts/history.png +0 -0
  99. package/screenshots/truth/counter/summary.png +0 -0
  100. package/screenshots/truth/counter/text.png +0 -0
  101. package/screenshots/truth/counter/unicode-variables.png +0 -0
  102. package/screenshots/truth/counter/unicode.png +0 -0
  103. package/screenshots/truth/counter/variable.png +0 -0
  104. package/src/aliaseditor/AliasEditor.ts +2 -1
  105. package/src/button/Button.ts +3 -3
  106. package/src/charcount/CharCount.ts +5 -4
  107. package/src/completion/Completion.ts +4 -0
  108. package/src/compose/Compose.ts +585 -0
  109. package/src/contacts/ContactChat.ts +75 -78
  110. package/src/contacts/ContactHistory.ts +1 -1
  111. package/src/contacts/events.ts +1 -0
  112. package/src/interfaces.ts +2 -0
  113. package/src/textinput/TextInput.ts +3 -1
  114. package/src/utils/index.ts +12 -0
  115. package/src/vectoricon/index.ts +1 -0
  116. package/static/css/temba-components.css +6 -0
  117. package/temba-modules.ts +2 -0
  118. package/test/temba-compose.test.ts +633 -0
  119. package/test/temba-contact-chat.test.ts +354 -110
  120. package/test/temba-contact-history.test.ts +10 -5
  121. package/test/utils.test.ts +24 -9
  122. package/screenshots/truth/contacts/history-expanded.png +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vectoricon/index.ts"],"names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C5B,qCAA6B,CAAA;IAC7B,+BAAuB,CAAA;IACvB,4BAAoB,CAAA;IACpB,yCAAiC,CAAA;IACjC,0CAAkC,CAAA;IAClC,iCAAyB,CAAA;IACzB,4BAAoB,CAAA;IACpB,8BAAsB,CAAA;IACtB,wBAAgB,CAAA;IAChB,+BAAuB,CAAA;IACvB,wBAAgB,CAAA;IAChB,oCAA4B,CAAA;IAC5B,oCAA4B,CAAA;IAC5B,0BAAkB,CAAA;IAClB,iCAAyB,CAAA;IACzB,gCAAwB,CAAA;IACxB,0CAAkC,CAAA;IAClC,4BAAoB,CAAA;IACpB,yBAAiB,CAAA;IACjB,+BAAuB,CAAA;IACvB,gCAAwB,CAAA;IACxB,+BAAuB,CAAA;IACvB,iCAAyB,CAAA;IACzB,uCAA+B,CAAA;IAC/B,wCAAgC,CAAA;IAChC,yCAAiC,CAAA;IACjC,6BAAqB,CAAA;IACrB,8BAAsB,CAAA;IACtB,2BAAmB,CAAA;IACnB,kCAA0B,CAAA;IAC1B,0BAAkB,CAAA;IAClB,yBAAiB,CAAA;IACjB,0BAAkB,CAAA;IAClB,gCAAwB,CAAA;IACxB,oCAA4B,CAAA;IAC5B,4BAAoB,CAAA;IACpB,2BAAmB,CAAA;IAEnB,4BAAoB,CAAA;IACpB,4BAAoB,CAAA;AACtB,CAAC,EAlGW,IAAI,KAAJ,IAAI,QAkGf","sourcesContent":["export enum Icon {\n analytics = 'bar-chart-01',\n account = 'user-01',\n active = 'play',\n add_note = 'file-02',\n airtime = 'bank-note-01',\n archive = 'archive',\n arrow_up = 'chevron-up',\n arrow_down = 'chevron-down',\n arrow_left = 'chevron-left',\n arrow_right = 'chevron-right',\n attachment = 'paperclip',\n broadcast = 'announcement-01',\n call = 'phone-call-01',\n call_missed = 'phone-call-02',\n campaign = 'clock-refresh',\n campaigns = 'clock-refresh',\n channel = 'zap',\n children = 'git-branch-01',\n check = 'check',\n checkbox = 'square',\n checkbox_checked = 'check-square',\n contact = 'user-01',\n contact_archived = 'archive',\n contact_blocked = 'message-x-square',\n contact_stopped = 'slash-octagon',\n contact_updated = 'user-edit',\n contacts = 'user-01',\n copy = 'copy-04',\n dashboard = 'pie-chart-01',\n delete = 'trash-03',\n delete_small = 'x',\n download = 'download-01',\n email = 'mail-01',\n error = 'alert-circle',\n event = 'zap',\n fields = 'user-edit',\n flow = 'flow',\n flow_interrupted = 'x-close',\n flow_ivr = 'phone-call-01',\n flow_message = 'message-square-02',\n flow_user = 'activity',\n flows = 'flow',\n group = 'users-01',\n group_smart = 'atom-01',\n help = 'help-circle',\n home = 'home-01',\n inbox = 'inbox-01',\n label = 'tag-01',\n language = 'globe-01',\n link = 'link-external-01',\n log = 'file-02',\n menu = 'menu-01',\n menu_collapse = 'chevron-left-double',\n message = 'message-square-02',\n messages = 'message-square-02',\n org_active = 'credit-card-02',\n org_anonymous = 'glasses-01',\n org_bulk = 'credit-card-plus',\n org_flagged = 'flag-01',\n org_new = 'stars-02',\n org_suspended = 'slash-circle-01',\n org_verified = 'check-verified-02',\n overview = 'pie-chart-01',\n featured = 'star-01',\n resthooks = 'share-07',\n restore = 'play',\n retry = 'refresh-cw-05',\n runs = 'rows-03',\n search = 'search-refraction',\n select_open = 'chevron-down',\n select_clear = 'x',\n service = 'magic-wand-01',\n settings = 'settings-02',\n sort = 'chevron-selector-vertical',\n staff = 'hard-drive',\n tickets = 'agent',\n tickets_all = 'archive',\n tickets_closed = 'check',\n tickets_mine = 'coffee',\n tickets_open = 'inbox-01',\n tickets_unassigned = 'inbox-01',\n two_factor_enabled = 'shield-02',\n two_factor_disabled = 'shield-01',\n trigger = 'signal-01',\n triggers = 'signal-01',\n updated = 'edit-02',\n upload = 'upload-cloud-01',\n usages = 'link-04',\n user = 'users-01',\n users = 'users-01',\n user_beta = 'shield-zap',\n webhook = 'link-external-01',\n workspace = 'folder',\n zendesk = 'zendesk',\n\n ext = 'lightning-01',\n fcm = 'lightning-01',\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["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C9B,qCAA6B,CAAA;IAC7B,oCAA4B,CAAA;IAC5B,qCAA6B,CAAA;IAC7B,+BAAuB,CAAA;IACvB,4BAAoB,CAAA;IACpB,yCAAiC,CAAA;IACjC,0CAAkC,CAAA;IAClC,iCAAyB,CAAA;IACzB,4BAAoB,CAAA;IACpB,8BAAsB,CAAA;IACtB,wBAAgB,CAAA;IAChB,+BAAuB,CAAA;IACvB,wBAAgB,CAAA;IAChB,oCAA4B,CAAA;IAC5B,oCAA4B,CAAA;IAC5B,0BAAkB,CAAA;IAClB,iCAAyB,CAAA;IACzB,gCAAwB,CAAA;IACxB,0CAAkC,CAAA;IAClC,4BAAoB,CAAA;IACpB,yBAAiB,CAAA;IACjB,+BAAuB,CAAA;IACvB,gCAAwB,CAAA;IACxB,+BAAuB,CAAA;IACvB,iCAAyB,CAAA;IACzB,uCAA+B,CAAA;IAC/B,wCAAgC,CAAA;IAChC,yCAAiC,CAAA;IACjC,6BAAqB,CAAA;IACrB,8BAAsB,CAAA;IACtB,2BAAmB,CAAA;IACnB,kCAA0B,CAAA;IAC1B,0BAAkB,CAAA;IAClB,yBAAiB,CAAA;IACjB,0BAAkB,CAAA;IAClB,gCAAwB,CAAA;IACxB,oCAA4B,CAAA;IAC5B,4BAAoB,CAAA;IACpB,2BAAmB,CAAA;IAEnB,4BAAoB,CAAA;IACpB,4BAAoB,CAAA;AACtB,CAAC,EAnGW,IAAI,KAAJ,IAAI,QAmGf","sourcesContent":["export enum Icon {\n analytics = 'bar-chart-01',\n account = 'user-01',\n active = 'play',\n add_note = 'file-02',\n airtime = 'bank-note-01',\n archive = 'archive',\n arrow_up = 'chevron-up',\n arrow_down = 'chevron-down',\n arrow_left = 'chevron-left',\n arrow_right = 'chevron-right',\n attachment = 'paperclip',\n broadcast = 'announcement-01',\n call = 'phone-call-01',\n call_missed = 'phone-call-02',\n campaign = 'clock-refresh',\n campaigns = 'clock-refresh',\n channel = 'zap',\n children = 'git-branch-01',\n check = 'check',\n checkbox = 'square',\n checkbox_checked = 'check-square',\n compose = 'send-01',\n contact = 'user-01',\n contact_archived = 'archive',\n contact_blocked = 'message-x-square',\n contact_stopped = 'slash-octagon',\n contact_updated = 'user-edit',\n contacts = 'user-01',\n copy = 'copy-04',\n dashboard = 'pie-chart-01',\n delete = 'trash-03',\n delete_small = 'x',\n download = 'download-01',\n email = 'mail-01',\n error = 'alert-circle',\n event = 'zap',\n fields = 'user-edit',\n flow = 'flow',\n flow_interrupted = 'x-close',\n flow_ivr = 'phone-call-01',\n flow_message = 'message-square-02',\n flow_user = 'activity',\n flows = 'flow',\n group = 'users-01',\n group_smart = 'atom-01',\n help = 'help-circle',\n home = 'home-01',\n inbox = 'inbox-01',\n label = 'tag-01',\n language = 'globe-01',\n link = 'link-external-01',\n log = 'file-02',\n menu = 'menu-01',\n menu_collapse = 'chevron-left-double',\n message = 'message-square-02',\n messages = 'message-square-02',\n org_active = 'credit-card-02',\n org_anonymous = 'glasses-01',\n org_bulk = 'credit-card-plus',\n org_flagged = 'flag-01',\n org_new = 'stars-02',\n org_suspended = 'slash-circle-01',\n org_verified = 'check-verified-02',\n overview = 'pie-chart-01',\n featured = 'star-01',\n resthooks = 'share-07',\n restore = 'play',\n retry = 'refresh-cw-05',\n runs = 'rows-03',\n search = 'search-refraction',\n select_open = 'chevron-down',\n select_clear = 'x',\n service = 'magic-wand-01',\n settings = 'settings-02',\n sort = 'chevron-selector-vertical',\n staff = 'hard-drive',\n tickets = 'agent',\n tickets_all = 'archive',\n tickets_closed = 'check',\n tickets_mine = 'coffee',\n tickets_open = 'inbox-01',\n tickets_unassigned = 'inbox-01',\n two_factor_enabled = 'shield-02',\n two_factor_disabled = 'shield-01',\n trigger = 'signal-01',\n triggers = 'signal-01',\n updated = 'edit-02',\n upload = 'upload-cloud-01',\n usages = 'link-04',\n user = 'users-01',\n users = 'users-01',\n user_beta = 'shield-zap',\n webhook = 'link-external-01',\n workspace = 'folder',\n zendesk = 'zendesk',\n\n ext = 'lightning-01',\n fcm = 'lightning-01',\n}\n"]}
@@ -43,6 +43,7 @@ import { SortableList } from './src/list/SortableList';
43
43
  import { ContentMenu } from './src/list/ContentMenu';
44
44
  import { TembaDate } from './src/date/TembaDate';
45
45
  import Remote from './src/remote/Remote';
46
+ import { Compose } from './src/compose/Compose';
46
47
  export function addCustomElement(name, comp) {
47
48
  if (!window.customElements.get(name)) {
48
49
  window.customElements.define(name, comp);
@@ -94,4 +95,5 @@ addCustomElement('temba-contact-pending', ContactPending);
94
95
  addCustomElement('temba-contact-tickets', ContactTickets);
95
96
  addCustomElement('temba-slider', TembaSlider);
96
97
  addCustomElement('temba-content-menu', ContentMenu);
98
+ addCustomElement('temba-compose', Compose);
97
99
  //# sourceMappingURL=temba-modules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"temba-modules.js","sourceRoot":"","sources":["../temba-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE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sBAAsB,EAAE,aAAa,CAAC,CAAC;AACxD,gBAAgB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC3C,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC7C,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACxC,gBAAgB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACnC,gBAAgB,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;AACxD,gBAAgB,CAAC,uBAAuB,EAAE,cAAc,CAAC,CAAC;AAC1D,gBAAgB,CAAC,uBAAuB,EAAE,cAAc,CAAC,CAAC;AAC1D,gBAAgB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9C,gBAAgB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { Checkbox } from './src/checkbox/Checkbox';\nimport { TextInput } from './src/textinput/TextInput';\nimport { Store } from './src/store/Store';\nimport { Select } from './src/select/Select';\nimport { Completion } from './src/completion/Completion';\nimport { Modax } from './src/dialog/Modax';\nimport { Dialog } from './src/dialog/Dialog';\nimport { Button } from './src/button/Button';\nimport { FormField } from './src/formfield/FormField';\nimport { Loading } from './src/loading/Loading';\nimport { CharCount } from './src/charcount/CharCount';\nimport { Options } from './src/options/Options';\nimport { ContactChat } from './src/contacts/ContactChat';\nimport { ContactHistory } from './src/contacts/ContactHistory';\nimport { TicketList } from './src/list/TicketList';\nimport { ContactDetails } from './src/contacts/ContactDetails';\nimport { TembaList } from './src/list/TembaList';\nimport { ContactSearch } from './src/contactsearch/ContactSearch';\nimport { VectorIcon } from './src/vectoricon/VectorIcon';\nimport { Alert } from './src/alert/Alert';\nimport { Omnibox } from './src/omnibox/Omnibox';\nimport { Tip } from './src/tip/Tip';\nimport { TembaMenu } from './src/list/TembaMenu';\nimport { Anchor } from './src/anchor/Anchor';\nimport { Dropdown } from './src/dropdown/Dropdown';\nimport { TabPane } from './src/tabpane/TabPane';\nimport { Tab } from './src/tabpane/Tab';\nimport Label from './src/label/Label';\nimport { ContactName } from './src/contacts/ContactName';\nimport { ContactUrn } from './src/contacts/ContactUrn';\nimport { ContactFields } from './src/contacts/ContactFields';\nimport { ContactFieldEditor } from './src/contacts/ContactFieldEditor';\n\nimport { ContactBadges } from './src/contacts/ContactBadges';\nimport { ContactPending } from './src/contacts/ContactPending';\nimport { ContactTickets } from './src/contacts/ContactTickets';\nimport { TembaSlider } from './src/slider/TembaSlider';\nimport { RunList } from './src/list/RunList';\nimport { FlowStoreElement } from './src/flow/FlowStoreElement';\nimport { ContactNameFetch } from './src/contacts/ContactNameFetch';\nimport DatePicker from './src/datepicker/DatePicker';\nimport { FieldManager } from './src/fields/FieldManager';\nimport { SortableList } from './src/list/SortableList';\nimport { ContentMenu } from './src/list/ContentMenu';\nimport { TembaDate } from './src/date/TembaDate';\nimport Remote from './src/remote/Remote';\n\nexport function addCustomElement(name: string, comp: any) {\n if (!window.customElements.get(name)) {\n window.customElements.define(name, comp);\n }\n}\n\naddCustomElement('temba-anchor', Anchor);\naddCustomElement('temba-alert', Alert);\naddCustomElement('temba-store', Store);\naddCustomElement('temba-textinput', TextInput);\naddCustomElement('temba-datepicker', DatePicker);\naddCustomElement('temba-date', TembaDate);\naddCustomElement('temba-completion', Completion);\naddCustomElement('temba-checkbox', Checkbox);\naddCustomElement('temba-select', Select);\naddCustomElement('temba-options', Options);\naddCustomElement('temba-loading', Loading);\naddCustomElement('temba-button', Button);\naddCustomElement('temba-omnibox', Omnibox);\naddCustomElement('temba-tip', Tip);\naddCustomElement('temba-contact-name', ContactName);\naddCustomElement('temba-contact-name-fetch', ContactNameFetch);\naddCustomElement('temba-contact-field', ContactFieldEditor);\naddCustomElement('temba-contact-fields', ContactFields);\naddCustomElement('temba-field-manager', FieldManager);\naddCustomElement('temba-urn', ContactUrn);\naddCustomElement('temba-content-menu', ContentMenu);\n\naddCustomElement('temba-field', FormField);\naddCustomElement('temba-dialog', Dialog);\naddCustomElement('temba-modax', Modax);\naddCustomElement('temba-charcount', CharCount);\naddCustomElement('temba-contact-history', ContactHistory);\naddCustomElement('temba-contact-chat', ContactChat);\naddCustomElement('temba-contact-details', ContactDetails);\naddCustomElement('temba-ticket-list', TicketList);\naddCustomElement('temba-list', TembaList);\naddCustomElement('temba-sortable-list', SortableList);\naddCustomElement('temba-run-list', RunList);\naddCustomElement('temba-flow-details', FlowStoreElement);\naddCustomElement('temba-label', Label);\naddCustomElement('temba-menu', TembaMenu);\naddCustomElement('temba-remote', Remote);\naddCustomElement('temba-contact-search', ContactSearch);\naddCustomElement('temba-icon', VectorIcon);\naddCustomElement('temba-dropdown', Dropdown);\naddCustomElement('temba-tabs', TabPane);\naddCustomElement('temba-tab', Tab);\naddCustomElement('temba-contact-badges', ContactBadges);\naddCustomElement('temba-contact-pending', ContactPending);\naddCustomElement('temba-contact-tickets', ContactTickets);\naddCustomElement('temba-slider', TembaSlider);\naddCustomElement('temba-content-menu', ContentMenu);\n"]}
1
+ {"version":3,"file":"temba-modules.js","sourceRoot":"","sources":["../temba-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CA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AAC,CAAC;AACzD,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AACvC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAC1C,gBAAgB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AACzC,gBAAgB,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;AACxD,gBAAgB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC3C,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AAC7C,gBAAgB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AACxC,gBAAgB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACnC,gBAAgB,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;AACxD,gBAAgB,CAAC,uBAAuB,EAAE,cAAc,CAAC,CAAC;AAC1D,gBAAgB,CAAC,uBAAuB,EAAE,cAAc,CAAC,CAAC;AAC1D,gBAAgB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9C,gBAAgB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;AACpD,gBAAgB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC","sourcesContent":["import { Checkbox } from './src/checkbox/Checkbox';\nimport { TextInput } from './src/textinput/TextInput';\nimport { Store } from './src/store/Store';\nimport { Select } from './src/select/Select';\nimport { Completion } from './src/completion/Completion';\nimport { Modax } from './src/dialog/Modax';\nimport { Dialog } from './src/dialog/Dialog';\nimport { Button } from './src/button/Button';\nimport { FormField } from './src/formfield/FormField';\nimport { Loading } from './src/loading/Loading';\nimport { CharCount } from './src/charcount/CharCount';\nimport { Options } from './src/options/Options';\nimport { ContactChat } from './src/contacts/ContactChat';\nimport { ContactHistory } from './src/contacts/ContactHistory';\nimport { TicketList } from './src/list/TicketList';\nimport { ContactDetails } from './src/contacts/ContactDetails';\nimport { TembaList } from './src/list/TembaList';\nimport { ContactSearch } from './src/contactsearch/ContactSearch';\nimport { VectorIcon } from './src/vectoricon/VectorIcon';\nimport { Alert } from './src/alert/Alert';\nimport { Omnibox } from './src/omnibox/Omnibox';\nimport { Tip } from './src/tip/Tip';\nimport { TembaMenu } from './src/list/TembaMenu';\nimport { Anchor } from './src/anchor/Anchor';\nimport { Dropdown } from './src/dropdown/Dropdown';\nimport { TabPane } from './src/tabpane/TabPane';\nimport { Tab } from './src/tabpane/Tab';\nimport Label from './src/label/Label';\nimport { ContactName } from './src/contacts/ContactName';\nimport { ContactUrn } from './src/contacts/ContactUrn';\nimport { ContactFields } from './src/contacts/ContactFields';\nimport { ContactFieldEditor } from './src/contacts/ContactFieldEditor';\n\nimport { ContactBadges } from './src/contacts/ContactBadges';\nimport { ContactPending } from './src/contacts/ContactPending';\nimport { ContactTickets } from './src/contacts/ContactTickets';\nimport { TembaSlider } from './src/slider/TembaSlider';\nimport { RunList } from './src/list/RunList';\nimport { FlowStoreElement } from './src/flow/FlowStoreElement';\nimport { ContactNameFetch } from './src/contacts/ContactNameFetch';\nimport DatePicker from './src/datepicker/DatePicker';\nimport { FieldManager } from './src/fields/FieldManager';\nimport { SortableList } from './src/list/SortableList';\nimport { ContentMenu } from './src/list/ContentMenu';\nimport { TembaDate } from './src/date/TembaDate';\nimport Remote from './src/remote/Remote';\nimport { Compose } from './src/compose/Compose';\n\nexport function addCustomElement(name: string, comp: any) {\n if (!window.customElements.get(name)) {\n window.customElements.define(name, comp);\n }\n}\n\naddCustomElement('temba-anchor', Anchor);\naddCustomElement('temba-alert', Alert);\naddCustomElement('temba-store', Store);\naddCustomElement('temba-textinput', TextInput);\naddCustomElement('temba-datepicker', DatePicker);\naddCustomElement('temba-date', TembaDate);\naddCustomElement('temba-completion', Completion);\naddCustomElement('temba-checkbox', Checkbox);\naddCustomElement('temba-select', Select);\naddCustomElement('temba-options', Options);\naddCustomElement('temba-loading', Loading);\naddCustomElement('temba-button', Button);\naddCustomElement('temba-omnibox', Omnibox);\naddCustomElement('temba-tip', Tip);\naddCustomElement('temba-contact-name', ContactName);\naddCustomElement('temba-contact-name-fetch', ContactNameFetch);\naddCustomElement('temba-contact-field', ContactFieldEditor);\naddCustomElement('temba-contact-fields', ContactFields);\naddCustomElement('temba-field-manager', FieldManager);\naddCustomElement('temba-urn', ContactUrn);\naddCustomElement('temba-content-menu', ContentMenu);\n\naddCustomElement('temba-field', FormField);\naddCustomElement('temba-dialog', Dialog);\naddCustomElement('temba-modax', Modax);\naddCustomElement('temba-charcount', CharCount);\naddCustomElement('temba-contact-history', ContactHistory);\naddCustomElement('temba-contact-chat', ContactChat);\naddCustomElement('temba-contact-details', ContactDetails);\naddCustomElement('temba-ticket-list', TicketList);\naddCustomElement('temba-list', TembaList);\naddCustomElement('temba-sortable-list', SortableList);\naddCustomElement('temba-run-list', RunList);\naddCustomElement('temba-flow-details', FlowStoreElement);\naddCustomElement('temba-label', Label);\naddCustomElement('temba-menu', TembaMenu);\naddCustomElement('temba-remote', Remote);\naddCustomElement('temba-contact-search', ContactSearch);\naddCustomElement('temba-icon', VectorIcon);\naddCustomElement('temba-dropdown', Dropdown);\naddCustomElement('temba-tabs', TabPane);\naddCustomElement('temba-tab', Tab);\naddCustomElement('temba-contact-badges', ContactBadges);\naddCustomElement('temba-contact-pending', ContactPending);\naddCustomElement('temba-contact-tickets', ContactTickets);\naddCustomElement('temba-slider', TembaSlider);\naddCustomElement('temba-content-menu', ContentMenu);\naddCustomElement('temba-compose', Compose);\n"]}
@@ -0,0 +1,432 @@
1
+ import { assert, expect } from '@open-wc/testing';
2
+ import { Compose } from '../src/compose/Compose';
3
+ import { assertScreenshot, getClip, getComponent } from './utils.test';
4
+ const TAG = 'temba-compose';
5
+ const getCompose = async (attrs = {}, width = 500, height = 500) => {
6
+ const compose = (await getComponent(TAG, attrs, '', width, height, 'display:flex;flex-direction:column;flex-grow:1;'));
7
+ return compose;
8
+ };
9
+ const upload_endpoint = '/msgmedia/upload/';
10
+ export const updateComponent = async (compose, text, attachments, errorAttachments) => {
11
+ compose.currentChat = text ? text : '';
12
+ compose.values = attachments ? attachments : [];
13
+ compose.errorValues = errorAttachments ? errorAttachments : [];
14
+ await compose.updateComplete;
15
+ };
16
+ export const getSuccessText = () => {
17
+ return 'sà-wàd-dee!';
18
+ };
19
+ export const getFailText = () => {
20
+ // return a string that is 640+ chars
21
+ return "p}h<r0P<?SCIbV1+pwW1Hj8g^J&=Sm2f)K=5LjFFUZ№5@ybpoLZ7DJ(27qdWxQMaO)I1nB4(D%d3c(H)QXOF6F?4>&d{lhd5?0`Lio!yAGMO№*AxN5{z5s.IO*dy?tm}vXJ#Lf-HlD;xmNp}0<P42=w#ll9)B-e9>Q#'{~Vp<dl:xC9`T^lhh@TosCZ^:(H<Ji<E(~PojvYk^rPB+poYy^Ne~Su1:9?IgH'4S5Q9v0g№FEIUc~!{S7;746j'Sd@Nfu3=x?CsuR;YLP4j+AOzDARZG?0(Ji(NMg=r%n0Fq?R1?E%Yf`bcoVZAJ^bl0J'^@;lH>T.HmxYxwS;1?(bfrh?pRdd73:iMxrfx5luQ(}<dCD1b3g'G0CtkB№;8KkbL=>krG{RO%Va4wwr%P>jE*+n(E11}Ju9#<.f^)<MTH09^b{RQv7~H`#@Hda6{MV&H@xdyEKq#M@nZng8WTU66!F@*!)w*EpQ+65XKuQCaESgq=PHmtqi@l;F?PHvl^g@Z:+}}Xyr`IC2=3?20^I'qSU*tkyinM^JF.ZI>}~XzRQJn№v3o-w?Vy&gC:c.l(&9{`M#-'N}{T#7lw8(4:iY621'>C^.&hVZn:R!G}Ek){D#'KkiJWawq#7~GLBN*?V!ncw)d%&(tXj";
22
+ };
23
+ export const getSuccessFiles = (numFiles = 2) => {
24
+ const attachments = [];
25
+ let index = 1;
26
+ while (index <= numFiles) {
27
+ const s = 's' + index;
28
+ const attachment = {
29
+ uuid: s,
30
+ content_type: 'image/png',
31
+ type: 'image/png',
32
+ name: 'name_' + s,
33
+ url: 'url_' + s,
34
+ size: 1024,
35
+ error: null,
36
+ };
37
+ attachments.push(attachment);
38
+ index++;
39
+ }
40
+ return attachments;
41
+ };
42
+ export const getFailFiles = () => {
43
+ const f1 = 'f1';
44
+ const fail1 = {
45
+ uuid: f1,
46
+ content_type: 'image/png',
47
+ type: 'image/png',
48
+ name: 'name_' + f1,
49
+ url: 'url_' + f1,
50
+ size: 26624,
51
+ error: 'Limit for file uploads is 25.0 MB',
52
+ };
53
+ const f2 = 'f2';
54
+ const fail2 = {
55
+ uuid: f2,
56
+ content_type: 'application/octet-stream',
57
+ type: 'application/octet-stream',
58
+ name: 'name_' + f2,
59
+ url: 'url_' + f2,
60
+ size: 1024,
61
+ error: 'Unsupported file type',
62
+ };
63
+ return [fail1, fail2];
64
+ };
65
+ const getLongTextWithSpaces = () => {
66
+ // for a test width of 500, return a string that is 60+ chars with spaces
67
+ return 'bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb ';
68
+ };
69
+ const getLongTextWithNoSpaces = () => {
70
+ // for a test width of 500, return a string that is 60+ chars with no spaces
71
+ return 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
72
+ };
73
+ const getLongTextWithUrl = () => {
74
+ // for a test width of 500, return a url that is 60+ chars with no spaces
75
+ return 'http://www.yourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmom.com';
76
+ };
77
+ describe('temba-compose chatbox', () => {
78
+ it('can be created', async () => {
79
+ const compose = await getCompose();
80
+ assert.instanceOf(compose, Compose);
81
+ expect(compose.endpoint).equals(upload_endpoint);
82
+ });
83
+ it('cannot be created with a different endpoint', async () => {
84
+ const compose = await getCompose({
85
+ endpoint: '/schmsgmedia/schmupload/',
86
+ });
87
+ assert.instanceOf(compose, Compose);
88
+ expect(compose.endpoint).equals(upload_endpoint);
89
+ });
90
+ it('chatbox no counter no send button', async () => {
91
+ const compose = await getCompose({
92
+ chatbox: true,
93
+ });
94
+ await assertScreenshot('compose/chatbox-no-counter-no-send-button', getClip(compose));
95
+ });
96
+ it('chatbox no counter and send button', async () => {
97
+ const compose = await getCompose({
98
+ chatbox: true,
99
+ button: true,
100
+ });
101
+ await assertScreenshot('compose/chatbox-no-counter-and-send-button', getClip(compose));
102
+ });
103
+ it('chatbox counter no send button', async () => {
104
+ const compose = await getCompose({
105
+ chatbox: true,
106
+ counter: true,
107
+ });
108
+ await assertScreenshot('compose/chatbox-counter-no-send-button', getClip(compose));
109
+ });
110
+ it('chatbox counter and send button', async () => {
111
+ const compose = await getCompose({
112
+ chatbox: true,
113
+ counter: true,
114
+ button: true,
115
+ });
116
+ await assertScreenshot('compose/chatbox-counter-and-send-button', getClip(compose));
117
+ });
118
+ it('chatbox with text', async () => {
119
+ const compose = await getCompose({
120
+ chatbox: true,
121
+ counter: true,
122
+ button: true,
123
+ });
124
+ await updateComponent(compose, getSuccessText());
125
+ await assertScreenshot('compose/chatbox-with-text', getClip(compose));
126
+ });
127
+ it('chatbox with text and spaces', async () => {
128
+ const compose = await getCompose({
129
+ chatbox: true,
130
+ counter: true,
131
+ button: true,
132
+ });
133
+ await updateComponent(compose, getLongTextWithSpaces());
134
+ await assertScreenshot('compose/chatbox-with-text-and-spaces', getClip(compose));
135
+ });
136
+ it('chatbox with text and no spaces', async () => {
137
+ const compose = await getCompose({
138
+ chatbox: true,
139
+ counter: true,
140
+ button: true,
141
+ });
142
+ await updateComponent(compose, getLongTextWithNoSpaces());
143
+ await assertScreenshot('compose/chatbox-with-text-no-spaces', getClip(compose));
144
+ });
145
+ it('chatbox with text and url', async () => {
146
+ const compose = await getCompose({
147
+ chatbox: true,
148
+ counter: true,
149
+ button: true,
150
+ });
151
+ await updateComponent(compose, getLongTextWithUrl());
152
+ await assertScreenshot('compose/chatbox-with-text-and-url', getClip(compose));
153
+ });
154
+ it('chatbox with text and click send', async () => {
155
+ const compose = await getCompose({
156
+ chatbox: true,
157
+ counter: true,
158
+ button: true,
159
+ });
160
+ await updateComponent(compose, getSuccessText());
161
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
162
+ send.click();
163
+ await assertScreenshot('compose/chatbox-with-text-and-click-send', getClip(compose));
164
+ });
165
+ it('chatbox with text and hit enter', async () => {
166
+ const compose = await getCompose({
167
+ chatbox: true,
168
+ counter: true,
169
+ button: true,
170
+ });
171
+ await updateComponent(compose, getSuccessText());
172
+ const completion = compose.shadowRoot.querySelector('temba-completion');
173
+ completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
174
+ await assertScreenshot('compose/chatbox-with-text-and-hit-enter', getClip(compose));
175
+ });
176
+ });
177
+ describe('temba-compose attachments', () => {
178
+ it('attachments no send button', async () => {
179
+ const compose = await getCompose({
180
+ attachments: true,
181
+ });
182
+ await assertScreenshot('compose/attachments-no-send-button', getClip(compose));
183
+ });
184
+ it('attachments and send button', async () => {
185
+ const compose = await getCompose({
186
+ attachments: true,
187
+ button: true,
188
+ });
189
+ await assertScreenshot('compose/attachments-and-send-button', getClip(compose));
190
+ });
191
+ it('attachments with success uploaded files', async () => {
192
+ const compose = await getCompose({
193
+ attachments: true,
194
+ button: true,
195
+ });
196
+ await updateComponent(compose, null, getSuccessFiles());
197
+ await assertScreenshot('compose/attachments-with-success-files', getClip(compose));
198
+ });
199
+ it('attachments with failure uploaded files', async () => {
200
+ const compose = await getCompose({
201
+ attachments: true,
202
+ button: true,
203
+ });
204
+ await updateComponent(compose, null, null, getFailFiles());
205
+ await assertScreenshot('compose/attachments-with-failure-files', getClip(compose));
206
+ });
207
+ it('attachments with success and failure uploaded files', async () => {
208
+ const compose = await getCompose({
209
+ attachments: true,
210
+ button: true,
211
+ });
212
+ await updateComponent(compose, null, getSuccessFiles(), getFailFiles());
213
+ await assertScreenshot('compose/attachments-with-all-files', getClip(compose));
214
+ });
215
+ it('attachments with success uploaded files and click send', async () => {
216
+ const compose = await getCompose({
217
+ attachments: true,
218
+ button: true,
219
+ });
220
+ await updateComponent(compose, null, getSuccessFiles());
221
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
222
+ send.click();
223
+ await assertScreenshot('compose/attachments-with-success-files-and-click-send', getClip(compose));
224
+ });
225
+ it('attachments with success and failure uploaded files and click send', async () => {
226
+ const compose = await getCompose({
227
+ attachments: true,
228
+ button: true,
229
+ });
230
+ await updateComponent(compose, null, getSuccessFiles(), getFailFiles());
231
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
232
+ send.click();
233
+ await assertScreenshot('compose/attachments-with-all-files-and-click-send', getClip(compose));
234
+ });
235
+ });
236
+ describe('temba-compose chatbox and attachments', () => {
237
+ it('chatbox and attachments no counter no send button', async () => {
238
+ const compose = await getCompose({
239
+ chatbox: true,
240
+ attachments: true,
241
+ });
242
+ await assertScreenshot('compose/chatbox-attachments-no-counter-no-send-button', getClip(compose));
243
+ });
244
+ it('chatbox and attachments no counter and send button', async () => {
245
+ const compose = await getCompose({
246
+ chatbox: true,
247
+ attachments: true,
248
+ button: true,
249
+ });
250
+ await assertScreenshot('compose/chatbox-attachments-no-counter-and-send-button', getClip(compose));
251
+ });
252
+ it('chatbox and attachments counter no send button', async () => {
253
+ const compose = await getCompose({
254
+ chatbox: true,
255
+ attachments: true,
256
+ counter: true,
257
+ });
258
+ await assertScreenshot('compose/chatbox-attachments-counter-no-send-button', getClip(compose));
259
+ });
260
+ it('chatbox and attachments counter and send button', async () => {
261
+ const compose = await getCompose({
262
+ chatbox: true,
263
+ attachments: true,
264
+ counter: true,
265
+ button: true,
266
+ });
267
+ await assertScreenshot('compose/chatbox-attachments-counter-and-send-button', getClip(compose));
268
+ });
269
+ });
270
+ describe('temba-compose chatbox with text and attachments no files', () => {
271
+ it('chatbox with text, attachments no files', async () => {
272
+ const compose = await getCompose({
273
+ chatbox: true,
274
+ attachments: true,
275
+ counter: true,
276
+ button: true,
277
+ });
278
+ compose.currentChat = 'sà-wàd-dee!';
279
+ await assertScreenshot('compose/chatbox-with-text-attachments-no-files', getClip(compose));
280
+ });
281
+ it('chatbox with text, attachments no files, and click send', async () => {
282
+ const compose = await getCompose({
283
+ chatbox: true,
284
+ attachments: true,
285
+ counter: true,
286
+ button: true,
287
+ });
288
+ compose.currentChat = 'sà-wàd-dee!';
289
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
290
+ send.click();
291
+ await assertScreenshot('compose/chatbox-with-text-attachments-no-files-and-click-send', getClip(compose));
292
+ });
293
+ it('chatbox with text, attachments no files, and hit enter', async () => {
294
+ const compose = await getCompose({
295
+ chatbox: true,
296
+ attachments: true,
297
+ counter: true,
298
+ button: true,
299
+ });
300
+ await updateComponent(compose, getSuccessText());
301
+ const completion = compose.shadowRoot.querySelector('temba-completion');
302
+ completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
303
+ await assertScreenshot('compose/chatbox-with-text-attachments-no-files-and-hit-enter', getClip(compose));
304
+ });
305
+ });
306
+ describe('temba-compose chatbox no text and attachments with files', () => {
307
+ it('chatbox no text, attachments with success uploaded files', async () => {
308
+ const compose = await getCompose({
309
+ chatbox: true,
310
+ attachments: true,
311
+ button: true,
312
+ });
313
+ await updateComponent(compose, null, getSuccessFiles());
314
+ await assertScreenshot('compose/chatbox-no-text-attachments-with-success-files', getClip(compose));
315
+ });
316
+ it('chatbox no text, attachments with failure uploaded files', async () => {
317
+ const compose = await getCompose({
318
+ chatbox: true,
319
+ attachments: true,
320
+ button: true,
321
+ });
322
+ await updateComponent(compose, null, null, getFailFiles());
323
+ await assertScreenshot('compose/chatbox-no-text-attachments-with-failure-files', getClip(compose));
324
+ });
325
+ it('chatbox no text, attachments with success and failure uploaded files', async () => {
326
+ const compose = await getCompose({
327
+ chatbox: true,
328
+ attachments: true,
329
+ button: true,
330
+ });
331
+ await updateComponent(compose, null, getSuccessFiles(), getFailFiles());
332
+ await assertScreenshot('compose/chatbox-no-text-attachments-with-all-files', getClip(compose));
333
+ });
334
+ // todo fix this test - button should be enabled
335
+ it('chatbox no text, attachments with success uploaded files, and click send', async () => {
336
+ const compose = await getCompose({
337
+ chatbox: true,
338
+ attachments: true,
339
+ button: true,
340
+ });
341
+ await updateComponent(compose, null, getSuccessFiles());
342
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
343
+ send.click();
344
+ await assertScreenshot('compose/chatbox-no-text-attachments-with-success-files-and-click-send', getClip(compose));
345
+ });
346
+ it('chatbox no text, attachments with success and failure uploaded files, and click send', async () => {
347
+ const compose = await getCompose({
348
+ chatbox: true,
349
+ attachments: true,
350
+ button: true,
351
+ });
352
+ await updateComponent(compose, null, getSuccessFiles(), getFailFiles());
353
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
354
+ send.click();
355
+ await assertScreenshot('compose/chatbox-no-text-attachments-with-all-files-and-click-send', getClip(compose));
356
+ });
357
+ });
358
+ describe('temba-compose chatbox with text and attachments with files', () => {
359
+ it('chatbox with text, attachments with success uploaded files', async () => {
360
+ const compose = await getCompose({
361
+ chatbox: true,
362
+ attachments: true,
363
+ button: true,
364
+ });
365
+ await updateComponent(compose, getSuccessText(), getSuccessFiles());
366
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-success-files', getClip(compose));
367
+ });
368
+ it('chatbox with text, attachments with failure uploaded files', async () => {
369
+ const compose = await getCompose({
370
+ chatbox: true,
371
+ attachments: true,
372
+ button: true,
373
+ });
374
+ await updateComponent(compose, getSuccessText(), null, getFailFiles());
375
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-failure-files', getClip(compose));
376
+ });
377
+ it('chatbox with text, attachments with success and failure uploaded files', async () => {
378
+ const compose = await getCompose({
379
+ chatbox: true,
380
+ attachments: true,
381
+ button: true,
382
+ });
383
+ await updateComponent(compose, getSuccessText(), getSuccessFiles(), getFailFiles());
384
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-all-files', getClip(compose));
385
+ });
386
+ it('chatbox with text, attachments with success uploaded files, and click send', async () => {
387
+ const compose = await getCompose({
388
+ chatbox: true,
389
+ attachments: true,
390
+ button: true,
391
+ });
392
+ await updateComponent(compose, getSuccessText(), getSuccessFiles());
393
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
394
+ send.click();
395
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-success-files-and-click-send', getClip(compose));
396
+ });
397
+ it('chatbox with text, attachments with success and failure uploaded files, and click send', async () => {
398
+ const compose = await getCompose({
399
+ chatbox: true,
400
+ attachments: true,
401
+ button: true,
402
+ });
403
+ await updateComponent(compose, getSuccessText(), getSuccessFiles(), getFailFiles());
404
+ const send = compose.shadowRoot.querySelector('temba-button#send-button');
405
+ send.click();
406
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-all-files-and-click-send', getClip(compose));
407
+ });
408
+ it('chatbox with text, attachments with success uploaded files, and hit enter', async () => {
409
+ const compose = await getCompose({
410
+ chatbox: true,
411
+ attachments: true,
412
+ button: true,
413
+ });
414
+ await updateComponent(compose, getSuccessText(), getSuccessFiles());
415
+ const completion = compose.shadowRoot.querySelector('temba-completion');
416
+ completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
417
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-success-files-and-hit-enter', getClip(compose));
418
+ });
419
+ it('chatbox with text, attachments with success and failure uploaded files, and hit enter', async () => {
420
+ const compose = await getCompose({
421
+ chatbox: true,
422
+ attachments: true,
423
+ button: true,
424
+ });
425
+ await updateComponent(compose, getSuccessText(), getSuccessFiles(), getFailFiles());
426
+ const completion = compose.shadowRoot.querySelector('temba-completion');
427
+ completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
428
+ const newClip = getClip(compose);
429
+ await assertScreenshot('compose/chatbox-with-text-attachments-with-all-files-and-hit-enter', newClip);
430
+ });
431
+ });
432
+ //# sourceMappingURL=temba-compose.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temba-compose.test.js","sourceRoot":"","sources":["../../test/temba-compose.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAW,MAAM,kBAAkB,CA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CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,KAAK,IAAI,EAAE;QACzF,MAAM,OAAO,GAAY,MAAM,UAAU,CAAC;YACxC,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,MAAM,eAAe,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;QACpE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CACjD,kBAAkB,CACL,CAAC;QAChB,UAAU,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACzE,MAAM,gBAAgB,CACpB,wEAAwE,EACxE,OAAO,CAAC,OAAO,CAAC,CACjB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uFAAuF,EAAE,KAAK,IAAI,EAAE;QACrG,MAAM,OAAO,GAAY,MAAM,UAAU,CAAC;YACxC,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,MAAM,eAAe,CACnB,OAAO,EACP,cAAc,EAAE,EAChB,eAAe,EAAE,EACjB,YAAY,EAAE,CACf,CAAC;QACF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CACjD,kBAAkB,CACL,CAAC;QAChB,UAAU,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,gBAAgB,CACpB,oEAAoE,EACpE,OAAO,CACR,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { assert, expect, fixture } from '@open-wc/testing';\nimport { Attachment, Compose } from '../src/compose/Compose';\nimport { assertScreenshot, getClip, getComponent } from './utils.test';\nimport { Button } from '../src/button/Button';\nimport { Completion } from '../src/completion/Completion';\n\nconst TAG = 'temba-compose';\nconst getCompose = async (attrs: any = {}, width = 500, height = 500) => {\n const compose = (await getComponent(\n TAG,\n attrs,\n '',\n width,\n height,\n 'display:flex;flex-direction:column;flex-grow:1;'\n )) as Compose;\n return compose;\n};\n\nconst upload_endpoint = '/msgmedia/upload/';\n\nexport const updateComponent = async (\n compose: Compose,\n text?: string,\n attachments?: Attachment[],\n errorAttachments?: Attachment[]\n): Promise<void> => {\n compose.currentChat = text ? text : '';\n compose.values = attachments ? attachments : [];\n compose.errorValues = errorAttachments ? errorAttachments : [];\n await compose.updateComplete;\n};\nexport const getSuccessText = () => {\n return 'sà-wàd-dee!';\n};\nexport const getFailText = () => {\n // return a string that is 640+ chars\n return \"p}h<r0P<?SCIbV1+pwW1Hj8g^J&=Sm2f)K=5LjFFUZ№5@ybpoLZ7DJ(27qdWxQMaO)I1nB4(D%d3c(H)QXOF6F?4>&d{lhd5?0`Lio!yAGMO№*AxN5{z5s.IO*dy?tm}vXJ#Lf-HlD;xmNp}0<P42=w#ll9)B-e9>Q#'{~Vp<dl:xC9`T^lhh@TosCZ^:(H<Ji<E(~PojvYk^rPB+poYy^Ne~Su1:9?IgH'4S5Q9v0g№FEIUc~!{S7;746j'Sd@Nfu3=x?CsuR;YLP4j+AOzDARZG?0(Ji(NMg=r%n0Fq?R1?E%Yf`bcoVZAJ^bl0J'^@;lH>T.HmxYxwS;1?(bfrh?pRdd73:iMxrfx5luQ(}<dCD1b3g'G0CtkB№;8KkbL=>krG{RO%Va4wwr%P>jE*+n(E11}Ju9#<.f^)<MTH09^b{RQv7~H`#@Hda6{MV&H@xdyEKq#M@nZng8WTU66!F@*!)w*EpQ+65XKuQCaESgq=PHmtqi@l;F?PHvl^g@Z:+}}Xyr`IC2=3?20^I'qSU*tkyinM^JF.ZI>}~XzRQJn№v3o-w?Vy&gC:c.l(&9{`M#-'N}{T#7lw8(4:iY621'>C^.&hVZn:R!G}Ek){D#'KkiJWawq#7~GLBN*?V!ncw)d%&(tXj\";\n};\n\nexport const getSuccessFiles = (numFiles = 2): Attachment[] => {\n const attachments = [];\n let index = 1;\n while (index <= numFiles) {\n const s = 's' + index;\n const attachment = {\n uuid: s,\n content_type: 'image/png',\n type: 'image/png',\n name: 'name_' + s,\n url: 'url_' + s,\n size: 1024,\n error: null,\n } as Attachment;\n attachments.push(attachment);\n index++;\n }\n return attachments;\n};\nexport const getFailFiles = (): Attachment[] => {\n const f1 = 'f1';\n const fail1 = {\n uuid: f1,\n content_type: 'image/png',\n type: 'image/png',\n name: 'name_' + f1,\n url: 'url_' + f1,\n size: 26624,\n error: 'Limit for file uploads is 25.0 MB',\n } as Attachment;\n const f2 = 'f2';\n const fail2 = {\n uuid: f2,\n content_type: 'application/octet-stream',\n type: 'application/octet-stream',\n name: 'name_' + f2,\n url: 'url_' + f2,\n size: 1024,\n error: 'Unsupported file type',\n } as Attachment;\n\n return [fail1, fail2];\n};\n\nconst getLongTextWithSpaces = () => {\n // for a test width of 500, return a string that is 60+ chars with spaces\n return 'bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb bbbbbbbbbb ';\n};\nconst getLongTextWithNoSpaces = () => {\n // for a test width of 500, return a string that is 60+ chars with no spaces\n return 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';\n};\nconst getLongTextWithUrl = () => {\n // for a test width of 500, return a url that is 60+ chars with no spaces\n return 'http://www.yourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmomyourmom.com';\n};\n\ndescribe('temba-compose chatbox', () => {\n it('can be created', async () => {\n const compose: Compose = await getCompose();\n assert.instanceOf(compose, Compose);\n expect(compose.endpoint).equals(upload_endpoint);\n });\n\n it('cannot be created with a different endpoint', async () => {\n const compose: Compose = await getCompose({\n endpoint: '/schmsgmedia/schmupload/',\n });\n assert.instanceOf(compose, Compose);\n expect(compose.endpoint).equals(upload_endpoint);\n });\n\n it('chatbox no counter no send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n });\n await assertScreenshot(\n 'compose/chatbox-no-counter-no-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox no counter and send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n button: true,\n });\n await assertScreenshot(\n 'compose/chatbox-no-counter-and-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox counter no send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n });\n await assertScreenshot(\n 'compose/chatbox-counter-no-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox counter and send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await assertScreenshot(\n 'compose/chatbox-counter-and-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox with text', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText());\n await assertScreenshot('compose/chatbox-with-text', getClip(compose));\n });\n\n it('chatbox with text and spaces', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getLongTextWithSpaces());\n await assertScreenshot(\n 'compose/chatbox-with-text-and-spaces',\n getClip(compose)\n );\n });\n\n it('chatbox with text and no spaces', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getLongTextWithNoSpaces());\n await assertScreenshot(\n 'compose/chatbox-with-text-no-spaces',\n getClip(compose)\n );\n });\n\n it('chatbox with text and url', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getLongTextWithUrl());\n await assertScreenshot(\n 'compose/chatbox-with-text-and-url',\n getClip(compose)\n );\n });\n\n it('chatbox with text and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-with-text-and-click-send',\n getClip(compose)\n );\n });\n\n it('chatbox with text and hit enter', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText());\n const completion = compose.shadowRoot.querySelector(\n 'temba-completion'\n ) as Completion;\n completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));\n await assertScreenshot(\n 'compose/chatbox-with-text-and-hit-enter',\n getClip(compose)\n );\n });\n});\n\ndescribe('temba-compose attachments', () => {\n it('attachments no send button', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n });\n await assertScreenshot(\n 'compose/attachments-no-send-button',\n getClip(compose)\n );\n });\n\n it('attachments and send button', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await assertScreenshot(\n 'compose/attachments-and-send-button',\n getClip(compose)\n );\n });\n\n it('attachments with success uploaded files', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles());\n await assertScreenshot(\n 'compose/attachments-with-success-files',\n getClip(compose)\n );\n });\n\n it('attachments with failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, null, getFailFiles());\n await assertScreenshot(\n 'compose/attachments-with-failure-files',\n getClip(compose)\n );\n });\n\n it('attachments with success and failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles(), getFailFiles());\n await assertScreenshot(\n 'compose/attachments-with-all-files',\n getClip(compose)\n );\n });\n\n it('attachments with success uploaded files and click send', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/attachments-with-success-files-and-click-send',\n getClip(compose)\n );\n });\n\n it('attachments with success and failure uploaded files and click send', async () => {\n const compose: Compose = await getCompose({\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles(), getFailFiles());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/attachments-with-all-files-and-click-send',\n getClip(compose)\n );\n });\n});\n\ndescribe('temba-compose chatbox and attachments', () => {\n it('chatbox and attachments no counter no send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n });\n await assertScreenshot(\n 'compose/chatbox-attachments-no-counter-no-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox and attachments no counter and send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await assertScreenshot(\n 'compose/chatbox-attachments-no-counter-and-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox and attachments counter no send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n counter: true,\n });\n await assertScreenshot(\n 'compose/chatbox-attachments-counter-no-send-button',\n getClip(compose)\n );\n });\n\n it('chatbox and attachments counter and send button', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n counter: true,\n button: true,\n });\n await assertScreenshot(\n 'compose/chatbox-attachments-counter-and-send-button',\n getClip(compose)\n );\n });\n});\n\ndescribe('temba-compose chatbox with text and attachments no files', () => {\n it('chatbox with text, attachments no files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n counter: true,\n button: true,\n });\n compose.currentChat = 'sà-wàd-dee!';\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-no-files',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments no files, and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n counter: true,\n button: true,\n });\n compose.currentChat = 'sà-wàd-dee!';\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-no-files-and-click-send',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments no files, and hit enter', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n counter: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText());\n const completion = compose.shadowRoot.querySelector(\n 'temba-completion'\n ) as Completion;\n completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-no-files-and-hit-enter',\n getClip(compose)\n );\n });\n});\n\ndescribe('temba-compose chatbox no text and attachments with files', () => {\n it('chatbox no text, attachments with success uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles());\n await assertScreenshot(\n 'compose/chatbox-no-text-attachments-with-success-files',\n getClip(compose)\n );\n });\n\n it('chatbox no text, attachments with failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, null, getFailFiles());\n await assertScreenshot(\n 'compose/chatbox-no-text-attachments-with-failure-files',\n getClip(compose)\n );\n });\n\n it('chatbox no text, attachments with success and failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles(), getFailFiles());\n await assertScreenshot(\n 'compose/chatbox-no-text-attachments-with-all-files',\n getClip(compose)\n );\n });\n\n // todo fix this test - button should be enabled\n it('chatbox no text, attachments with success uploaded files, and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-no-text-attachments-with-success-files-and-click-send',\n getClip(compose)\n );\n });\n\n it('chatbox no text, attachments with success and failure uploaded files, and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, null, getSuccessFiles(), getFailFiles());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-no-text-attachments-with-all-files-and-click-send',\n getClip(compose)\n );\n });\n});\n\ndescribe('temba-compose chatbox with text and attachments with files', () => {\n it('chatbox with text, attachments with success uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText(), getSuccessFiles());\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-success-files',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText(), null, getFailFiles());\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-failure-files',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with success and failure uploaded files', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(\n compose,\n getSuccessText(),\n getSuccessFiles(),\n getFailFiles()\n );\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-all-files',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with success uploaded files, and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText(), getSuccessFiles());\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-success-files-and-click-send',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with success and failure uploaded files, and click send', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(\n compose,\n getSuccessText(),\n getSuccessFiles(),\n getFailFiles()\n );\n const send = compose.shadowRoot.querySelector(\n 'temba-button#send-button'\n ) as Button;\n send.click();\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-all-files-and-click-send',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with success uploaded files, and hit enter', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(compose, getSuccessText(), getSuccessFiles());\n const completion = compose.shadowRoot.querySelector(\n 'temba-completion'\n ) as Completion;\n completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-success-files-and-hit-enter',\n getClip(compose)\n );\n });\n\n it('chatbox with text, attachments with success and failure uploaded files, and hit enter', async () => {\n const compose: Compose = await getCompose({\n chatbox: true,\n attachments: true,\n button: true,\n });\n await updateComponent(\n compose,\n getSuccessText(),\n getSuccessFiles(),\n getFailFiles()\n );\n const completion = compose.shadowRoot.querySelector(\n 'temba-completion'\n ) as Completion;\n completion.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));\n const newClip = getClip(compose);\n await assertScreenshot(\n 'compose/chatbox-with-text-attachments-with-all-files-and-hit-enter',\n newClip\n );\n });\n});\n"]}