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
initializeRepository(MutableStateFlow(false))
repository.tagFilter = SelfossModel.Tag("Test", "red", 3)
repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Test", "red", 3))
runBlocking {
repository.getNewerItems()
}
@ -224,7 +224,8 @@ class RepositoryTest {
every { appSettingsService.isItemCachingEnabled() } returns true
initializeRepository(MutableStateFlow(false))
repository.sourceFilter = SelfossModel.Source(
repository.sourceFilter = MutableStateFlow(
SelfossModel.Source(
1,
"Test",
listOf("tags"),
@ -232,6 +233,7 @@ class RepositoryTest {
"",
"b3aa8a664d08eb15d6ff1db2fa83e0d9.png"
)
)
runBlocking {
repository.getNewerItems()
}
@ -1302,8 +1304,9 @@ class RepositoryTest {
)
initializeRepository()
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0)
repository.sourceFilter = SelfossModel.Source(
repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = MutableStateFlow(
SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
@ -1311,6 +1314,7 @@ class RepositoryTest {
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
)
repository.searchFilter = "search"
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()
@ -1325,8 +1329,9 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem())
initializeRepository()
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0)
repository.sourceFilter = SelfossModel.Source(
repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = MutableStateFlow(
SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
@ -1334,6 +1339,7 @@ class RepositoryTest {
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
)
repository.searchFilter = "search"
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()
@ -1348,8 +1354,9 @@ class RepositoryTest {
StatusAndData(success = false, data = generateTestApiItem())
initializeRepository(MutableStateFlow(false))
repository.tagFilter = SelfossModel.Tag("Tag", "read", 0)
repository.sourceFilter = SelfossModel.Source(
repository.tagFilter = MutableStateFlow(SelfossModel.Tag("Tag", "read", 0))
repository.sourceFilter = MutableStateFlow(
SelfossModel.Source(
1,
"First source",
listOf("Test", "second"),
@ -1357,6 +1364,7 @@ class RepositoryTest {
"",
"d8c92cdb1ef119ea85c4b9205c879ca7.png"
)
)
repository.searchFilter = "search"
runBlocking {
repository.tryToCacheItemsAndGetNewOnes()