alorma
08/05/2021, 4:53 PMjunit.framework.AssertionFailedError: No tests found in com.alorma.coupons.CouponTicketTest
code in threadalorma
08/05/2021, 4:54 PMclass CouponTicketTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test
fun collapsedCouponTicket() {
composeTestRule.setContent {
CouponsTheme {
CouponItem(coupon = COUPON_PERCENTAGE_COLLAPSED, onClick = { /*TODO*/ })
}
}
composeTestRule.onNodeWithContentDescription("Start date $START_DATE").assertIsDisplayed()
composeTestRule.onNodeWithText(PERCENTAGE_DISCOUNT).assertIsDisplayed()
composeTestRule.onNodeWithText(START_DATE).assertIsDisplayed()
composeTestRule.onNodeWithText(EXPIRE_DATE).assertDoesNotExist()
}
companion object {
private const val PERCENTAGE_DISCOUNT = "3%"
private const val START_DATE = "22/07/2021"
private const val EXPIRE_DATE = "20/08/2021"
private val COUPON_PERCENTAGE_COLLAPSED = CouponItemViewModel(
id = CouponId("1"),
message = "Por compras superiores a 15€",
startDate = START_DATE,
expireDate = EXPIRE_DATE,
value = "3",
type = CouponType.PERCENTAGE,
expanded = true,
)
}
}
alorma
08/05/2021, 4:55 PMVitaliy Zarubin
08/05/2021, 5:02 PMalorma
08/05/2021, 5:04 PMalorma
08/05/2021, 5:36 PM