Skip to content

Commit

Permalink
add ui locators
Browse files Browse the repository at this point in the history
  • Loading branch information
mrZizik committed Oct 18, 2023
1 parent a4dd7d3 commit e74407a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.Dimension
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.BleachedButton
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -90,6 +91,7 @@ fun BasicBannerCard(
val (card, image) = createRefs()
CardContent(
modifier = Modifier
.testTagAsId("StartInviting")
.constrainAs(card) {
top.linkTo(parent.top)
start.linkTo(parent.start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.TextButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -136,6 +137,7 @@ fun ReferralAvailableInvitationsCard(

FilledButton(
modifier = Modifier
.testTagAsId("GetMoreInvitations")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(R.string.referral_get_more_invitation_button_title),
Expand All @@ -147,6 +149,7 @@ fun ReferralAvailableInvitationsCard(
if (state.invitationsCount > 0) {
TextButton(
modifier = Modifier
.testTagAsId("UnbondXor")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(id = R.string.referral_unbond_button_title),
Expand All @@ -166,7 +169,10 @@ fun PreviewReferralAvailableInvitationsCard() {
state = ReferralInvitationsCardState(
"Available invitations",
5,
WrappedTextState(title = "Invitations Link", text = "polkaswap.io/#/referral/cnVyaue39dssBc2bReZycusLdys3vbeoz2irRF8BbwVcdCNmm"),
WrappedTextState(
title = "Invitations Link",
text = "polkaswap.io/#/referral/cnVyaue39dssBc2bReZycusLdys3vbeoz2irRF8BbwVcdCNmm"
),
"0.0008 XOR",
referrals = ReferralsCardState()
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import androidx.compose.ui.unit.dp
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.presentation.compose.components.DetailsItemNetworkFee
import jp.co.soramitsu.common.presentation.compose.theme.SoraAppTheme
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.common.view.WarningTextCard
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.LoaderWrapper
Expand Down Expand Up @@ -152,6 +153,7 @@ fun ReferralBondXor(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("BondXor")
.fillMaxWidth(),
size = Size.Large,
order = Order.PRIMARY,
Expand Down Expand Up @@ -241,6 +243,7 @@ fun ReferralUnbondXor(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("UnbondXor")
.fillMaxWidth(),
size = Size.Large,
order = Order.PRIMARY,
Expand Down Expand Up @@ -289,7 +292,9 @@ fun InvitationsEnterField(
tint = MaterialTheme.customColors.fgSecondary,
)
TextField(
modifier = Modifier.weight(1f),
modifier = Modifier
.testTagAsId("InvitationsInput")
.weight(1f),
value = count.toString(),
onValueChange = {
onCountChange.invoke(it.toIntOrNull() ?: 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.TonalButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -71,6 +72,7 @@ internal fun ReferralButtons(

TonalButton(
modifier = Modifier
.testTagAsId("BottomButton")
.padding(top = Dimens.x1)
.fillMaxWidth(),
text = stringResource(bottomButtonText),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.FilledButton
import jp.co.soramitsu.ui_core.component.button.LoaderWrapper
import jp.co.soramitsu.ui_core.component.button.properties.Order
Expand Down Expand Up @@ -89,6 +90,7 @@ fun ReferrerInput(

InputText(
modifier = Modifier
.testTagAsId("LinkAddressInput")
.background(MaterialTheme.customColors.bgSurface)
.fillMaxWidth()
.wrapContentHeight(),
Expand All @@ -109,6 +111,7 @@ fun ReferrerInput(
) { modifier, elevation ->
FilledButton(
modifier = modifier
.testTagAsId("Activate")
.fillMaxWidth()
.padding(top = Dimens.x3),
size = Size.Large,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import jp.co.soramitsu.common.R
import jp.co.soramitsu.common.util.ext.testTagAsId
import jp.co.soramitsu.ui_core.component.button.TonalButton
import jp.co.soramitsu.ui_core.component.button.properties.Order
import jp.co.soramitsu.ui_core.component.button.properties.Size
Expand Down Expand Up @@ -81,6 +82,7 @@ fun YourReferrerCard(
} else {
TonalButton(
modifier = Modifier
.testTagAsId("EnterReferrersLink")
.fillMaxWidth(),
text = stringResource(R.string.referral_enter_link_title),
onClick = onEnterReferrersLink,
Expand Down

0 comments on commit e74407a

Please sign in to comment.