From 38c9d953d3fcb7e4792755c72ca894063109d8b9 Mon Sep 17 00:00:00 2001 From: Kristen Halper Date: Wed, 26 Apr 2023 14:32:28 -0700 Subject: [PATCH] Update UI tests Make sure @ExperimentalAdaptiveApi has been added and make sure pixel values are rounded in the same way as the implementation --- .../com/google/accompanist/adaptive/FoldAwareColumnTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adaptive/src/sharedTest/kotlin/com/google/accompanist/adaptive/FoldAwareColumnTest.kt b/adaptive/src/sharedTest/kotlin/com/google/accompanist/adaptive/FoldAwareColumnTest.kt index 6da81789c..ba724cfaf 100644 --- a/adaptive/src/sharedTest/kotlin/com/google/accompanist/adaptive/FoldAwareColumnTest.kt +++ b/adaptive/src/sharedTest/kotlin/com/google/accompanist/adaptive/FoldAwareColumnTest.kt @@ -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() @@ -151,7 +152,7 @@ class FoldAwareColumnTest { val foldBoundsPx = simulateFoldingFeature() with(density) { - assertEquals(foldBoundsPx.bottom + foldPaddingDp.toPx(), secondSpacerTopPx) + assertEquals(foldBoundsPx.bottom + foldPaddingDp.roundToPx(), secondSpacerTopPx) } } @@ -171,7 +172,7 @@ class FoldAwareColumnTest { val foldBoundsPx = simulateFoldingFeature() with(density) { - assertEquals(foldBoundsPx.bottom + foldPaddingBottom.toPx(), secondSpacerTopPx) + assertEquals(foldBoundsPx.bottom + foldPaddingBottom.roundToPx(), secondSpacerTopPx) } }