Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generating Screenshot tests from Previews does not apply all PreviewInfos if used with AndroidView composable with XML-Views inside #634

Open
sergio-sastre opened this issue Jan 19, 2025 · 0 comments

Comments

@sergio-sastre
Copy link
Contributor

This is a very uncommon case, but one can use Previews to preview Custom XML-Views.

I've observed that if using the plugin option from Roborazzi to autogenerate screenshot tests out of previews, locale, uiMode and fontscale are not applied properly.

it seems that is because the RoborazziComposeOption previewDevice is applied in the middle.

if one applies it at the very beginning, it works as expected. The branch to reproduce it would be here:
Here it works as expected, as previewDevice is set at the very beginning:

However, if you change the order as in Roborazzi in this class
not all previewInfos are applied.

Although this seems straightforward to solve, there are 2 open questions:

  1. Do we want to write a screenshot test to cover this case?
  2. Since the order seems to be relevant (although only in this case), do we want to "warn" the user if previewDevice is used and it is not first?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant