ui tests: key parameters before trailing lambdas and with defaults; review fixes

This commit is contained in:
Narasimha-sc committed 2026-10-22 20:20:51 +00:00
1 parent 5d353aa3bd
commit e5a6edef27
7 files changed
+11 -11

No files matched your search

@@ -278,7 +278,7 @@ expect fun VoiceButtonWithoutPermissionByPlatform()
@Composable
private fun CustomDisappearingMessageDialog(
showMenu: MutableState<Boolean>,
uiKey: UiKey?,
uiKey: UiKey? = null,
sendMessage: (Int?) -> Unit,
customDisappearingMessageTimePref: SharedPreference<Int>?
) {
@@ -320,7 +320,7 @@ private fun CustomDisappearingMessageDialog(
}
@Composable
private fun BoxScope.DeleteTextButton(composeState: MutableState<ComposeState>, uiKey: UiKey?) {
private fun BoxScope.DeleteTextButton(composeState: MutableState<ComposeState>, uiKey: UiKey? = null) {
IconButton(
{ composeState.value = composeState.value.copy(message = ComposeMessage()) },
Modifier.ui(uiKey).align(Alignment.TopEnd).size(36.dp)
@@ -465,7 +465,7 @@ private fun SendMsgButton(
enabled: Boolean,
sendToConnect: (() -> Unit)?,
sendMessage: (Int?) -> Unit,
uiKey: UiKey?,
uiKey: UiKey? = null,
onLongClick: (() -> Unit)? = null
) {
val interactionSource = remember { MutableInteractionSource() }
@@ -505,7 +505,7 @@ private fun SendMsgButton(
}
@Composable
private fun StartLiveMessageButton(uiKey: UiKey?, onClick: () -> Unit) {
private fun StartLiveMessageButton(uiKey: UiKey? = null, onClick: () -> Unit) {
val interactionSource = remember { MutableInteractionSource() }
val ripple = remember { ripple(bounded = false, radius = 24.dp) }
Box(
@@ -543,7 +543,7 @@ fun LeaveGroupAction(rhId: Long?, groupInfo: GroupInfo, chatModel: ChatModel, sh
}
@Composable
fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: ChatModel, showMenu: MutableState<Boolean>, onSuccess: ((chat: Chat) -> Unit)? = null, chatId: String? = null) {
fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: ChatModel, showMenu: MutableState<Boolean>, chatId: String? = null, onSuccess: ((chat: Chat) -> Unit)? = null) {
ItemAction(
stringResource(MR.strings.accept_contact_button),
painterResource(MR.images.ic_check),
@@ -84,7 +84,7 @@ private fun ShareListNavLinkLayout(
chatLinkPreview: @Composable () -> Unit,
click: () -> Unit,
stopped: Boolean,
uiKey: UiKey,
uiKey: UiKey? = null,
) {
SectionItemView(padding = PaddingValues(horizontal = DEFAULT_PADDING, vertical = 8.dp), click = click, disabled = stopped, uiKey = uiKey) {
chatLinkPreview()
@@ -68,9 +68,7 @@ fun showCustomTimePickerDialog(
SectionItemView({
AlertManager.shared.hideAlert()
confirmButtonAction(selection.value)
},
uiKey = Ui.TimePicker.Confirm
) {
}, uiKey = Ui.TimePicker.Confirm) {
Text(
confirmButtonText,
Modifier.fillMaxWidth(),
@@ -34,8 +34,8 @@ fun DefaultAppBar(
searchPlaceholder: String? = null,
onSearchValueChanged: (String) -> Unit = {},
searchTrailingContent: @Composable (() -> Unit)? = null,
buttons: @Composable RowScope.() -> Unit = {},
uiKey: UiKey? = null,
buttons: @Composable RowScope.() -> Unit = {},
) {
// If I just disable clickable modifier when don't need it, it will stop passing clicks to search. Replacing the whole modifier
val modifier = if (!showSearch) {
@@ -251,8 +251,8 @@ fun TextButtonBelowOnboardingButton(text: String, onClick: (() -> Unit)?, icon:
@Composable
fun OnboardingInformationButton(
text: String,
onClick: () -> Unit,
uiKey: UiKey? = null,
onClick: () -> Unit,
) {
Box(
modifier = Modifier
@@ -1579,6 +1579,8 @@ Each entry gives the symptom, the cause (how it was confirmed), and the fix or m
- `ChatListRowsTest.previewGroupSenderPrefix` (full Android run, 2026-10-14 21:07): after alice leaves the group chat, bob sends "#team hello all"; for 10 s the `team` row showed the unread badge "1" but kept the preview "mine" (failure screenshot). Passed in the rerun of the class.
- The badge proves the row recomposed with new chat stats; the preview text comes from `chat.chatItems.lastOrNull()` (`ChatPreviewView.kt:228`). Either the new item did not reach the chat's preview list while its stats did (app-side model update), or an earlier group event incremented the counter and the message was still in transit. Not resolved; next step is to capture `chatModel.chats` for the row on failure.
- 2026-10-22: seen on desktop too, in `ChatListRowsTest.previewGroupSenderPrefix` (1 of 2 runs, after the master merge with #7072): bob's group message arrived while alice had the group open, and the row kept showing alice's earlier "mine" instead of "bob: hello all". The test passed when rerun alone.
### 15.4.1b Open flake: received message missing from a chat opened at the same moment (desktop, 1 of 4 runs)
- `ForwardTest.forward_toNotes_showsSavedFrom` (rebased run b23, 2026-10-15): bob sends "hey", alice opens bob's chat right away; the chat list row shows "hey" with unread 1, but the open chat shows no items (only the "1" unread-below counter) for 10 s. Three reruns of the class passed.