Fixing tests.

This commit is contained in:
aminecmi 2022-12-06 22:36:15 +01:00
parent d6a562863a
commit 89c570f34f

View File

@ -196,7 +196,7 @@ class RepositoryTest {
every { appSettingsService.isItemCachingEnabled() } returns true every { appSettingsService.isItemCachingEnabled() } returns true
initializeRepository(MutableStateFlow(false)) initializeRepository(MutableStateFlow(false))
repository.tagFilter = SelfossModel.Tag("Test", "red", 3) repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Test", "red", 3))
runBlocking { runBlocking {
repository.getNewerItems() repository.getNewerItems()
} }
@ -224,13 +224,15 @@ class RepositoryTest {
every { appSettingsService.isItemCachingEnabled() } returns true every { appSettingsService.isItemCachingEnabled() } returns true
initializeRepository(MutableStateFlow(false)) initializeRepository(MutableStateFlow(false))
repository.sourceFilter = SelfossModel.Source( repository.sourceFilter = MutableStateFlow(
1, SelfossModel.Source(
"Test", 1,
listOf("tags"), "Test",
"spouts\\rss\\fulltextrss", listOf("tags"),
"", "spouts\\rss\\fulltextrss",
"b3aa8a664d08eb15d6ff1db2fa83e0d9.png" "",
"b3aa8a664d08eb15d6ff1db2fa83e0d9.png"
)
) )
runBlocking { runBlocking {
repository.getNewerItems() repository.getNewerItems()
@ -1302,14 +1304,16 @@ class RepositoryTest {
) )
initializeRepository() initializeRepository()
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0) repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = SelfossModel.Source( repository.sourceFilter = MutableStateFlow(
1, SelfossModel.Source(
"First source", 1,
listOf("Test", "second"), "First source",
"spouts\\rss\\fulltextrss", listOf("Test", "second"),
"", "spouts\\rss\\fulltextrss",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
) )
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {
@ -1325,14 +1329,16 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem()) StatusAndData(success = false, data = generateTestApiItem())
initializeRepository() initializeRepository()
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0) repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = SelfossModel.Source( repository.sourceFilter = MutableStateFlow(
1, SelfossModel.Source(
"First source", 1,
listOf("Test", "second"), "First source",
"spouts\\rss\\fulltextrss", listOf("Test", "second"),
"", "spouts\\rss\\fulltextrss",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
) )
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {
@ -1348,14 +1354,16 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem()) StatusAndData(success = false, data = generateTestApiItem())
initializeRepository(MutableStateFlow(false)) initializeRepository(MutableStateFlow(false))
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0) repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = SelfossModel.Source( repository.sourceFilter = MutableStateFlow(
1, SelfossModel.Source(
"First source", 1,
listOf("Test", "second"), "First source",
"spouts\\rss\\fulltextrss", listOf("Test", "second"),
"", "spouts\\rss\\fulltextrss",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
) )
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {