Skip to content

Commit

Permalink
Refactored code to assert for message id
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Jan 12, 2024
1 parent 115b797 commit f3d3e70
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ably/proto_presence_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,16 +1233,18 @@ func Test_internal_presencemap_RTP17(t *testing.T) {
// Send enter for internal messages
var protoMsg *ably.ProtocolMessage
ablytest.Instantly.Recv(t, &protoMsg, out, t.Fatalf)
for _, v := range protoMsg.Presence {
assert.Equal(t, ably.PresenceActionEnter, v.Action)
assert.Equal(t, client.Connection.ID(), v.ConnectionID)
for _, enteredMsg := range protoMsg.Presence {
assert.Equal(t, ably.PresenceActionEnter, enteredMsg.Action)
assert.Equal(t, "987:12:0", enteredMsg.ID)
assert.Equal(t, client.Connection.ID(), enteredMsg.ConnectionID)
}
client.Connection.AckAll()

ablytest.Instantly.Recv(t, &protoMsg, out, t.Fatalf)
for _, v := range protoMsg.Presence {
assert.Equal(t, ably.PresenceActionEnter, v.Action)
assert.Equal(t, client.Connection.ID(), v.ConnectionID)
for _, enteredMsg := range protoMsg.Presence {
assert.Equal(t, ably.PresenceActionEnter, enteredMsg.Action)
assert.Equal(t, "987:12:1", enteredMsg.ID)
assert.Equal(t, client.Connection.ID(), enteredMsg.ConnectionID)
}
client.Connection.AckAll()
ablytest.Instantly.NoRecv(t, nil, out, t.Fatalf)
Expand Down

0 comments on commit f3d3e70

Please sign in to comment.