-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Runtime snapshot runtime tests of Layout Animation on fabric #6538
base: main
Are you sure you want to change the base?
Changes from all commits
63e4aae
5eedefd
2a9ba90
2eae07e
4b6e2c4
0ac1839
ddabf41
b134e00
6145a15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,13 @@ function compareSnapshot( | |
const comparisonMode = isValidPropName(key) ? getComparisonModeForProp(key) : ComparisonMode.AUTO; | ||
const isEqual = getComparator(comparisonMode); | ||
const expectMismatch = jsValue < 0 && expectNegativeValueMismatch; | ||
const valuesAreMatching = isEqual(jsValue, nativeValue); | ||
let valuesAreMatching = isEqual(jsValue, nativeValue); | ||
|
||
if ((key as string) === 'opacity' && jsValue === 1 && nativeValue === undefined) { | ||
// undefined opacity may get translated into 1, as it is the default value | ||
valuesAreMatching = true; | ||
} | ||
Comment on lines
+22
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, here we need to verify why in the JS update, we can receive undefined values There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In our layout animations we use function |
||
|
||
if ((!valuesAreMatching && !expectMismatch) || (valuesAreMatching && expectMismatch)) { | ||
return false; | ||
} | ||
|
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.
This is something we need to verify. Does it happen all the time or just sometimes? Additionally, it will break in cases where we want to test animations for more than one component.
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, it happens all the time and breaks some of our animations. However most of our tests features only one component.