Loading cardinal-android/app/src/test/java/earth/maps/cardinal/ui/saved/ManagePlacesViewModelTest.kt +14 −14 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ class ManagePlacesViewModelTest { // Mock DAO methods coEvery { mockListItemDao.getItemsInList(any()) } returns emptyList() coEvery { mockListItemDao.getItemsInList(testList.id) } returns listOf(listItem1) coEvery { mockListItemDao.moveItem(any(), any(), any()) } just runs coEvery { mockListItemDao.moveItem(any(), any(), any(), any()) } just runs // Mock place repository coEvery { mockSavedPlaceRepository.getPlaceById(any()) } returns Result.success(null) Loading Loading @@ -403,7 +403,7 @@ class ManagePlacesViewModelTest { // Then coVerify { mockSavedListRepository.createList("New List", testList.id, null, false, false) } coVerify { mockListItemDao.moveItem(testPlace.id, newListId, 0) } coVerify { mockListItemDao.moveItem(testPlace.id, newListId, 0, any()) } assertTrue(viewModel.selectedItems.value.isEmpty()) // Selection should be cleared } Loading Loading @@ -441,7 +441,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -614,8 +614,8 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace2.id, testList.id, 2) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } coVerify { mockListItemDao.moveItem(testPlace2.id, testList.id, 2, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading @@ -637,7 +637,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 0) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 0, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -722,7 +722,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading Loading @@ -785,7 +785,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading @@ -809,7 +809,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move the place and clear clipboard coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -850,7 +850,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move the list and clear clipboard coVerify { mockListItemDao.moveItem(testList.id, targetList.id, 0) } coVerify { mockListItemDao.moveItem(testList.id, targetList.id, 0, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading @@ -877,8 +877,8 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move both items and clear clipboard coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(nestedList.id, testList.id, 2) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } coVerify { mockListItemDao.moveItem(nestedList.id, testList.id, 2, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -919,7 +919,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading Loading
cardinal-android/app/src/test/java/earth/maps/cardinal/ui/saved/ManagePlacesViewModelTest.kt +14 −14 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ class ManagePlacesViewModelTest { // Mock DAO methods coEvery { mockListItemDao.getItemsInList(any()) } returns emptyList() coEvery { mockListItemDao.getItemsInList(testList.id) } returns listOf(listItem1) coEvery { mockListItemDao.moveItem(any(), any(), any()) } just runs coEvery { mockListItemDao.moveItem(any(), any(), any(), any()) } just runs // Mock place repository coEvery { mockSavedPlaceRepository.getPlaceById(any()) } returns Result.success(null) Loading Loading @@ -403,7 +403,7 @@ class ManagePlacesViewModelTest { // Then coVerify { mockSavedListRepository.createList("New List", testList.id, null, false, false) } coVerify { mockListItemDao.moveItem(testPlace.id, newListId, 0) } coVerify { mockListItemDao.moveItem(testPlace.id, newListId, 0, any()) } assertTrue(viewModel.selectedItems.value.isEmpty()) // Selection should be cleared } Loading Loading @@ -441,7 +441,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -614,8 +614,8 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace2.id, testList.id, 2) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } coVerify { mockListItemDao.moveItem(testPlace2.id, testList.id, 2, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading @@ -637,7 +637,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 0) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 0, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -722,7 +722,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading Loading @@ -785,7 +785,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading @@ -809,7 +809,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move the place and clear clipboard coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -850,7 +850,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move the list and clear clipboard coVerify { mockListItemDao.moveItem(testList.id, targetList.id, 0) } coVerify { mockListItemDao.moveItem(testList.id, targetList.id, 0, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading @@ -877,8 +877,8 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should move both items and clear clipboard coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1) } coVerify { mockListItemDao.moveItem(nestedList.id, testList.id, 2) } coVerify { mockListItemDao.moveItem(testPlace.id, testList.id, 1, any()) } coVerify { mockListItemDao.moveItem(nestedList.id, testList.id, 2, any()) } assertEquals(emptySet<ClipboardItem>(), clipboardFlow.value) } Loading Loading @@ -919,7 +919,7 @@ class ManagePlacesViewModelTest { advanceUntilIdle() // Then - should not move any items and clipboard should remain unchanged coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any()) } coVerify(exactly = 0) { mockListItemDao.moveItem(any(), any(), any(), any()) } assertEquals(clipboardItems, clipboardFlow.value) } Loading