@nyaruka/temba-components 0.108.7 → 0.109.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/dist/static/svg/index.svg +1 -1
  3. package/dist/temba-components.js +602 -455
  4. package/dist/temba-components.js.map +1 -1
  5. package/out-tsc/src/charcount/CharCount.js +4 -5
  6. package/out-tsc/src/charcount/CharCount.js.map +1 -1
  7. package/out-tsc/src/completion/Completion.js +27 -16
  8. package/out-tsc/src/completion/Completion.js.map +1 -1
  9. package/out-tsc/src/compose/Compose.js +259 -95
  10. package/out-tsc/src/compose/Compose.js.map +1 -1
  11. package/out-tsc/src/contacts/ContactChat.js +18 -16
  12. package/out-tsc/src/contacts/ContactChat.js.map +1 -1
  13. package/out-tsc/src/contacts/ContactTickets.js +1 -1
  14. package/out-tsc/src/contacts/ContactTickets.js.map +1 -1
  15. package/out-tsc/src/interfaces.js.map +1 -1
  16. package/out-tsc/src/list/ShortcutList.js +125 -0
  17. package/out-tsc/src/list/ShortcutList.js.map +1 -0
  18. package/out-tsc/src/list/TembaList.js +8 -5
  19. package/out-tsc/src/list/TembaList.js.map +1 -1
  20. package/out-tsc/src/options/Options.js +46 -35
  21. package/out-tsc/src/options/Options.js.map +1 -1
  22. package/out-tsc/src/select/Select.js +1 -1
  23. package/out-tsc/src/select/Select.js.map +1 -1
  24. package/out-tsc/src/store/Store.js +18 -3
  25. package/out-tsc/src/store/Store.js.map +1 -1
  26. package/out-tsc/src/tabpane/Tab.js +2 -0
  27. package/out-tsc/src/tabpane/Tab.js.map +1 -1
  28. package/out-tsc/src/tabpane/TabPane.js +27 -5
  29. package/out-tsc/src/tabpane/TabPane.js.map +1 -1
  30. package/out-tsc/src/textinput/TextInput.js +7 -2
  31. package/out-tsc/src/textinput/TextInput.js.map +1 -1
  32. package/out-tsc/src/utils/index.js.map +1 -1
  33. package/out-tsc/src/vectoricon/index.js +2 -2
  34. package/out-tsc/src/vectoricon/index.js.map +1 -1
  35. package/out-tsc/temba-modules.js +2 -0
  36. package/out-tsc/temba-modules.js.map +1 -1
  37. package/out-tsc/test/temba-compose.test.js +26 -18
  38. package/out-tsc/test/temba-compose.test.js.map +1 -1
  39. package/out-tsc/test/temba-contact-chat.test.js +27 -18
  40. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  41. package/package.json +1 -1
  42. package/screenshots/truth/compose/attachments-and-send-button.png +0 -0
  43. package/screenshots/truth/compose/attachments-no-send-button.png +0 -0
  44. package/screenshots/truth/compose/attachments-with-all-files-and-click-send.png +0 -0
  45. package/screenshots/truth/compose/attachments-with-all-files.png +0 -0
  46. package/screenshots/truth/compose/attachments-with-failure-files.png +0 -0
  47. package/screenshots/truth/compose/attachments-with-success-files-and-click-send.png +0 -0
  48. package/screenshots/truth/compose/attachments-with-success-files.png +0 -0
  49. package/screenshots/truth/compose/chatbox-attachments-counter-and-send-button.png +0 -0
  50. package/screenshots/truth/compose/chatbox-attachments-counter-no-send-button.png +0 -0
  51. package/screenshots/truth/compose/chatbox-attachments-no-counter-and-send-button.png +0 -0
  52. package/screenshots/truth/compose/chatbox-attachments-no-counter-no-send-button.png +0 -0
  53. package/screenshots/truth/compose/chatbox-counter-and-send-button.png +0 -0
  54. package/screenshots/truth/compose/chatbox-counter-no-send-button.png +0 -0
  55. package/screenshots/truth/compose/chatbox-no-counter-and-send-button.png +0 -0
  56. package/screenshots/truth/compose/chatbox-no-counter-no-send-button.png +0 -0
  57. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png +0 -0
  58. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files.png +0 -0
  59. package/screenshots/truth/compose/chatbox-no-text-attachments-with-failure-files.png +0 -0
  60. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png +0 -0
  61. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files.png +0 -0
  62. package/screenshots/truth/compose/chatbox-with-text-and-click-send.png +0 -0
  63. package/screenshots/truth/compose/chatbox-with-text-and-hit-enter.png +0 -0
  64. package/screenshots/truth/compose/chatbox-with-text-and-spaces.png +0 -0
  65. package/screenshots/truth/compose/chatbox-with-text-and-url.png +0 -0
  66. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-click-send.png +0 -0
  67. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-hit-enter.png +0 -0
  68. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files.png +0 -0
  69. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png +0 -0
  70. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png +0 -0
  71. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files.png +0 -0
  72. package/screenshots/truth/compose/chatbox-with-text-attachments-with-failure-files.png +0 -0
  73. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-click-send.png +0 -0
  74. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png +0 -0
  75. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files.png +0 -0
  76. package/screenshots/truth/compose/chatbox-with-text-no-spaces.png +0 -0
  77. package/screenshots/truth/compose/chatbox-with-text.png +0 -0
  78. package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
  79. package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
  80. package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
  81. package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
  82. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
  83. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
  84. package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
  85. package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
  86. package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
  87. package/screenshots/truth/contacts/contact-active-default.png +0 -0
  88. package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
  89. package/screenshots/truth/counter/summary.png +0 -0
  90. package/screenshots/truth/counter/text.png +0 -0
  91. package/screenshots/truth/counter/unicode-variables.png +0 -0
  92. package/screenshots/truth/counter/unicode.png +0 -0
  93. package/screenshots/truth/counter/variable.png +0 -0
  94. package/src/charcount/CharCount.ts +4 -5
  95. package/src/completion/Completion.ts +33 -19
  96. package/src/compose/Compose.ts +289 -96
  97. package/src/contacts/ContactChat.ts +18 -16
  98. package/src/contacts/ContactTickets.ts +1 -1
  99. package/src/interfaces.ts +7 -0
  100. package/src/list/ShortcutList.ts +137 -0
  101. package/src/list/TembaList.ts +9 -6
  102. package/src/options/Options.ts +53 -44
  103. package/src/select/Select.ts +1 -1
  104. package/src/store/Store.ts +23 -4
  105. package/src/tabpane/Tab.ts +2 -0
  106. package/src/tabpane/TabPane.ts +28 -5
  107. package/src/textinput/TextInput.ts +9 -3
  108. package/src/utils/index.ts +8 -2
  109. package/src/vectoricon/index.ts +2 -2
  110. package/static/svg/index.svg +1 -1
  111. package/static/svg/work/traced/zap-fast.svg +1 -0
  112. package/static/svg/work/used/zap-fast.svg +3 -0
  113. package/temba-modules.ts +2 -0
  114. package/test/temba-compose.test.ts +28 -35
  115. package/test/temba-contact-chat.test.ts +28 -37
  116. package/test-assets/store/shortcuts.json +14 -0
  117. package/static/svg/work/traced/message-dots-circle.svg +0 -1
  118. package/static/svg/work/used/message-dots-circle.svg +0 -3
@@ -0,0 +1 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.212 2.440 C 15.636 3.081,9.418 11.876,9.163 12.409 C 8.732 13.313,9.241 14.256,10.271 14.462 C 10.540 14.516,11.682 14.560,12.810 14.560 L 14.860 14.560 14.778 15.080 C 14.395 17.517,14.007 20.972,14.082 21.290 C 14.132 21.504,14.372 21.776,14.615 21.893 C 14.990 22.073,15.112 22.069,15.422 21.866 C 15.816 21.609,22.435 12.433,22.839 11.585 C 23.130 10.977,23.018 10.381,22.528 9.924 C 22.210 9.628,21.970 9.600,19.739 9.600 C 18.397 9.600,17.268 9.546,17.231 9.480 C 17.193 9.414,17.332 8.136,17.540 6.640 C 17.988 3.411,18.027 2.642,17.761 2.321 C 17.455 1.953,16.590 2.019,16.212 2.440 M3.291 5.851 C 2.918 6.225,2.973 6.975,3.396 7.271 C 3.684 7.473,4.271 7.520,6.498 7.520 C 8.910 7.520,9.288 7.485,9.602 7.230 C 9.999 6.909,10.077 6.222,9.760 5.840 C 9.458 5.476,3.657 5.486,3.291 5.851 M15.212 8.792 C 14.972 10.343,14.995 10.963,15.304 11.220 C 15.492 11.377,16.276 11.463,18.024 11.520 L 20.481 11.600 18.601 14.233 C 17.406 15.908,16.703 16.767,16.669 16.592 C 16.640 16.440,16.693 15.818,16.788 15.208 C 17.028 13.657,17.005 13.037,16.696 12.780 C 16.508 12.623,15.724 12.537,13.976 12.480 L 11.519 12.400 13.399 9.767 C 14.594 8.092,15.297 7.233,15.331 7.408 C 15.360 7.560,15.307 8.182,15.212 8.792 M1.280 11.360 C 1.104 11.536,0.960 11.824,0.960 12.000 C 0.960 12.176,1.104 12.464,1.280 12.640 C 1.575 12.935,1.813 12.960,4.311 12.960 C 6.931 12.960,7.030 12.948,7.271 12.604 C 7.606 12.126,7.584 11.744,7.200 11.360 C 6.906 11.066,6.667 11.040,4.240 11.040 C 1.813 11.040,1.574 11.066,1.280 11.360 M2.916 16.729 C 2.504 17.017,2.443 17.699,2.787 18.169 C 2.999 18.459,3.231 18.480,6.221 18.480 C 8.997 18.480,9.464 18.444,9.694 18.214 C 10.075 17.833,10.029 17.116,9.602 16.770 C 9.286 16.513,8.902 16.480,6.258 16.480 C 3.814 16.480,3.207 16.525,2.916 16.729 " stroke="none" fill-rule="evenodd" fill="black"></path></svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9 17.5H3.5M6.5 12H2M9 6.5H4M17 3L10.4036 12.235C10.1116 12.6438 9.96562 12.8481 9.97194 13.0185C9.97744 13.1669 10.0486 13.3051 10.1661 13.3958C10.3011 13.5 10.5522 13.5 11.0546 13.5H16L15 21L21.5964 11.765C21.8884 11.3562 22.0344 11.1519 22.0281 10.9815C22.0226 10.8331 21.9514 10.6949 21.8339 10.6042C21.6989 10.5 21.4478 10.5 20.9454 10.5H16L17 3Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
package/temba-modules.ts CHANGED
@@ -61,6 +61,7 @@ import { ContactNotepad } from './src/contacts/ContactNotepad';
61
61
  import { OutboxMonitor } from './src/outboxmonitor/OutboxMonitor';
62
62
  import { ProgressBar } from './src/progress/ProgressBar';
63
63
  import { StartProgress } from './src/progress/StartProgress';
64
+ import { ShortcutList } from './src/list/ShortcutList';
64
65
 
65
66
  export function addCustomElement(name: string, comp: any) {
66
67
  if (!window.customElements.get(name)) {
@@ -132,3 +133,4 @@ addCustomElement('temba-contact-notepad', ContactNotepad);
132
133
  addCustomElement('temba-outbox-monitor', OutboxMonitor);
133
134
  addCustomElement('temba-progress', ProgressBar);
134
135
  addCustomElement('temba-start-progress', StartProgress);
136
+ addCustomElement('temba-shortcuts', ShortcutList);
@@ -1,7 +1,6 @@
1
1
  import { assert, expect } from '@open-wc/testing';
2
2
  import { Compose } from '../src/compose/Compose';
3
3
  import { assertScreenshot, getClip, getComponent } from './utils.test';
4
- import { Button } from '../src/button/Button';
5
4
  import { Completion } from '../src/completion/Completion';
6
5
  import { DEFAULT_MEDIA_ENDPOINT } from '../src/utils';
7
6
  import { Attachment } from '../src/interfaces';
@@ -265,10 +264,9 @@ describe('temba-compose chatbox', () => {
265
264
  button: true
266
265
  });
267
266
  await updateComponent(compose, getValidText());
268
- const send = compose.shadowRoot.querySelector(
269
- 'temba-button#send-button'
270
- ) as Button;
271
- send.click();
267
+ // press enter
268
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
269
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
272
270
  await assertScreenshot(
273
271
  'compose/chatbox-with-text-and-click-send',
274
272
  getClip(compose)
@@ -383,13 +381,14 @@ describe('temba-compose attachments', () => {
383
381
  it('attachments with success uploaded files and click send', async () => {
384
382
  const compose: Compose = await getCompose({
385
383
  attachments: true,
386
- button: true
384
+ chatbox: true
387
385
  });
388
386
  await updateComponent(compose, null, getValidAttachments());
389
- const send = compose.shadowRoot.querySelector(
390
- 'temba-button#send-button'
391
- ) as Button;
392
- send.click();
387
+
388
+ // press enter
389
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
390
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
391
+
393
392
  await assertScreenshot(
394
393
  'compose/attachments-with-success-files-and-click-send',
395
394
  getClip(compose)
@@ -399,13 +398,12 @@ describe('temba-compose attachments', () => {
399
398
  it('attachments with success and failure uploaded files and click send', async () => {
400
399
  const compose: Compose = await getCompose({
401
400
  attachments: true,
402
- button: true
401
+ chatbox: true
403
402
  });
404
403
  await updateComponent(compose, null, getValidAttachments());
405
- const send = compose.shadowRoot.querySelector(
406
- 'temba-button#send-button'
407
- ) as Button;
408
- send.click();
404
+ // press enter
405
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
406
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
409
407
  await assertScreenshot(
410
408
  'compose/attachments-with-all-files-and-click-send',
411
409
  getClip(compose)
@@ -522,10 +520,9 @@ describe('temba-compose chatbox with text and attachments no files', () => {
522
520
  button: true
523
521
  });
524
522
  updateComponent(compose, getValidText());
525
- const send = compose.shadowRoot.querySelector(
526
- 'temba-button#send-button'
527
- ) as Button;
528
- send.click();
523
+ // press enter
524
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
525
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
529
526
  await assertScreenshot(
530
527
  'compose/chatbox-with-text-attachments-no-files-and-click-send',
531
528
  getClip(compose)
@@ -613,10 +610,9 @@ describe('temba-compose chatbox no text and attachments with files', () => {
613
610
  button: true
614
611
  });
615
612
  await updateComponent(compose, null, getValidAttachments());
616
- const send = compose.shadowRoot.querySelector(
617
- 'temba-button#send-button'
618
- ) as Button;
619
- send.click();
613
+ // press enter
614
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
615
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
620
616
  await assertScreenshot(
621
617
  'compose/chatbox-no-text-attachments-with-success-files-and-click-send',
622
618
  getClip(compose)
@@ -630,10 +626,9 @@ describe('temba-compose chatbox no text and attachments with files', () => {
630
626
  button: true
631
627
  });
632
628
  await updateComponent(compose, null, getValidAttachments());
633
- const send = compose.shadowRoot.querySelector(
634
- 'temba-button#send-button'
635
- ) as Button;
636
- send.click();
629
+ // press enter
630
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
631
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
637
632
  await assertScreenshot(
638
633
  'compose/chatbox-no-text-attachments-with-all-files-and-click-send',
639
634
  getClip(compose)
@@ -707,10 +702,9 @@ describe('temba-compose chatbox with text and attachments with files', () => {
707
702
  button: true
708
703
  });
709
704
  await updateComponent(compose, getValidText(), getValidAttachments());
710
- const send = compose.shadowRoot.querySelector(
711
- 'temba-button#send-button'
712
- ) as Button;
713
- send.click();
705
+ // press enter
706
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
707
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
714
708
  await assertScreenshot(
715
709
  'compose/chatbox-with-text-attachments-with-success-files-and-click-send',
716
710
  getClip(compose)
@@ -724,10 +718,9 @@ describe('temba-compose chatbox with text and attachments with files', () => {
724
718
  button: true
725
719
  });
726
720
  await updateComponent(compose, getValidText(), getValidAttachments());
727
- const send = compose.shadowRoot.querySelector(
728
- 'temba-button#send-button'
729
- ) as Button;
730
- send.click();
721
+ // press enter
722
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
723
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
731
724
  await assertScreenshot(
732
725
  'compose/chatbox-with-text-attachments-with-all-files-and-click-send',
733
726
  getClip(compose)
@@ -1,5 +1,4 @@
1
1
  import { useFakeTimers } from 'sinon';
2
- import { Button } from '../src/button/Button';
3
2
  import { Compose } from '../src/compose/Compose';
4
3
  import { ContactChat } from '../src/contacts/ContactChat';
5
4
  import { Attachment } from '../src/interfaces';
@@ -19,6 +18,7 @@ import {
19
18
  getValidText,
20
19
  updateComponent
21
20
  } from './temba-compose.test';
21
+ import { Completion } from '../src/completion/Completion';
22
22
 
23
23
  let clock: any;
24
24
  mockNow('2021-03-31T00:31:00.000-00:00');
@@ -160,10 +160,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text no attac
160
160
  };
161
161
  mockPOST(/api\/v2\/messages\.json/, response_body);
162
162
 
163
- const send = compose.shadowRoot.querySelector(
164
- 'temba-button#send-button'
165
- ) as Button;
166
- send.click();
163
+ // press enter
164
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
165
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
167
166
 
168
167
  await assertScreenshot(
169
168
  'contacts/compose-text-no-attachments-success',
@@ -193,10 +192,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text no attac
193
192
  response_status
194
193
  );
195
194
 
196
- const send = compose.shadowRoot.querySelector(
197
- 'temba-button#send-button'
198
- ) as Button;
199
- send.click();
195
+ // press enter
196
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
197
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
200
198
 
201
199
  await assertScreenshot(
202
200
  'contacts/compose-text-no-attachments-failure',
@@ -243,10 +241,9 @@ describe('temba-contact-chat - contact tests - handle send tests - attachments n
243
241
  response_status
244
242
  );
245
243
 
246
- const send = compose.shadowRoot.querySelector(
247
- 'temba-button#send-button'
248
- ) as Button;
249
- send.click();
244
+ // press enter
245
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
246
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
250
247
 
251
248
  await assertScreenshot(
252
249
  'contacts/compose-attachments-no-text-success',
@@ -275,10 +272,9 @@ describe('temba-contact-chat - contact tests - handle send tests - attachments n
275
272
  response_status
276
273
  );
277
274
 
278
- const send = compose.shadowRoot.querySelector(
279
- 'temba-button#send-button'
280
- ) as Button;
281
- send.click();
275
+ // press enter
276
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
277
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
282
278
 
283
279
  await assertScreenshot(
284
280
  'contacts/compose-attachments-no-text-failure',
@@ -319,10 +315,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text and atta
319
315
  };
320
316
  mockPOST(/api\/v2\/messages\.json/, response_body);
321
317
 
322
- const send = compose.shadowRoot.querySelector(
323
- 'temba-button#send-button'
324
- ) as Button;
325
- send.click();
318
+ // press enter
319
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
320
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
326
321
 
327
322
  await assertScreenshot(
328
323
  'contacts/compose-text-and-attachments-success',
@@ -352,10 +347,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text and atta
352
347
  response_status
353
348
  );
354
349
 
355
- const send = compose.shadowRoot.querySelector(
356
- 'temba-button#send-button'
357
- ) as Button;
358
- send.click();
350
+ // press enter
351
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
352
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
359
353
 
360
354
  await assertScreenshot(
361
355
  'contacts/compose-text-and-attachments-failure-text',
@@ -385,10 +379,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text and atta
385
379
  response_status
386
380
  );
387
381
 
388
- const send = compose.shadowRoot.querySelector(
389
- 'temba-button#send-button'
390
- ) as Button;
391
- send.click();
382
+ // press enter
383
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
384
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
392
385
 
393
386
  await assertScreenshot(
394
387
  'contacts/compose-text-and-attachments-failure-attachments',
@@ -420,10 +413,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text and atta
420
413
  response_status
421
414
  );
422
415
 
423
- const send = compose.shadowRoot.querySelector(
424
- 'temba-button#send-button'
425
- ) as Button;
426
- send.click();
416
+ // press enter
417
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
418
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
427
419
 
428
420
  await assertScreenshot(
429
421
  'contacts/compose-text-and-attachments-failure-text-and-attachments',
@@ -450,10 +442,9 @@ describe('temba-contact-chat - contact tests - handle send tests - text and atta
450
442
  response_status
451
443
  );
452
444
 
453
- const send = compose.shadowRoot.querySelector(
454
- 'temba-button#send-button'
455
- ) as Button;
456
- send.click();
445
+ // press enter
446
+ const chatbox = compose.shadowRoot.querySelector('.chatbox') as Completion;
447
+ chatbox.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter' }));
457
448
 
458
449
  await assertScreenshot(
459
450
  'contacts/compose-text-and-attachments-failure-generic',
@@ -0,0 +1,14 @@
1
+ {
2
+ "next": null,
3
+ "previous": null,
4
+ "results": [
5
+ {
6
+ "name": "Rating",
7
+ "text": "How am I doing? Please review me on a scale of 1 to 5."
8
+ },
9
+ {
10
+ "name": "Busy",
11
+ "text": "Sorry, we are busy right now. We are trying to step up our spotted rabbit breeding program."
12
+ }
13
+ ]
14
+ }
@@ -1 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.520 2.296 C 7.684 2.770,5.714 3.995,4.405 5.478 C 3.561 6.433,2.529 8.461,2.236 9.740 C 1.915 11.139,1.993 13.395,2.411 14.803 L 2.774 16.024 2.418 18.306 C 2.020 20.863,2.080 21.266,2.924 21.703 C 3.340 21.918,3.609 21.906,5.693 21.582 C 7.913 21.236,8.035 21.233,8.861 21.493 C 10.810 22.107,13.328 22.116,15.120 21.516 C 17.600 20.684,19.853 18.721,20.935 16.449 C 21.730 14.779,21.958 13.786,21.958 12.000 C 21.958 10.217,21.730 9.222,20.940 7.561 C 19.891 5.358,17.697 3.412,15.269 2.532 C 14.089 2.104,10.787 1.969,9.520 2.296 M14.093 4.293 C 17.050 5.065,19.398 7.695,19.867 10.760 C 20.268 13.373,19.492 15.730,17.612 17.618 C 15.878 19.358,13.943 20.110,11.600 19.955 C 10.896 19.908,9.840 19.707,9.254 19.508 L 8.189 19.147 6.254 19.466 C 4.519 19.753,4.320 19.760,4.318 19.533 C 4.318 19.394,4.439 18.508,4.589 17.564 C 4.859 15.858,4.859 15.841,4.504 14.759 C 3.487 11.656,4.150 8.621,6.331 6.393 C 7.804 4.888,9.881 4.018,12.000 4.018 C 12.572 4.018,13.514 4.142,14.093 4.293 M6.503 10.952 C 5.925 11.489,5.910 12.485,6.473 13.047 C 7.374 13.948,8.960 13.280,8.960 12.000 C 8.960 10.722,7.447 10.077,6.503 10.952 M10.982 10.982 C 10.065 11.899,10.703 13.440,12.000 13.440 C 13.297 13.440,13.935 11.899,13.018 10.982 C 12.438 10.401,11.562 10.401,10.982 10.982 M15.462 10.982 C 14.532 11.911,15.184 13.440,16.509 13.440 C 17.379 13.440,17.920 12.888,17.920 12.000 C 17.920 10.683,16.393 10.051,15.462 10.982 " stroke="none" fill-rule="evenodd" fill="black"></path></svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M7.5 12H7.51M12 12H12.01M16.5 12H16.51M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 13.1971 3.23374 14.3397 3.65806 15.3845C3.73927 15.5845 3.77988 15.6845 3.798 15.7653C3.81572 15.8443 3.8222 15.9028 3.82221 15.9839C3.82222 16.0667 3.80718 16.1569 3.77711 16.3374L3.18413 19.8952C3.12203 20.2678 3.09098 20.4541 3.14876 20.5888C3.19933 20.7067 3.29328 20.8007 3.41118 20.8512C3.54589 20.909 3.73218 20.878 4.10476 20.8159L7.66265 20.2229C7.84309 20.1928 7.9333 20.1778 8.01613 20.1778C8.09715 20.1778 8.15566 20.1843 8.23472 20.202C8.31554 20.2201 8.41552 20.2607 8.61549 20.3419C9.6603 20.7663 10.8029 21 12 21ZM8 12C8 12.2761 7.77614 12.5 7.5 12.5C7.22386 12.5 7 12.2761 7 12C7 11.7239 7.22386 11.5 7.5 11.5C7.77614 11.5 8 11.7239 8 12ZM12.5 12C12.5 12.2761 12.2761 12.5 12 12.5C11.7239 12.5 11.5 12.2761 11.5 12C11.5 11.7239 11.7239 11.5 12 11.5C12.2761 11.5 12.5 11.7239 12.5 12ZM17 12C17 12.2761 16.7761 12.5 16.5 12.5C16.2239 12.5 16 12.2761 16 12C16 11.7239 16.2239 11.5 16.5 11.5C16.7761 11.5 17 11.7239 17 12Z" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3
- </svg>