Skip to content

Commit

Permalink
Test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech committed Jul 18, 2024
1 parent df59dcc commit 7901a14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class FLXProgressListenerTests {
@Test
fun uploadProgressListener_changesOnly() = runBlocking {
Realm.open(createSyncConfig(app.createUserAndLogin())).use { realm ->
realm.syncSession.uploadAllLocalChanges(TIMEOUT)
for (i in 0..3) {
realm.writeSampleData(TEST_SIZE, timeout = TIMEOUT)
realm.syncSession.progressAsFlow(Direction.UPLOAD, ProgressMode.CURRENT_CHANGES)
Expand Down Expand Up @@ -291,7 +292,6 @@ class FLXProgressListenerTests {
.initialSubscriptions {
add(it.query<SyncObjectWithAllTypes>("stringField = $0", getTestPartitionValue()))
}
.waitForInitialRemoteData(TIMEOUT)
.build()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import io.realm.kotlin.test.util.use
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.withTimeout
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
import kotlin.time.Duration.Companion.seconds

Expand Down Expand Up @@ -51,7 +52,11 @@ class PlatformNetworkingTests {
}
uploadRealm.syncSession.uploadAllLocalChanges(TIMEOUT)
withTimeout(TIMEOUT) {
realm.query<SyncObjectWithAllTypes>().asFlow().first { it.list.size == 1 }
realm.query<SyncObjectWithAllTypes>().asFlow().first {
it.list.size == 1
}.list.first().also {
assertEquals(selector, it.stringField)
}
}
}
}
Expand Down

0 comments on commit 7901a14

Please sign in to comment.