Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Apr 17, 2024
1 parent 62ada11 commit a5e3bf3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/src/test/kotlin/feeds/FeedsModelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package feeds

import conf.ConfRepo
import db.testDb
import entries.EntriesRepo
import io.mockk.mockk
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.filterIsInstance
Expand Down Expand Up @@ -34,10 +35,12 @@ class FeedsModelTest {
val db = testDb()
val confRepo = ConfRepo(db)
val feedsRepo = FeedsRepo(mockk(), db)
val entriesRepo = EntriesRepo(mockk(), db)

val model = FeedsModel(
confRepo = confRepo,
feedsRepo = feedsRepo,
entriesRepo = entriesRepo,
)

withTimeout(1000) {
Expand Down
7 changes: 6 additions & 1 deletion app/src/test/kotlin/feeds/FeedsRepositoryTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package feeds

import api.Api
import db.Entry
import db.Feed
import db.insertRandomFeed
import db.testDb
Expand Down Expand Up @@ -54,7 +55,11 @@ class FeedsRepositoryTest {
ext_show_preview_images = null,
)

coEvery { api.addFeed(feedUrl) } returns Result.success(feed)
val entries = listOf<Entry>()

val res = Pair(feed, entries)

coEvery { api.addFeed(feedUrl) } returns Result.success(res)

repo.insertByUrl(feedUrl)

Expand Down

0 comments on commit a5e3bf3

Please sign in to comment.