Skip to content

Commit

Permalink
[#21] Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Dec 16, 2022
1 parent 1a0b08c commit 243739f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package co.nimblehq.blisskmmic.data.model

import co.nimblehq.blisskmmic.domain.model.Survey
import co.nimblehq.blisskmmic.domain.model.User
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
Expand All @@ -11,10 +12,9 @@ data class UserApiModel(
val email: String,
val name: String,
@SerialName("avatar_url") val avatarUrl: String
) {
)

fun toUser(): User = User(
name,
avatarUrl
)
}
fun UserApiModel.toUser() = User(
name,
avatarUrl
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package co.nimblehq.blisskmmic.data.repository

import co.nimblehq.blisskmmic.data.model.toUser
import co.nimblehq.blisskmmic.data.network.datasource.NetworkDataSource
import co.nimblehq.blisskmmic.data.network.target.UserProfileTargetType
import co.nimblehq.blisskmmic.domain.model.User
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import kotlin.test.assertTrue
class StringRegexTest {

@Test
fun `When calling isValidEmail emails, it returns correct validity`() {
fun `When calling isValidEmail emails- it returns correct validity`() {
"a@a.co.uk".isValidEmail() shouldBe true
"ab.cd@abc.org".isValidEmail() shouldBe true
"a@a.com".isValidEmail() shouldBe true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LoginViewModelTest : TestsWithMocks() {
}

@Test
fun `When calling login with an invalid email, it changes viewState to error`() = runTest {
fun `When calling login with an invalid email- it changes viewState to error`() = runTest {
loginViewModel.login("invalid", password)

val result = loginViewModel
Expand All @@ -88,7 +88,7 @@ class LoginViewModelTest : TestsWithMocks() {
}

@Test
fun `When calling login with an empty password, it changes viewState to error`() = runTest {
fun `When calling login with an empty password- it changes viewState to error`() = runTest {
loginViewModel.login(email, "")

val result = loginViewModel
Expand Down

0 comments on commit 243739f

Please sign in to comment.