Fix test fixtures

This commit is contained in:
Honza 2024-08-20 18:29:26 +02:00
parent b39e4cc006
commit 8cf586f27b
3 changed files with 16 additions and 9 deletions

View File

@ -3,5 +3,7 @@ package co.electriccoin.zcash.ui.fixture
import co.electriccoin.zcash.ui.common.wallet.ExchangeRateState
object ExchangeRateStateFixture {
fun new() = ExchangeRateState.OptedOut
val STATE = ExchangeRateState.OptedOut
fun new(state: ExchangeRateState = STATE) = state
}

View File

@ -5,14 +5,18 @@ import co.electriccoin.zcash.ui.common.wallet.ExchangeRateState
import kotlinx.datetime.Clock
object ObserveFiatCurrencyResultFixture {
const val IS_LOADING: Boolean = true
const val IS_STALE: Boolean = false
const val IS_REFRESH_ENABLED: Boolean = false
val CURRENCY_CONVERSION: FiatCurrencyConversion = FiatCurrencyConversion(
timestamp = Clock.System.now(),
priceOfZec = 25.0
)
fun new(
isLoading: Boolean = true,
isStale: Boolean = false,
isRefreshEnabled: Boolean = true,
currencyConversion: FiatCurrencyConversion? =
FiatCurrencyConversion(
timestamp = Clock.System.now(),
priceOfZec = 25.0
),
isLoading: Boolean = IS_LOADING,
isStale: Boolean = IS_STALE,
isRefreshEnabled: Boolean = IS_REFRESH_ENABLED,
currencyConversion: FiatCurrencyConversion? = CURRENCY_CONVERSION,
) = ExchangeRateState.Data(isLoading, isStale, isRefreshEnabled, currencyConversion) {}
}

View File

@ -3,6 +3,7 @@ package co.electriccoin.zcash.ui.util
import android.content.res.Configuration
import androidx.compose.ui.tooling.preview.Preview
@Suppress("UnusedPrivateMember")
@Preview(name = "1: Light preview", showBackground = true)
@Preview(name = "2: Dark preview", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
annotation class PreviewScreens