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
[system] Remove dependency on overridesResolver
for the variants
#27859
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ba149b
fix issue with variants resolver that depends on overridesResolver
mnajdova 5585e10
revert some changes
mnajdova 98d2565
Fix tests
mnajdova be99606
Update packages/material-ui-system/src/styled.test.js
mnajdova e30e28e
Restore styled.test.js
eps1lon 845fb6b
Revert "Restore styled.test.js"
eps1lon File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What do you mean by "skipped" here. The test looks like it's not using
variant
in any way and is also passing without the change.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 you maybe use a theme that has styles for this specific variant?
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 is used on line 322 https://github.com/mui-org/material-ui/pull/27859/files#diff-57eedb98ff493d66eb3e22d9e9ef1b1540504af969aa62accbb30b3a2a780044R322 The same theme is used in all tests. It is defined in https://github.com/mui-org/material-ui/blob/5585e100feec585f40f42ba2db605a56d1594718/packages/material-ui-system/src/styled.test.js#L140
Previously the
variants
from the theme were not applied, if when creating the component, theoverridesResolver
option was not applied. That's what I mean by should not be skipped.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.
But that's not related to the change in implementation in this PR. I ran the test with
yarn test:karma
and in JSDOM locally onnext
and it is passing.This is confusing long-term because usually tests are coupled with the change in implementation. But here the change in implementation and test are unrelated.
Maybe you need to assert on different CSS properties to showcase what behavior changed?
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 your point. I've fixed the tests. I was adding tests for a non root slot, but then variants are never applied :)