Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a50c974a authored by mitulsheth's avatar mitulsheth
Browse files

feat: Murena Workspace Login Part 1 of 7

parent f0355bf1
Loading
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -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)
@@ -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
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }

@@ -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)
    }