Skip to content

Commit

Permalink
Update UI tests
Browse files Browse the repository at this point in the history
Make sure @ExperimentalAdaptiveApi has been added and make sure pixel values are rounded in the same way as the implementation
  • Loading branch information
khalp committed Jun 12, 2023
1 parent 41a7c60 commit 38c9d95
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@OptIn(ExperimentalAdaptiveApi::class)
class FoldAwareColumnTest {
@get:Rule
val composeTestRule = createAndroidComposeRule<ComponentActivity>()
Expand Down Expand Up @@ -151,7 +152,7 @@ class FoldAwareColumnTest {
val foldBoundsPx = simulateFoldingFeature()

with(density) {
assertEquals(foldBoundsPx.bottom + foldPaddingDp.toPx(), secondSpacerTopPx)
assertEquals(foldBoundsPx.bottom + foldPaddingDp.roundToPx(), secondSpacerTopPx)
}
}

Expand All @@ -171,7 +172,7 @@ class FoldAwareColumnTest {
val foldBoundsPx = simulateFoldingFeature()

with(density) {
assertEquals(foldBoundsPx.bottom + foldPaddingBottom.toPx(), secondSpacerTopPx)
assertEquals(foldBoundsPx.bottom + foldPaddingBottom.roundToPx(), secondSpacerTopPx)
}
}

Expand Down

0 comments on commit 38c9d95

Please sign in to comment.