Skip to content

Commit 756afc2

Browse files
Set coupon add-to-cart testTag inside clearAndSetSemantics so it survives semantics clearing
1 parent bf06d95 commit 756afc2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/items/WooPosItemsList.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import androidx.compose.ui.res.stringResource
3737
import androidx.compose.ui.res.vectorResource
3838
import androidx.compose.ui.semantics.clearAndSetSemantics
3939
import androidx.compose.ui.semantics.contentDescription
40+
import androidx.compose.ui.semantics.testTag
4041
import androidx.compose.ui.text.font.FontWeight
4142
import androidx.compose.ui.text.style.TextOverflow
4243
import androidx.compose.ui.unit.dp
@@ -367,8 +368,10 @@ fun WooPosCouponCard(
367368
enabled = item.expiredState is Coupon.ExpiredState.NotExpired,
368369
onClickLabel = stringResource(R.string.woopos_add_coupon_to_cart_accessibility_label)
369370
) { onItemClicked(item) }
370-
.clearAndSetSemantics { contentDescription = itemContentDescription }
371-
.testTag(WooPosTestTags.COUPON_ADD_TO_CART_BUTTON)
371+
.clearAndSetSemantics {
372+
contentDescription = itemContentDescription
373+
testTag = WooPosTestTags.COUPON_ADD_TO_CART_BUTTON
374+
}
372375
.height(IntrinsicSize.Min)
373376
.fillMaxWidth(),
374377
verticalAlignment = Alignment.CenterVertically

0 commit comments

Comments
 (0)