Skip to content

Commit

Permalink
🔀 Merge main into test/loginviewmodel-frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
sukchan-0811 committed Nov 3, 2023
2 parents 5baf2bb + 64f4433 commit e0a8502
Show file tree
Hide file tree
Showing 3 changed files with 511 additions and 14 deletions.
11 changes: 6 additions & 5 deletions frontend/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

}

dependencies {
Expand All @@ -61,6 +62,7 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
testImplementation("androidx.arch.core:core-testing:2.2.0")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
Expand All @@ -82,6 +84,7 @@ dependencies {
val coroutinesVersion = "1.7.1"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")

// Preference
implementation("androidx.preference:preference-ktx:1.2.1")
Expand Down Expand Up @@ -118,10 +121,8 @@ dependencies {

implementation("androidx.hilt:hilt-navigation-compose:1.0.0")

// Test
// MockK
val mockkVersion = "1.13.8"
testImplementation ("io.mockk:mockk-android:$mockkVersion")
testImplementation ("io.mockk:mockk-agent:$mockkVersion")
testImplementation ("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation ("androidx.arch.core:core-testing:2.1.0")
testImplementation("io.mockk:mockk-agent:$mockkVersion")
testImplementation("io.mockk:mockk-android:$mockkVersion")
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package com.example.speechbuddy
package com.example.speechbuddy.viewmodel

import android.util.Log
import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import com.example.speechbuddy.R
import com.example.speechbuddy.data.remote.requests.AuthLoginRequest
import com.example.speechbuddy.data.remote.requests.AuthSignupRequest
import com.example.speechbuddy.domain.models.AuthToken
import com.example.speechbuddy.repository.AuthRepository
import com.example.speechbuddy.ui.models.LoginErrorType
import com.example.speechbuddy.ui.models.SignupErrorType
import com.example.speechbuddy.utils.Resource
import com.example.speechbuddy.utils.Status
import com.example.speechbuddy.viewmodel.LoginViewModel
import com.example.speechbuddy.viewmodel.SignupViewModel
import io.mockk.coEvery
import io.mockk.impl.annotations.MockK
import io.mockk.mockk
Expand All @@ -21,13 +16,11 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.newSingleThreadContext
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.test.setMain
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

class LoginViewModelTest {
private val mainThreadSurrogate = newSingleThreadContext("UI thread")
Expand Down
Loading

0 comments on commit e0a8502

Please sign in to comment.