Hello folks, So i’m building some snapshot testing...
# compose
m
Hello folks, So i’m building some snapshot testing with paparazzi, but i’m having trouble with snapshotting dialogs. I assume it’s because they appear asynchronously.
Copy code
private fun snapshot(content: @Composable () -> Unit) {
        paparazzi.snapshot {
            XfinityTheme {
                Surface {
                    content()
                }
            }
        }
    }
This ends up screenshotting the screen where the dialog will be over, but not the actual dialog. Not sure if there’s a way to have paparazzi delay the snapshot or not.
a
Preview of dialogs is not supported in AS. Since Paparazzi uses the same library for rendering, dialogs are not supported in Paparazzi as well. Same as previews, you should use the content instead of the dialog itself.
m
@Albert Chang Dialog previews work fine in AS:
I also have this same issue with bottom sheets as well. Though AS doesn’t properly render modal bottom sheets in preview mode
a
Not in stable, since that's the version Paparazzi uses.