Tgo1014
12/12/2022, 3:33 PMStylianos Gakis
12/12/2022, 6:42 PMTgo1014
12/12/2022, 6:46 PMStylianos Gakis
12/12/2022, 6:54 PMAlex Vanyo
12/12/2022, 9:19 PMAlex Vanyo
12/12/2022, 9:23 PMTestHarness
was for this situation, to be able to say “render this component/screen at 800dp by 500dp, and verify that this is the behavior”, instead of having to implicitly depend on the emulator being used to run the testAlex Vanyo
12/12/2022, 9:24 PM@Test
fun example() {
composeTestRule.setContent {
TestHarness(size = DpSize(800.dp, 500.dp)) {
MyComponent() // will be rendered at 800dp by 500dp, even if the window is smaller
}
}
}
Stylianos Gakis
12/12/2022, 9:32 PMTgo1014
12/13/2022, 12:27 PMTestHarness
is the way to go to be able to test all the cases in a single device, so I'll update my test to run with it. I'll let you know if there's any feedback or issues 😄