diff --git a/shared/src/commonTest/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryTest.kt b/shared/src/commonTest/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryTest.kt index ea76e26..dc762a2 100644 --- a/shared/src/commonTest/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryTest.kt +++ b/shared/src/commonTest/kotlin/bou/amine/apps/readerforselfossv2/repository/RepositoryTest.kt @@ -680,6 +680,18 @@ class RepositoryTest() { coVerify(exactly = 0) { api.login() } assertSame(false, response) } + + @Test + fun `refresh login information`() { + coEvery { api.refreshLoginInformation() } returns Unit + coEvery { appSettingsService.refreshLoginInformation(any(), any(), any()) } returns Unit + + val repository = Repository(api, appSettingsService, connectivityStatus, db) + repository.refreshLoginInformation("https://test.com/selfoss/", "login", "password") + + coVerify(exactly = 1) { api.refreshLoginInformation() } + coVerify(exactly = 1) {appSettingsService.refreshLoginInformation("https://test.com/selfoss/", "login", "password")} + } } fun generateTestDBItems(item : FakeItemParameters = FakeItemParameters()) : List {