-
Notifications
You must be signed in to change notification settings - Fork 74
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
Layout modifier screenshot tests #1995
Layout modifier screenshot tests #1995
Conversation
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 great. We can file individual bugs for each implementation whose behavior is broken once this merges.
...ayout-shared-test/src/commonMain/kotlin/app/cash/redwood/layout/AbstractFlexContainerTest.kt
Outdated
Show resolved
Hide resolved
container.onEndChanges() | ||
verifySnapshot(container, "Margin") | ||
first.modifier = Modifier | ||
container.onEndChanges() |
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.
In the other test you call widget.children.onModifierUpdated(0, redColor)
. Seems like both tests should have the same behavior here. We probably want to call both onModifierUpdated()
and onEndChanges()
in both tests.
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 modified TestFlexContainer
to expose the children
property so that we can use children.onModifierUpdated(0, widget)
inside AbstractFlexContainerTest.kt.
Should we add container.onEndChanges()
to AbstractBoxTest
? This will require us to provide a ChangeListener
implementation for the Box
widget under test. In my opinion, this is a significant change. So, should we stick with using children.onModifierUpdated
in both tests or work to support the ChangeListener
for the Box
widget?
Actually the problem with Compose UI's Box and margins on children is known: #2006. It was simply an omission on the initial PR. |
Used when we need to notify the parent with change in children's modifier `children.onModifierUpdated`
3c2ad0b
to
4068f49
Compare
Updated the description with UIView findings |
I tried this and it worked?
|
The pointfree library has some non-determinism. I don't know why. Explored a bit here: #1988 (comment) |
Fixes #1877
This is a draft to collect feedback about the screenshot test results in View and ComposeUI.
ComposeUI
Box
⚠️ There is no difference in the test results whether or not the margin is assigned. The margin is always "empty" in the screenshots.
Column & Row
✅ Screenshots recorded as expected.
View
UIView
Box
⚠️ The margin is always "empty" in the screenshots.
Column & Row
⚠️ The margin is always "Applied" in the screenshots.
See #1877 (comment) or File changes for a visual explanation
Is my test approach correct? If so, should we create issues for the identified findings?
CHANGELOG.md
's "Unreleased" section has been updated, if applicable.