-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add screenshot tests, coverage and publishing GH flows #5
Conversation
- Replace Paparazzi with Roborazzi. - Update icons from Compound. - Add Material You tests.
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
Also do some import cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks correct!
Just adding some ignorable comments!
compound/build.gradle.kts
Outdated
testImplementation(libs.test.roborazzi) | ||
testImplementation(libs.test.roborazzi.compose) | ||
testImplementation(libs.test.roborazzi.junit) | ||
testImplementation(libs.test.roborazzi.junit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is a duplicated line here.
compound/build.gradle.kts
Outdated
minValue = 80 | ||
// Setting a max value, so that if coverage is bigger, it means that we have to change minValue. | ||
// For instance if we have minValue = 20 and maxValue = 30, and current code coverage is now 31.32%, update | ||
// minValue to 25 and maxValue to 35. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove this comment, since there is no maxValue
here.
@@ -54,6 +60,7 @@ fun ColorPreview( | |||
Box( | |||
modifier = Modifier | |||
.padding(1.dp) | |||
.background(Color.White) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it have an effect? There is line 64 which set a background as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes: without this, the colors that have an alpha value are overlayed directly above this component's parent background, which is a gradient, and it's difficult to really understand what the color looks like unless you take a look at both extremes of each item (the pure white/black colors).
Although it might be that what we wanted when using the gradient, I'm not sure. I found it quite confusing myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gradient idea was to add a border with "several" colors. So it's fine to set a White bg, I did not think about colors with alpha. Thanks!
@Composable | ||
internal fun AvatarColorsDarkPreview() { | ||
val chunks = avatarColorsDark.chunked(4) | ||
ElementTheme { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want to force a dark theme here.
ElementTheme { | |
ElementTheme(darkTheme = true) { |
but the generated screenshots are correct since avatarColorsDark
is used here. So just ignore me!
ui-tooling-preview-android = "1.5.4" | ||
ui-tooling-preview-android = "1.6.1" | ||
kover = "0.7.5" | ||
roborazzi = "1.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will probably need to setup Renovate on this repo to handle the upgrades
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if it's something I can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take the point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #7
Changes:
ic_compound_
prefix instead ofic_
to avoid collisions with app or library resources.CompoundIcons
vector icon helpers are now functions (needed to get better coverage with Kover).