@@ -22,9 +22,9 @@ describe('Conversations', () => {
22
22
const user = createUser ( )
23
23
const client = await createRegisteredClient ( user )
24
24
25
- expect ( ( await client . conversations ( ) . list ( ) ) . length ) . toBe ( 0 )
26
- expect ( ( await client . conversations ( ) . listDms ( ) ) . length ) . toBe ( 0 )
27
- expect ( ( await client . conversations ( ) . listGroups ( ) ) . length ) . toBe ( 0 )
25
+ expect ( client . conversations ( ) . list ( ) . length ) . toBe ( 0 )
26
+ expect ( client . conversations ( ) . listDms ( ) . length ) . toBe ( 0 )
27
+ expect ( client . conversations ( ) . listGroups ( ) . length ) . toBe ( 0 )
28
28
} )
29
29
30
30
it ( 'should create a group chat' , async ( ) => {
@@ -67,22 +67,22 @@ describe('Conversations', () => {
67
67
68
68
expect ( group . consentState ( ) ) . toBe ( ConsentState . Allowed )
69
69
70
- const group1 = await client1 . conversations ( ) . list ( )
70
+ const group1 = client1 . conversations ( ) . list ( )
71
71
expect ( group1 . length ) . toBe ( 1 )
72
72
expect ( group1 [ 0 ] . id ) . toBe ( group . id )
73
- expect ( ( await client1 . conversations ( ) . listDms ( ) ) . length ) . toBe ( 0 )
74
- expect ( ( await client1 . conversations ( ) . listGroups ( ) ) . length ) . toBe ( 1 )
73
+ expect ( client1 . conversations ( ) . listDms ( ) . length ) . toBe ( 0 )
74
+ expect ( client1 . conversations ( ) . listGroups ( ) . length ) . toBe ( 1 )
75
75
76
- expect ( ( await client2 . conversations ( ) . list ( ) ) . length ) . toBe ( 0 )
76
+ expect ( client2 . conversations ( ) . list ( ) . length ) . toBe ( 0 )
77
77
78
78
await client2 . conversations ( ) . sync ( )
79
79
80
- const group2 = await client2 . conversations ( ) . list ( )
80
+ const group2 = client2 . conversations ( ) . list ( )
81
81
expect ( group2 . length ) . toBe ( 1 )
82
82
expect ( group2 [ 0 ] . id ) . toBe ( group . id )
83
83
84
- expect ( ( await client2 . conversations ( ) . listDms ( ) ) . length ) . toBe ( 0 )
85
- expect ( ( await client2 . conversations ( ) . listGroups ( ) ) . length ) . toBe ( 1 )
84
+ expect ( client2 . conversations ( ) . listDms ( ) . length ) . toBe ( 0 )
85
+ expect ( client2 . conversations ( ) . listGroups ( ) . length ) . toBe ( 1 )
86
86
} )
87
87
88
88
it ( 'should create a group with custom permissions' , async ( ) => {
@@ -213,25 +213,25 @@ describe('Conversations', () => {
213
213
214
214
expect ( group . consentState ( ) ) . toBe ( ConsentState . Allowed )
215
215
216
- const group1 = await client1 . conversations ( ) . list ( )
216
+ const group1 = client1 . conversations ( ) . list ( )
217
217
expect ( group1 . length ) . toBe ( 1 )
218
218
expect ( group1 [ 0 ] . id ) . toBe ( group . id )
219
219
expect ( group1 [ 0 ] . dmPeerInboxId ( ) ) . toBe ( client2 . inboxId ( ) )
220
220
221
- expect ( ( await client1 . conversations ( ) . listDms ( ) ) . length ) . toBe ( 1 )
222
- expect ( ( await client1 . conversations ( ) . listGroups ( ) ) . length ) . toBe ( 0 )
221
+ expect ( client1 . conversations ( ) . listDms ( ) . length ) . toBe ( 1 )
222
+ expect ( client1 . conversations ( ) . listGroups ( ) . length ) . toBe ( 0 )
223
223
224
- expect ( ( await client2 . conversations ( ) . list ( ) ) . length ) . toBe ( 0 )
224
+ expect ( client2 . conversations ( ) . list ( ) . length ) . toBe ( 0 )
225
225
226
226
await client2 . conversations ( ) . sync ( )
227
227
228
- const group2 = await client2 . conversations ( ) . list ( )
228
+ const group2 = client2 . conversations ( ) . list ( )
229
229
expect ( group2 . length ) . toBe ( 1 )
230
230
expect ( group2 [ 0 ] . id ) . toBe ( group . id )
231
231
expect ( group2 [ 0 ] . dmPeerInboxId ( ) ) . toBe ( client1 . inboxId ( ) )
232
232
233
- expect ( ( await client2 . conversations ( ) . listDms ( ) ) . length ) . toBe ( 1 )
234
- expect ( ( await client2 . conversations ( ) . listGroups ( ) ) . length ) . toBe ( 0 )
233
+ expect ( client2 . conversations ( ) . listDms ( ) . length ) . toBe ( 1 )
234
+ expect ( client2 . conversations ( ) . listGroups ( ) . length ) . toBe ( 0 )
235
235
236
236
const dm1 = client1 . conversations ( ) . findDmByTargetInboxId ( client2 . inboxId ( ) )
237
237
expect ( dm1 ) . toBeDefined ( )
@@ -487,15 +487,15 @@ describe('Conversations', () => {
487
487
488
488
const groups2 = client2 . conversations ( )
489
489
await groups2 . sync ( )
490
- const groupsList2 = await groups2 . list ( )
490
+ const groupsList2 = groups2 . list ( )
491
491
492
492
const groups3 = client3 . conversations ( )
493
493
await groups3 . sync ( )
494
- const groupsList3 = await groups3 . list ( )
494
+ const groupsList3 = groups3 . list ( )
495
495
496
- const groups4 = await client4 . conversations ( )
496
+ const groups4 = client4 . conversations ( )
497
497
await groups4 . sync ( )
498
- const groupsList4 = await groups4 . list ( )
498
+ const groupsList4 = groups4 . list ( )
499
499
500
500
const message1 = await groupsList2 [ 0 ] . send ( encodeTextMessage ( 'gm!' ) )
501
501
const message2 = await groupsList3 [ 0 ] . send ( encodeTextMessage ( 'gm2!' ) )
@@ -530,15 +530,15 @@ describe('Conversations', () => {
530
530
531
531
const groups2 = client2 . conversations ( )
532
532
await groups2 . sync ( )
533
- const groupsList2 = await groups2 . list ( )
533
+ const groupsList2 = groups2 . list ( )
534
534
535
535
const groups3 = client3 . conversations ( )
536
536
await groups3 . sync ( )
537
- const groupsList3 = await groups3 . list ( )
537
+ const groupsList3 = groups3 . list ( )
538
538
539
- const groups4 = await client4 . conversations ( )
539
+ const groups4 = client4 . conversations ( )
540
540
await groups4 . sync ( )
541
- const groupsList4 = await groups4 . list ( )
541
+ const groupsList4 = groups4 . list ( )
542
542
543
543
await groupsList4 [ 0 ] . send ( encodeTextMessage ( 'gm3!' ) )
544
544
const message1 = await groupsList2 [ 0 ] . send ( encodeTextMessage ( 'gm!' ) )
@@ -573,15 +573,15 @@ describe('Conversations', () => {
573
573
574
574
const groups2 = client2 . conversations ( )
575
575
await groups2 . sync ( )
576
- const groupsList2 = await groups2 . list ( )
576
+ const groupsList2 = groups2 . list ( )
577
577
578
578
const groups3 = client3 . conversations ( )
579
579
await groups3 . sync ( )
580
- const groupsList3 = await groups3 . list ( )
580
+ const groupsList3 = groups3 . list ( )
581
581
582
- const groups4 = await client4 . conversations ( )
582
+ const groups4 = client4 . conversations ( )
583
583
await groups4 . sync ( )
584
- const groupsList4 = await groups4 . list ( )
584
+ const groupsList4 = groups4 . list ( )
585
585
586
586
await groupsList2 [ 0 ] . send ( encodeTextMessage ( 'gm!' ) )
587
587
await groupsList3 [ 0 ] . send ( encodeTextMessage ( 'gm2!' ) )
0 commit comments