fix: align select-all behavior and board-detail docs with filters
This commit is contained in:
@@ -148,7 +148,7 @@ class BoardDetailViewModel(
|
||||
|
||||
fun selectAllOnCurrentPage() {
|
||||
val current = _uiState.value
|
||||
val pageCards = current.boardDetail
|
||||
val pageCards = current.filteredBoardDetail
|
||||
?.lists
|
||||
?.getOrNull(current.currentPageIndex)
|
||||
?.cards
|
||||
|
||||
@@ -66,6 +66,6 @@
|
||||
<string name="due_date">Due date</string>
|
||||
<string name="clear_due_date">Clear date</string>
|
||||
<string name="add_card_tags">Tags</string>
|
||||
<string name="add_card_tags_placeholder">Tag selector will be wired in the next task.</string>
|
||||
<string name="filter_tags_placeholder">Tag selector will be wired in the next task.</string>
|
||||
<string name="add_card_tags_placeholder">Select one or more tags.</string>
|
||||
<string name="filter_tags_placeholder">Select tags to include.</string>
|
||||
</resources>
|
||||
|
||||
@@ -51,6 +51,18 @@ class BoardDetailViewModelTest {
|
||||
assertEquals(setOf("card-1", "card-2", "card-3"), viewModel.uiState.value.selectedCardIds)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun selectAllWithActiveFilter_selectsOnlyVisibleCardsOnCurrentPage() = runTest {
|
||||
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithFilterFixture())
|
||||
|
||||
viewModel.openFilterDialog()
|
||||
viewModel.updatePendingTagFilterIds(setOf("tag-b"))
|
||||
viewModel.applyFilterDialog()
|
||||
viewModel.selectAllOnCurrentPage()
|
||||
|
||||
assertEquals(setOf("card-2"), viewModel.uiState.value.selectedCardIds)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun backPressWithSelection_clearsSelectionAndReturnsTrue() = runTest {
|
||||
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithTwoLists())
|
||||
|
||||
Reference in New Issue
Block a user