-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[test] Decouple root class from root component #15168
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
Conversation
|
No bundle size changes comparing 638ca64...6ddb98a |
a31a15a to
e17e5cc
Compare
| refInstanceof: window.HTMLSpanElement, | ||
| })); | ||
|
|
||
| /* TODO Switch violates root 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.
Oh yeah, I had forgotten about this one! :/ I have spent an afternoon trying to simplify the logic. I failed.
| inheritComponent: 'Transition', | ||
| mount, | ||
| skip: ['refForwarding'], | ||
| testComponentPropWith: 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.
Why not using skip?
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 will be removed in a final cleanup. This is legacy from before skip was available and when I had plans to test that it would not accept a component prop. It's consistent with the rest of the codebase.
| class: testClassName, | ||
| componentProp: testComponentProp, | ||
| mergeClassName: testClassName, | ||
| propsSpread: testPropsSpread, |
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.
Should we refactor this test to use the same strategy as testClassName (findOutermostIntrinsic)? Maybe we can use if for testComponentProp too 🤔.
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 see I still failed to explain why props spread is not bound to host components in our docs. If we say we spread to Paper we have to test for that. Not just the outermost host.
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 makes sense, thanks 👍. I was looking for a potential simplification of the tests.
e17e5cc to
af4fc4f
Compare
These are separate concepts in the docs. The root class is applied to the root component. Not the root component has the root class. There's probably a good analogy in relational databases to be found
May be an enzyme bug. Can only find Transition by display name not constructor
af4fc4f to
e4ecfd0
Compare
Continues #15131. Using "root component = component that renders the outermost host" covers more components while also being testable.
The
rootclass is now (following the docs text) an afterthought. "Therootclass is applied to the root component." Not "The root component has the root class". The distinction is important since not every component has a root class. Since the description for therootclass can be different for each component we allowdescribeConformanceto signal that itsrootclass doesn't follow the usual definition.