-
Notifications
You must be signed in to change notification settings - Fork 376
/
e2e_test.go
483 lines (460 loc) · 19.1 KB
/
e2e_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
package test
import (
"context"
"io"
"testing"
. "github.com/smartystreets/goconvey/convey"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/berty/berty/core/api/node"
"github.com/berty/berty/core/api/p2p"
"github.com/berty/berty/core/entity"
"github.com/berty/berty/core/network/drivermock"
)
func Test(t *testing.T) {
var (
alice, bob, eve *AppMock
err error
internalCtx = context.Background()
)
defer func() {
if alice != nil {
alice.Close()
}
if bob != nil {
bob.Close()
}
if eve != nil {
eve.Close()
}
}()
// initialize zap
config := zap.NewDevelopmentConfig()
config.Level.SetLevel(zap.InfoLevel)
config.DisableStacktrace = true
config.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
logger, err := config.Build()
if err != nil {
panic(err)
}
zap.ReplaceGlobals(logger)
// let's test
Convey("End-to-end test (manual)", t, FailureHalts, func() {
Convey("Initialize nodes", FailureHalts, func() {
alice, err = NewAppMock(&entity.Device{Name: "Alice's iPhone"}, drivermock.NewEnqueuer())
So(err, ShouldBeNil)
bob, err = NewAppMock(&entity.Device{Name: "iPhone de Bob"}, drivermock.NewEnqueuer())
So(err, ShouldBeNil)
eve, err = NewAppMock(&entity.Device{Name: "Eve"}, drivermock.NewEnqueuer())
So(err, ShouldBeNil)
})
Convey("Nodes should be empty when just initialized", FailureHalts, func() {
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 0, 0, 0, 0})
Convey("Alice should only know itself", FailureHalts, func() {
stream, err := alice.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact
So(contacts[0].DisplayName, ShouldEqual, "Alice")
So(contacts[0].ID, ShouldEqual, alice.node.UserID())
So(contacts[0].DisplayStatus, ShouldEqual, "")
So(contacts[0].Status, ShouldEqual, entity.Contact_Myself)
So(len(contacts[0].Devices), ShouldEqual, 1)
So(contacts[0].Devices[0].Name, ShouldEqual, "Alice's iPhone")
So(contacts[0].Devices[0].Status, ShouldEqual, entity.Device_Myself)
So(contacts[0].Devices[0].ApiVersion, ShouldEqual, p2p.Version)
So(contacts[0].Devices[0].ID, ShouldEqual, alice.node.DeviceID())
So(contacts[0].Devices[0].ContactID, ShouldEqual, alice.node.UserID())
})
Convey("Bob should only know itself", FailureHalts, func() {
stream, err := bob.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact
So(contacts[0].DisplayName, ShouldEqual, "Bob")
So(contacts[0].ID, ShouldEqual, bob.node.UserID())
So(contacts[0].DisplayStatus, ShouldEqual, "")
So(contacts[0].Status, ShouldEqual, entity.Contact_Myself)
So(len(contacts[0].Devices), ShouldEqual, 1)
So(contacts[0].Devices[0].Name, ShouldEqual, "iPhone de Bob")
So(contacts[0].Devices[0].Status, ShouldEqual, entity.Device_Myself)
So(contacts[0].Devices[0].ApiVersion, ShouldEqual, p2p.Version)
So(contacts[0].Devices[0].ID, ShouldEqual, bob.node.DeviceID())
So(contacts[0].Devices[0].ContactID, ShouldEqual, bob.node.UserID())
})
Convey("Eve should only know itself", FailureHalts, func() {
stream, err := eve.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(len(contacts), ShouldEqual, 1) // 'myself' is the only known contact
So(contacts[0].DisplayName, ShouldEqual, "Eve")
So(contacts[0].ID, ShouldEqual, eve.node.UserID())
So(contacts[0].DisplayStatus, ShouldEqual, "")
So(contacts[0].Status, ShouldEqual, entity.Contact_Myself)
So(len(contacts[0].Devices), ShouldEqual, 1)
So(contacts[0].Devices[0].Name, ShouldEqual, "Eve")
So(contacts[0].Devices[0].Status, ShouldEqual, entity.Device_Myself)
So(contacts[0].Devices[0].ApiVersion, ShouldEqual, p2p.Version)
So(contacts[0].Devices[0].ID, ShouldEqual, eve.node.DeviceID())
So(contacts[0].Devices[0].ContactID, ShouldEqual, eve.node.UserID())
})
})
Convey("Alice adds Bob as contact", FailureHalts, func() {
Convey("Alice calls node.ContactRequest", FailureHalts, func() {
res, err := alice.client.Node().ContactRequest(internalCtx, &node.ContactRequestInput{
Contact: &entity.Contact{
OverrideDisplayName: "Bob from school",
ID: bob.node.UserID(),
},
IntroMessage: "hello, I want to chat!",
})
So(err, ShouldBeNil)
So(res.Status, ShouldEqual, entity.Contact_IsRequested)
So(res.OverrideDisplayName, ShouldEqual, "Bob from school")
So(res.DisplayName, ShouldBeEmpty)
So(res.DisplayStatus, ShouldBeEmpty)
So(len(res.Devices), ShouldEqual, 0)
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{1, 0, 0, 0, 0, 0})
})
Convey("Alice has en entry in sql for Bob", FailureHalts, func() {
stream, err := alice.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(len(contacts), ShouldEqual, 2)
So(contacts[1].DisplayName, ShouldBeEmpty)
So(contacts[1].OverrideDisplayName, ShouldEqual, "Bob from school")
So(contacts[1].ID, ShouldEqual, bob.node.UserID())
So(contacts[1].DisplayStatus, ShouldBeEmpty)
So(contacts[1].Status, ShouldEqual, entity.Contact_IsRequested)
So(len(contacts[1].Devices), ShouldEqual, 0)
})
Convey("Alice sends a ContactRequest event to Bob", FailureHalts, func() {
event := <-alice.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.Author(), ShouldEqual, alice.node.UserID())
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Outgoing)
So(event.Kind, ShouldEqual, p2p.Kind_ContactRequest)
So(event.ReceiverID, ShouldEqual, bob.node.UserID())
attrs, err := event.GetContactRequestAttrs()
So(err, ShouldBeNil)
So(attrs.Me.DisplayName, ShouldEqual, "Alice")
So(attrs.Me.ID, ShouldEqual, alice.node.UserID())
So(attrs.Me.Status, ShouldEqual, entity.Contact_Unknown)
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
So(attrs.Me.Devices, ShouldBeNil)
So(attrs.IntroMessage, ShouldEqual, "hello, I want to chat!")
// unary call
res, err := bob.node.Handle(alice.ctx, event.Copy())
// FIXME: we should call an internal function in node that calls HandleEvent
// and automatically mark the event as acked when unary responds
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 1, 1, 0, 0})
})
Convey("Bob emits the ContactRequest event to its client", FailureHalts, func() {
event := <-bob.node.ClientEventsChan()
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Incoming)
So(event.Kind, ShouldEqual, p2p.Kind_ContactRequest)
So(event.SenderAPIVersion, ShouldEqual, p2p.Version)
So(event.ReceiverAPIVersion, ShouldEqual, p2p.Version)
So(event.ReceiverID, ShouldEqual, bob.node.UserID())
attrs, err := event.GetContactRequestAttrs()
So(err, ShouldBeNil)
So(attrs.Me.ID, ShouldEqual, alice.node.UserID())
So(attrs.Me.DisplayName, ShouldEqual, "Alice")
So(attrs.Me.Status, ShouldEqual, entity.Contact_Unknown)
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
So(attrs.Me.Devices, ShouldBeNil)
So(attrs.IntroMessage, ShouldEqual, "hello, I want to chat!")
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 1, 0, 0, 0})
})
Convey("Bob replies an Ack event to Alice's ContactRequest", FailureHalts, func() {
event := <-bob.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.Author(), ShouldEqual, bob.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_Ack)
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Outgoing)
attrs, err := event.GetAckAttrs()
So(err, ShouldBeNil)
So(len(attrs.IDs), ShouldEqual, 1)
// FIXME: check that event is not acked in db
res, err := alice.node.Handle(bob.ctx, event.Copy())
So(err, ShouldBeNil)
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 0, 0, 0, 0})
So(res, ShouldResemble, &p2p.Void{})
// FIXME: check that event is acked in db
})
Convey("Bob has en entry in sql for Alice", FailureHalts, func() {
stream, err := bob.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(len(contacts), ShouldEqual, 2)
So(contacts[1].DisplayName, ShouldEqual, "Alice")
So(contacts[1].OverrideDisplayName, ShouldBeEmpty)
So(contacts[1].ID, ShouldEqual, alice.node.UserID())
So(contacts[1].DisplayStatus, ShouldBeEmpty)
So(contacts[1].Status, ShouldEqual, entity.Contact_RequestedMe)
So(len(contacts[1].Devices), ShouldEqual, 1)
})
Convey("Bob calls node.ContactAcceptRequest", FailureHalts, func() {
res, err := bob.client.Node().ContactAcceptRequest(internalCtx, &entity.Contact{
ID: alice.node.UserID(),
})
So(err, ShouldBeNil)
So(res.Status, ShouldEqual, entity.Contact_IsFriend)
So(res.DisplayName, ShouldEqual, "Alice")
So(res.OverrideDisplayName, ShouldBeEmpty)
So(res.DisplayStatus, ShouldBeEmpty)
So(len(res.Devices), ShouldEqual, 1)
So(res.Devices[0].ID, ShouldEqual, alice.node.UserID())
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 2, 0, 0, 0})
})
Convey("Bob sends a ContactRequestAccepted event to Alice", FailureHalts, func() {
event := <-bob.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.Kind, ShouldEqual, p2p.Kind_ContactRequestAccepted)
So(event.SenderAPIVersion, ShouldEqual, p2p.Version)
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
_, err := event.GetContactRequestAcceptedAttrs()
So(err, ShouldBeNil)
res, err := alice.node.Handle(bob.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{2, 1, 1, 0, 0, 0})
})
Convey("Alice emits the ContactRequestAccepted event to its clients", FailureHalts, func() {
event := <-alice.node.ClientEventsChan()
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_ContactRequestAccepted)
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Incoming)
_, err := event.GetContactRequestAcceptedAttrs()
So(err, ShouldBeNil)
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{2, 0, 1, 0, 0, 0})
})
Convey("Bob sends a ContactShareMe event to Alice", FailureHalts, func() {
event := <-bob.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.Kind, ShouldEqual, p2p.Kind_ContactShareMe)
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
attrs, err := event.GetContactShareMeAttrs()
So(err, ShouldBeNil)
So(attrs.Me.DisplayName, ShouldEqual, "Bob")
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
res, err := alice.node.Handle(bob.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{3, 1, 0, 0, 0, 0})
})
Convey("Alice emits the ContactShareMe event to its client", FailureHalts, func() {
event := <-alice.node.ClientEventsChan()
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_ContactShareMe)
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Incoming)
attrs, err := event.GetContactShareMeAttrs()
So(err, ShouldBeNil)
So(attrs.Me.DisplayName, ShouldEqual, "Bob")
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{3, 0, 0, 0, 0, 0})
})
Convey("Alice sends a ContactShareMe event to Bob", FailureHalts, func() {
event := <-alice.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_ContactShareMe)
So(event.ReceiverID, ShouldEqual, bob.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Outgoing)
attrs, err := event.GetContactShareMeAttrs()
So(err, ShouldBeNil)
So(attrs.Me.ID, ShouldBeEmpty)
So(attrs.Me.Status, ShouldEqual, entity.Contact_Unknown)
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
res, err := bob.node.Handle(alice.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{2, 0, 1, 1, 0, 0})
})
Convey("Alice replies an Ack event to Bob's ContactRequestAccepted", FailureHalts, func() {
event := <-alice.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_Ack)
So(event.ReceiverID, ShouldEqual, bob.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Outgoing)
attrs, err := event.GetAckAttrs()
So(err, ShouldBeNil)
So(len(attrs.IDs), ShouldEqual, 1)
res, err := bob.node.Handle(alice.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{1, 0, 1, 1, 0, 0})
})
Convey("Alice replies an Ack event to Bob's ContactShareMe", FailureHalts, func() {
event := <-alice.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Kind, ShouldEqual, p2p.Kind_Ack)
So(event.ReceiverID, ShouldEqual, bob.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Outgoing)
attrs, err := event.GetAckAttrs()
So(err, ShouldBeNil)
So(len(attrs.IDs), ShouldEqual, 1)
res, err := bob.node.Handle(alice.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 1, 1, 0, 0})
})
Convey("Bob replies an Ack event to Alice's ContactShareMe", FailureHalts, func() {
event := <-bob.networkDriver.(*drivermock.Enqueuer).Queue()
So(event.Kind, ShouldEqual, p2p.Kind_Ack)
So(event.SenderID, ShouldEqual, bob.node.UserID())
So(event.ReceiverID, ShouldEqual, alice.node.UserID())
attrs, err := event.GetAckAttrs()
So(err, ShouldBeNil)
So(len(attrs.IDs), ShouldEqual, 1)
res, err := alice.node.Handle(bob.ctx, event.Copy())
So(err, ShouldBeNil)
So(res, ShouldResemble, &p2p.Void{})
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 0, 1, 0, 0})
})
Convey("Bob emits the ContactShareMe event to its client", FailureHalts, func() {
event := <-bob.node.ClientEventsChan()
So(event.SenderID, ShouldEqual, alice.node.UserID())
So(event.Direction, ShouldEqual, p2p.Event_Incoming)
So(event.Kind, ShouldEqual, p2p.Kind_ContactShareMe)
So(event.SenderAPIVersion, ShouldEqual, p2p.Version)
attrs, err := event.GetContactShareMeAttrs()
So(err, ShouldBeNil)
So(attrs.Me.ID, ShouldBeEmpty)
So(attrs.Me.DisplayName, ShouldEqual, "Alice")
So(attrs.Me.Status, ShouldEqual, entity.Contact_Unknown)
So(attrs.Me.DisplayStatus, ShouldBeEmpty)
So(attrs.Me.Devices, ShouldBeNil)
So(nodeChansLens(alice, bob, eve), ShouldResemble, []int{0, 0, 0, 0, 0, 0})
})
Convey("Alice has Bob as friend", FailureHalts, func() {
stream, err := alice.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)
// myself
So(contacts[0].DisplayName, ShouldEqual, "Alice")
So(contacts[0].Status, ShouldEqual, entity.Contact_Myself)
// bob
So(contacts[1].ID, ShouldNotBeEmpty)
So(contacts[1].DisplayName, ShouldEqual, "Bob")
So(contacts[1].OverrideDisplayName, ShouldEqual, "Bob from school")
//So(contacts[1].Devices[0].ID, ShouldEqual, bob.node.UserID())
So(contacts[1].Status, ShouldEqual, entity.Contact_IsFriend)
So(contacts[1].DisplayStatus, ShouldBeEmpty)
//So(contacts[1].Devices[0].Key, ShouldNotBeNil)
})
Convey("Bob has Alice as friend", FailureHalts, func() {
stream, err := bob.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 2)
// myself
So(contacts[0].DisplayName, ShouldEqual, "Bob")
So(contacts[0].Status, ShouldEqual, entity.Contact_Myself)
// alice
So(contacts[1].ID, ShouldNotBeEmpty)
So(contacts[1].DisplayName, ShouldEqual, "Alice")
So(contacts[1].Status, ShouldEqual, entity.Contact_IsFriend)
So(contacts[1].DisplayStatus, ShouldBeEmpty)
So(contacts[1].OverrideDisplayName, ShouldBeEmpty)
So(contacts[1].Devices[0].ID, ShouldEqual, alice.node.UserID())
//So(contacts[1].Devices[0].Key, ShouldNotBeNil)
})
Convey("Eve has no friend", FailureHalts, func() {
stream, err := eve.client.Node().ContactList(internalCtx, &node.Void{})
So(err, ShouldBeNil)
contacts := []*entity.Contact{}
for {
contact, err := stream.Recv()
if err == io.EOF {
break
}
So(err, ShouldBeNil)
contacts = append(contacts, contact)
}
So(err, ShouldBeNil)
So(len(contacts), ShouldEqual, 1)
})
Convey("All sent events are acked and queues are empty", FailureHalts, nil)
})
Convey("Bob pings Alice", FailureHalts, func() {
Convey("TODO", FailureHalts, nil)
})
Convey("Bob creates a new conversation with Alice", FailureHalts, func() {
Convey("TODO", FailureHalts, nil)
})
Convey("Test multi-devices", FailureHalts, func() {
Convey("TODO", FailureHalts, nil)
})
Convey("Test synchronous messages", FailureHalts, func() {
Convey("TODO", FailureHalts, nil)
})
Convey("Test asynchronous messages", FailureHalts, func() {
Convey("TODO", FailureHalts, nil)
})
})
}