Immediately update bottom badges after reading or starring articles #91

Merged
AmineB merged 4 commits from davidoskky/ReaderForSelfoss-multiplatform:badges into master 2022-11-02 19:06:48 +00:00
Showing only changes of commit 4b63afe62a - Show all commits

View File

@ -299,9 +299,9 @@ class RepositoryTest {
}
assertSame(true, success)
assertSame(NUMBER_ARTICLES, repository.badgeAll)
assertSame(NUMBER_UNREAD, repository.badgeUnread)
assertSame(NUMBER_STARRED, repository.badgeStarred)
assertEquals(NUMBER_ARTICLES, repository.badgeAll.value)
assertEquals(NUMBER_UNREAD, repository.badgeUnread.value)
assertEquals(NUMBER_STARRED, repository.badgeStarred.value)
coVerify(atLeast = 1) { api.stats() }
verify(exactly = 0) { db.itemsQueries.items().executeAsList() }
}
@ -318,9 +318,9 @@ class RepositoryTest {
}
assertSame(false, success)
assertSame(0, repository.badgeAll)
assertSame(0, repository.badgeUnread)
assertSame(0, repository.badgeStarred)
assertSame(0, repository.badgeAll.value)
assertSame(0, repository.badgeUnread.value)
assertSame(0, repository.badgeStarred.value)
coVerify(atLeast = 1) { api.stats() }
verify(exactly = 0) { db.itemsQueries.items().executeAsList() }
}
@ -338,9 +338,9 @@ class RepositoryTest {
}
assertTrue(success)
assertSame(1, repository.badgeAll)
assertSame(1, repository.badgeUnread)
assertSame(1, repository.badgeStarred)
assertEquals(1, repository.badgeAll.value)
assertEquals(1, repository.badgeUnread.value)
assertEquals(1, repository.badgeStarred.value)
coVerify(exactly = 0) { api.stats() }
verify(atLeast = 1) { db.itemsQueries.items().executeAsList() }
}
@ -358,9 +358,9 @@ class RepositoryTest {
}
assertFalse(success)
assertSame(0, repository.badgeAll)
assertSame(0, repository.badgeUnread)
assertSame(0, repository.badgeStarred)
assertSame(0, repository.badgeAll.value)
assertSame(0, repository.badgeUnread.value)
assertSame(0, repository.badgeStarred.value)
coVerify(exactly = 0) { api.stats() }
verify(exactly = 0) { db.itemsQueries.items().executeAsList() }
}