Skip to content

Commit

Permalink
chore(tests): support vintage engine (junit4) and add robolectric (AC…
Browse files Browse the repository at this point in the history
…OL-139) (#2662)
  • Loading branch information
yamilmedina authored Feb 6, 2024
1 parent fe78d52 commit 1889535
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 140 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ dependencies {
testImplementation(libs.kluent.core)
testImplementation(libs.turbine)
testImplementation(libs.okio.fakeFileSystem)
testImplementation(libs.robolectric)
testRuntimeOnly(libs.junit5.vintage.engine)
testRuntimeOnly(libs.junit5.engine)
testImplementation(libs.androidx.paging.testing)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ class EditGuestAccessViewModel @Inject constructor(
)
)

is UpdateConversationAccessRoleUseCase.Result.Success -> Unit
is UpdateConversationAccessRoleUseCase.Result.Success -> updateState(
editGuestAccessState.copy(
isGuestAccessAllowed = shouldEnableGuestAccess
)
)
}
updateState(editGuestAccessState.copy(isUpdatingGuestAccess = false))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package com.wire.android.mapper
import com.wire.android.ui.home.conversationslist.model.Membership
import com.wire.kalium.logic.data.user.type.UserType
import org.amshove.kluent.internal.assertEquals
import org.junit.Test
import org.junit.jupiter.api.Test

class UserTypeMapperTest {

Expand All @@ -48,7 +48,7 @@ class UserTypeMapperTest {
@Test
fun `given internal as a user type correctly map to none as membership`() {
val result = userTypeMapper.toMembership(UserType.INTERNAL)
assertEquals(Membership.None, result)
assertEquals(Membership.Standard, result)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import com.wire.android.config.CoroutineTestExtension
import com.wire.kalium.logic.data.id.QualifiedID
import com.wire.kalium.logic.data.user.UserId
import org.amshove.kluent.internal.assertEquals
import org.junit.Test
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

@ExtendWith(CoroutineTestExtension::class)
class MigrationMapperTest {

private lateinit var migrationMapper: MigrationMapper

@BeforeEach
fun setUp() {
migrationMapper = MigrationMapper()
Expand Down
Loading

0 comments on commit 1889535

Please sign in to comment.