Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import cc.wordview.app.ui.activities.RepositoryModule
import cc.wordview.app.ui.activities.auth.viewmodel.login.LoginRepository
import cc.wordview.app.ui.activities.auth.viewmodel.register.RegisterRepository
import cc.wordview.app.ui.activities.home.composables.home.HomeRepository
import cc.wordview.app.ui.screens.player.MockPlayerRepositoryImpl
import cc.wordview.app.ui.activities.player.viewmodel.PlayerRepository
import cc.wordview.app.ui.screens.search.MockSearchRepositoryImpl
import cc.wordview.app.ui.activities.home.composables.search.SearchRepository
import cc.wordview.app.ui.screens.home.MockHomeRepositoryImpl
import cc.wordview.app.ui.screens.login.MockLoginRepositoryImpl
import cc.wordview.app.ui.screens.player.MockPlayerRepositoryImpl
import cc.wordview.app.ui.screens.register.MockRegisterRepositoryImpl
import dagger.hilt.components.SingletonComponent
import dagger.hilt.testing.TestInstallIn
Expand Down
26 changes: 24 additions & 2 deletions app/src/androidTest/java/cc/wordview/app/api/HomeRequestTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,31 @@ import org.junit.Test

class HomeRequestTest : RequestTest() {
@Test
fun getHome() {
fun getHomeEn() {
val request = HomeRequest(
"$endpoint/api/v1/home",
"$endpoint/api/v1/home?learnLang=en",
{ assert(it.size == 1) },
{ _, _ -> throw FailedTestRequestException("Are you sure the API is running?") }
)

makeRequest(request)
}

@Test
fun getHomeJa() {
val request = HomeRequest(
"$endpoint/api/v1/home?learnLang=ja",
{ assert(it.size == 1) },
{ _, _ -> throw FailedTestRequestException("Are you sure the API is running?") }
)

makeRequest(request)
}

@Test
fun getHomePt() {
val request = HomeRequest(
"$endpoint/api/v1/home?learnLang=pt",
{ assert(it.size == 1) },
{ _, _ -> throw FailedTestRequestException("Are you sure the API is running?") }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SongCardTest : ComposeTest() {
thumbnail = "",
artist = artist,
asyncImagePlaceholders = AsyncImagePlaceholders(
noConnectionWhite = R.drawable.nonet,
noConnectionDark = R.drawable.nonet_dark
noConnectionWhite = cc.wordview.app.R.drawable.nonet,
noConnectionDark = cc.wordview.app.R.drawable.nonet_dark
),
duration = duration,
trackName = trackName
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ class MockPlayerRepositoryImpl @Inject constructor() : PlayerRepository {
override lateinit var queue: RequestQueue

override fun getLyrics(id: String, lang: String, video: VideoStreamInterface) {
if (mocklyrics == "fail_trigger") {
onFail(mocklyrics, 0)
} else {
val (lyrics, dictionary) = parseLyricsAndDictionary(mocklyrics)
onSucceed(lyrics, dictionary)
}

}
}

This file was deleted.

This file was deleted.

Loading