test: cover delete flows and guard re-entrant mutations

This commit is contained in:
2026-03-16 00:47:18 -04:00
parent 89537a57b7
commit 4455f0ecd3
2 changed files with 134 additions and 0 deletions

View File

@@ -153,6 +153,9 @@ class BoardDetailViewModel(
fun submitRenameList() {
val snapshot = _uiState.value
if (snapshot.isMutating) {
return
}
val editingListId = snapshot.editingListId ?: return
val currentList = snapshot.boardDetail?.lists?.firstOrNull { it.id == editingListId } ?: return
val trimmedTitle = snapshot.editingListTitle.trim()
@@ -238,6 +241,9 @@ class BoardDetailViewModel(
mutation: suspend (Set<String>) -> CardBatchMutationResult,
) {
val preMutation = _uiState.value
if (preMutation.isMutating) {
return
}
val selectedIds = preMutation.selectedCardIds
if (selectedIds.isEmpty()) {
return