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,7 +224,8 @@ 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(
SelfossModel.Source(
1, 1,
"Test", "Test",
listOf("tags"), listOf("tags"),
@ -232,6 +233,7 @@ class RepositoryTest {
"", "",
"b3aa8a664d08eb15d6ff1db2fa83e0d9.png" "b3aa8a664d08eb15d6ff1db2fa83e0d9.png"
) )
)
runBlocking { runBlocking {
repository.getNewerItems() repository.getNewerItems()
} }
@ -1302,8 +1304,9 @@ 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(
SelfossModel.Source(
1, 1,
"First source", "First source",
listOf("Test", "second"), listOf("Test", "second"),
@ -1311,6 +1314,7 @@ class RepositoryTest {
"", "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "d8c92cdb1ef119ea85c4b9205c879ca7.png"
) )
)
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {
repository.tryToCacheItemsAndGetNewOnes() repository.tryToCacheItemsAndGetNewOnes()
@ -1325,8 +1329,9 @@ 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(
SelfossModel.Source(
1, 1,
"First source", "First source",
listOf("Test", "second"), listOf("Test", "second"),
@ -1334,6 +1339,7 @@ class RepositoryTest {
"", "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "d8c92cdb1ef119ea85c4b9205c879ca7.png"
) )
)
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {
repository.tryToCacheItemsAndGetNewOnes() repository.tryToCacheItemsAndGetNewOnes()
@ -1348,8 +1354,9 @@ 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(
SelfossModel.Source(
1, 1,
"First source", "First source",
listOf("Test", "second"), listOf("Test", "second"),
@ -1357,6 +1364,7 @@ class RepositoryTest {
"", "",
"d8c92cdb1ef119ea85c4b9205c879ca7.png" "d8c92cdb1ef119ea85c4b9205c879ca7.png"
) )
)
repository.searchFilter = "search" repository.searchFilter = "search"
runBlocking { runBlocking {
repository.tryToCacheItemsAndGetNewOnes() repository.tryToCacheItemsAndGetNewOnes()