Skip to content

Commit

Permalink
Add one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
shepeliev committed Jun 24, 2024
1 parent 2da8cac commit 053c6fc
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FirebaseDatabaseTest {
lateinit var database: FirebaseDatabase

@Serializable
data class FirebaseDatabaseChildTest(val prop1: String? = null, val time: Double = 0.0)
data class FirebaseDatabaseChildTest(val prop1: String? = null, val time: Double = 0.0, val boolean: Boolean = true)

@Serializable
data class DatabaseTest(val title: String, val likes: Int = 0)
Expand Down Expand Up @@ -211,6 +211,15 @@ class FirebaseDatabaseTest {
assertTrue(trueValue)
}

@Test
fun testBooleanValueInChild() = runTest {
ensureDatabaseConnected()
val reference = database.reference("FirebaseRealtimeDatabaseBooleanInChildTest")
reference.setValue(FirebaseDatabaseChildTest())
val value = reference.valueEvents.first().value<FirebaseDatabaseChildTest>()
assertEquals(FirebaseDatabaseChildTest(), value)
}

// Ignoring on Android Instrumented Tests due to bug in Firebase: https://github.com/firebase/firebase-android-sdk/issues/5870
@IgnoreForAndroidTest
@Test
Expand Down

0 comments on commit 053c6fc

Please sign in to comment.