Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micbakos-rdx committed Jul 2, 2024
1 parent 7cc391d commit f653fe3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ private const val SHORT_KEY_THRESHOLD = 30
private const val SHORT_VALUE_THRESHOLD = 40
private val Metadata.isRenderedInNewLine: Boolean
get() = this is Metadata.Primitive && (
valueType is MetadataType.Url ||
(valueType is MetadataType.String && value.length > SHORT_VALUE_THRESHOLD) ||
(valueType is MetadataType.NonFungibleGlobalId)
)
valueType is MetadataType.Url ||
(valueType is MetadataType.String && value.length > SHORT_VALUE_THRESHOLD) ||
(valueType is MetadataType.NonFungibleGlobalId)
)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import androidx.compose.ui.unit.dp
import com.babylon.wallet.android.R
import com.babylon.wallet.android.designsystem.composable.RadixPrimaryButton
import com.babylon.wallet.android.designsystem.theme.RadixTheme
import com.babylon.wallet.android.presentation.account.composable.MetadataValueView
import com.babylon.wallet.android.presentation.account.composable.MetadataView
import com.babylon.wallet.android.presentation.status.assets.AssetDialogViewModel
import com.babylon.wallet.android.presentation.status.assets.BehavioursSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ sealed interface ActionableAddress {
) : ActionableAddress {

@Transient
override val displayable: String = if (isOnlyLocalIdVisible) {
override val displayable: String = if (isOnlyLocalIdVisible) {
address.nonFungibleLocalId.formatted(AddressFormat.DEFAULT)
} else {
address.formatted(AddressFormat.DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class AddressDashboardUrlTest(
val actionableAddress = runCatching {
ActionableAddress.Address(Address.init(address), true)
}.getOrNull() ?: runCatching {
ActionableAddress.GlobalId(NonFungibleGlobalId.init(address), true)
ActionableAddress.GlobalId(NonFungibleGlobalId.init(address), true, true)
}.getOrNull() ?: runCatching {
ActionableAddress.TransactionId(IntentHash.init(address), true)
}.getOrNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class AddressDetailsDialogViewModelTest : StateViewModelTest<AddressDetailsDialo
val rawAddress = "resource_tdx_2_1n2kfpqnlzntcgddq0sfzq9attnc7y7hqkdz6ykedhn76ghw662el6s:#$number#"
val globalId = NonFungibleGlobalId.init(rawAddress)

val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true)
val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true, isOnlyLocalIdVisible = true)

val section = AddressDetailsDialogViewModel.State.Section.FullAddress.from(actionableAddress)

Expand All @@ -469,7 +469,7 @@ class AddressDetailsDialogViewModelTest : StateViewModelTest<AddressDetailsDialo
"{bce508b789ed38e4-9a8552cb3142fdc5-3491317d130e6483-46df034d5ffbd210}"
val globalId = NonFungibleGlobalId.init(rawAddress)

val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true)
val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true, isOnlyLocalIdVisible = true)

val section = AddressDetailsDialogViewModel.State.Section.FullAddress.from(actionableAddress)

Expand All @@ -495,7 +495,7 @@ class AddressDetailsDialogViewModelTest : StateViewModelTest<AddressDetailsDialo
val rawAddress = "resource_tdx_2_1nth7zjtujhvmzfpyn9rvu9nexzmye554q6uv7xcchhalsa53r4zqfe:${localId.string}"
val globalId = NonFungibleGlobalId.init(rawAddress)

val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true)
val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true, isOnlyLocalIdVisible = true)

val section = AddressDetailsDialogViewModel.State.Section.FullAddress.from(actionableAddress)

Expand All @@ -519,7 +519,7 @@ class AddressDetailsDialogViewModelTest : StateViewModelTest<AddressDetailsDialo
val rawAddress = "resource_tdx_2_1nth7zjtujhvmzfpyn9rvu9nexzmye554q6uv7xcchhalsa53r4zqfe:<a_very_big_string_that_is_not_truncated>"
val globalId = NonFungibleGlobalId.init(rawAddress)
println(globalId.nonFungibleLocalId.formatted())
val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true)
val actionableAddress = ActionableAddress.GlobalId(address = globalId, isVisitableInDashboard = true, isOnlyLocalIdVisible = true)

val section = AddressDetailsDialogViewModel.State.Section.FullAddress.from(actionableAddress)

Expand Down

0 comments on commit f653fe3

Please sign in to comment.