Ji Sungbin
09/25/2022, 4:46 PMModifier.size
to the same size, but the assertion fails. Am I using the aasertion api wrong?
@Test
fun size_is_500_x_500() {
val size = 500.dp
testRule.setContent {
Box(
modifier = Modifier.size(
size = size,
),
)
}
testRule
.onRoot()
.assertWidthIsEqualTo(
expectedWidth = size,
)
.assertHeightIsEqualTo(
expectedHeight = size,
)
}
java.lang.AssertionError: Actual width is 392.72726.dp, expected 500.0.dp (tolerance: 0.5.dp)
Zaki Shaikh
09/25/2022, 4:55 PMJi Sungbin
09/25/2022, 4:59 PM