Skip to content

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Apr 2, 2019

Continues #15131. Using "root component = component that renders the outermost host" covers more components while also being testable.

The root class is now (following the docs text) an afterthought. "The root class 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 the root class can be different for each component we allow describeConformance to signal that its root class doesn't follow the usual definition.

@mui-pr-bot
Copy link

mui-pr-bot commented Apr 2, 2019

No bundle size changes comparing 638ca64...6ddb98a

Generated by 🚫 dangerJS against 6ddb98a

@eps1lon eps1lon force-pushed the test/conformance-outermost branch 2 times, most recently from a31a15a to e17e5cc Compare April 2, 2019 21:26
refInstanceof: window.HTMLSpanElement,
}));

/* TODO Switch violates root component
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using skip?

Copy link
Member Author

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,
Copy link
Member

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 🤔.

Copy link
Member Author

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.

Copy link
Member

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.

May be an enzyme bug. Can only find Transition by display name
not constructor
@eps1lon eps1lon force-pushed the test/conformance-outermost branch from af4fc4f to e4ecfd0 Compare April 3, 2019 09:06
@eps1lon eps1lon merged commit 7c7645e into mui:next Apr 3, 2019
@eps1lon eps1lon deleted the test/conformance-outermost branch April 3, 2019 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants