Skip to content

Commit 4c67185

Browse files
authored
dataconnect: re-enable tests for user-defined enums as primary keys. (#7186)
1 parent c5b712f commit 4c67185

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

firebase-dataconnect/connectors/src/androidTest/kotlin/com/google/firebase/dataconnect/connectors/demo/EnumIntegrationTest.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -429,18 +429,13 @@ class EnumIntegrationTest : DemoConnectorIntegrationTestBase() {
429429
//////////////////////////////////////////////////////////////////////////////////////////////////
430430

431431
@Test
432-
@Ignore(
433-
"TODO(b/432793533) Re-enable this test once the emulator crash " +
434-
"caused by the \"EnumKey_GetByKey\" query is fixed."
435-
)
436432
fun enumAsPrimaryKey() = runTest {
437433
N5ekmae3jn.entries.forEach { enumValue ->
438434
val tagValue = Arb.dataConnect.tag().next(rs)
439435
val key = connector.enumKeyInsert.execute(enumValue) { tag = tagValue }.data.key
440-
withClue(key) { key.enumValue shouldBe Known(enumValue) }
441-
// TODO(b/432793533): Uncomment once the "EnumKey_GetByKey" query is uncommented.
442-
// val queryResult = connector.enumKeyGetByKey.execute(key).data
443-
// withClue(queryResult) { queryResult.item?.tag shouldBe tagValue }
436+
withClue(key) { key.enumValue shouldBe enumValue }
437+
val queryResult = connector.enumKeyGetByKey.execute(key).data
438+
withClue(queryResult) { queryResult.item?.tag shouldBe tagValue }
444439
}
445440
}
446441

firebase-dataconnect/emulator/dataconnect/connector/demo/demo_ops.gql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,10 +1778,9 @@ mutation EnumKey_Insert($enumValue: N5ekmae3jn!, $tag: String) @auth(level: PUBL
17781778
key: enumKey_insert(data: { enumValue: $enumValue, tag: $tag })
17791779
}
17801780

1781-
# TODO(b/432793533) Uncomment once the emulator crash caused by this query is fixed.
1782-
#query EnumKey_GetByKey($key: EnumKey_Key!) @auth(level: PUBLIC) {
1783-
# item: enumKey(key: $key) { tag }
1784-
#}
1781+
query EnumKey_GetByKey($key: EnumKey_Key!) @auth(level: PUBLIC) {
1782+
item: enumKey(key: $key) { tag }
1783+
}
17851784

17861785
###############################################################################
17871786
# Operations for table: type MultipleEnumColumns

firebase-dataconnect/src/androidTest/kotlin/com/google/firebase/dataconnect/EnumIntegrationTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import io.kotest.property.checkAll
3535
import kotlinx.coroutines.test.runTest
3636
import kotlinx.serialization.Serializable
3737
import kotlinx.serialization.serializer
38-
import org.junit.Ignore
3938
import org.junit.Test
4039

4140
class EnumIntegrationTest : DataConnectIntegrationTestBase() {
@@ -605,10 +604,6 @@ class EnumIntegrationTest : DataConnectIntegrationTestBase() {
605604
//////////////////////////////////////////////////////////////////////////////////////////////////
606605

607606
@Test
608-
@Ignore(
609-
"TODO(b/432793533) Re-enable this test once the emulator crash " +
610-
"caused by the \"EnumKey_GetByKey\" query is fixed."
611-
)
612607
fun enumAsPrimaryKey() = runTest {
613608
N5ekmae3jn.entries.forEach { enumValue ->
614609
val tag = Arb.dataConnect.tag().next(rs)

0 commit comments

Comments
 (0)