Skip to content

Commit 7b353d8

Browse files
committed
Add test
1 parent ff3b36c commit 7b353d8

File tree

1 file changed

+14
-1
lines changed
  • firebase-database/src/commonTest/kotlin/dev/gitlive/firebase/database

1 file changed

+14
-1
lines changed

firebase-database/src/commonTest/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import dev.gitlive.firebase.runBlockingTest
88
import dev.gitlive.firebase.runTest
99
import kotlinx.coroutines.Dispatchers
1010
import kotlinx.coroutines.flow.first
11-
import kotlinx.coroutines.flow.map
1211
import kotlinx.coroutines.withContext
1312
import kotlinx.coroutines.withTimeout
1413
import kotlinx.serialization.Serializable
@@ -198,6 +197,20 @@ class FirebaseDatabaseTest {
198197
assertFalse(valueEvents.first().exists)
199198
}
200199

200+
@Test
201+
fun testBooleanValue() = runTest {
202+
ensureDatabaseConnected()
203+
val reference = database.reference("FirebaseRealtimeDatabaseBooleanTest")
204+
val falseRef = reference.child("false")
205+
val trueRef = reference.child("true")
206+
falseRef.setValue(false)
207+
trueRef.setValue(true)
208+
val falseValue = falseRef.valueEvents.first().value<Boolean>()
209+
val trueValue = trueRef.valueEvents.first().value<Boolean>()
210+
assertFalse(falseValue)
211+
assertTrue(trueValue)
212+
}
213+
201214
// Ignoring on Android Instrumented Tests due to bug in Firebase: https://github.com/firebase/firebase-android-sdk/issues/5870
202215
@IgnoreForAndroidTest
203216
@Test

0 commit comments

Comments
 (0)