davidliu
Committed by GitHub

update metadata on connect (#118)

@@ -243,6 +243,7 @@ constructor( @@ -243,6 +243,7 @@ constructor(
243 243
244 sid = Sid(response.room.sid) 244 sid = Sid(response.room.sid)
245 name = response.room.name 245 name = response.room.name
  246 + metadata = response.room.metadata
246 247
247 if (!response.hasParticipant()) { 248 if (!response.hasParticipant()) {
248 listener?.onFailedToConnect(this, RoomException.ConnectException("server didn't return any participants")) 249 listener?.onFailedToConnect(this, RoomException.ConnectException("server didn't return any participants"))
@@ -16,6 +16,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow @@ -16,6 +16,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
16 import kotlinx.coroutines.flow.SharedFlow 16 import kotlinx.coroutines.flow.SharedFlow
17 import kotlinx.coroutines.test.runTest 17 import kotlinx.coroutines.test.runTest
18 import org.junit.Assert 18 import org.junit.Assert
  19 +import org.junit.Assert.assertEquals
19 import org.junit.Before 20 import org.junit.Before
20 import org.junit.Rule 21 import org.junit.Rule
21 import org.junit.Test 22 import org.junit.Test
@@ -95,6 +96,11 @@ class RoomTest { @@ -95,6 +96,11 @@ class RoomTest {
95 @Test 96 @Test
96 fun connectTest() = runTest { 97 fun connectTest() = runTest {
97 connect() 98 connect()
  99 + val roomInfo = SignalClientTest.JOIN.join.room
  100 +
  101 + assertEquals(roomInfo.name, room.name)
  102 + assertEquals(Room.Sid(roomInfo.sid), room.sid)
  103 + assertEquals(roomInfo.metadata, room.metadata)
98 } 104 }
99 105
100 @Test 106 @Test