From 47eb4852014ba58e6923c895f6cbcd201477348f Mon Sep 17 00:00:00 2001 From: Kgothatso Ngako Date: Fri, 20 Nov 2026 10:37:59 +0200 Subject: [PATCH] test: pin what outlives the founding-admins check (remove-founding-admins-card, Phase 0) The retired caption type's place in MEMBERSHIP_TYPES moves to ChatRoomLastMessagePreviewTest, and the legacy-room case asserts no key state directly rather than through FoundingAdmins.check. Co-Authored-By: Claude Opus 5.5 --- .../intermdiate/ChatRoomLastMessagePreviewTest.kt | 14 ++++++++++++++ .../compose/managers/RobustGroupAdminsJvmTest.kt | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonTest/kotlin/mobi/giza/compose/database/model/intermdiate/ChatRoomLastMessagePreviewTest.kt b/composeApp/src/commonTest/kotlin/mobi/giza/compose/database/model/intermdiate/ChatRoomLastMessagePreviewTest.kt index d972e93c..9b8d1ffe 100644 --- a/composeApp/src/commonTest/kotlin/mobi/giza/compose/database/model/intermdiate/ChatRoomLastMessagePreviewTest.kt +++ b/composeApp/src/commonTest/kotlin/mobi/giza/compose/database/model/intermdiate/ChatRoomLastMessagePreviewTest.kt @@ -7,6 +7,7 @@ import mobi.giza.compose.database.model.Profile import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNull +import kotlin.test.assertTrue import kotlin.time.Instant /** @@ -172,6 +173,19 @@ class ChatRoomLastMessagePreviewTest { } } + /** + * No longer written, but rows of it are still on devices, written as the user's own. + * Out of the set, each one would render as a bubble from the user. + * docs/remove-founding-admins-card.md, D3. + */ + @Test + fun `a retired caption type still renders as a caption`() { + assertTrue( + ChatMessage.TYPE_FOUNDING_ADMINS_MISSING in ChatMessage.MEMBERSHIP_TYPES, + "it would render as a chat bubble", + ) + } + /** * The bystanders' copy of a private message has no content. An empty preview would * read as the sender having said nothing, so the line says what the group can in diff --git a/composeApp/src/jvmTest/kotlin/mobi/giza/compose/managers/RobustGroupAdminsJvmTest.kt b/composeApp/src/jvmTest/kotlin/mobi/giza/compose/managers/RobustGroupAdminsJvmTest.kt index ab4888af..fb2d8446 100644 --- a/composeApp/src/jvmTest/kotlin/mobi/giza/compose/managers/RobustGroupAdminsJvmTest.kt +++ b/composeApp/src/jvmTest/kotlin/mobi/giza/compose/managers/RobustGroupAdminsJvmTest.kt @@ -20,6 +20,7 @@ import kotlin.test.assertFalse import kotlin.test.assertEquals import kotlin.test.assertIs import kotlin.test.assertNotNull +import kotlin.test.assertNull import kotlin.test.assertTrue import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers @@ -480,9 +481,8 @@ class RobustGroupAdminsJvmTest { val group = assertNotNull(room.chatRoom.toMlsGroup(), "$joiner holds no group ($profile)") assertEquals(setOf(creator.publicKey), group.currentAdminIdentities(), "$joiner's admin policy ($profile)") assertFalse(group.isLocalAdmin(), "$joiner is not an admin of a room its creator runs ($profile)") - assertEquals( - FoundingAdmins.Check.NotKeyBacked, - FoundingAdmins.check(joiner.db, soloRoomId), + assertNull( + joiner.db.groupKeyStateDao().getByChatRoomId(soloRoomId), "no key behind it, so no founders to check ($profile)", ) }