Room Metadata Implementation (#126)
This commit is contained in:
@@ -520,6 +520,20 @@ func TestHiddenParticipants(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestRoomUpdate(t *testing.T) {
|
||||
t.Run("participants should receive metadata update", func(t *testing.T) {
|
||||
rm := newRoomWithParticipants(t, testRoomOpts{num: 2})
|
||||
defer rm.Close()
|
||||
|
||||
rm.SetMetadata("test metadata...")
|
||||
|
||||
for _, op := range rm.GetParticipants() {
|
||||
fp := op.(*typesfakes.FakeParticipant)
|
||||
require.Equal(t, 1, fp.SendRoomUpdateCallCount())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type testRoomOpts struct {
|
||||
num int
|
||||
numHidden int
|
||||
@@ -548,6 +562,7 @@ func newRoomWithParticipants(t *testing.T, opts testRoomOpts) *rtc.Room {
|
||||
participant := newMockParticipant(identity, opts.protocol, i >= opts.num)
|
||||
err := rm.Join(participant, &rtc.ParticipantOptions{AutoSubscribe: true})
|
||||
participant.StateReturns(livekit.ParticipantInfo_ACTIVE)
|
||||
participant.IsReadyReturns(true)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
return rm
|
||||
|
||||
Reference in New Issue
Block a user