Closed adityagarg06 closed 4 months ago
FYI I've held off on merging this one because I wanted to see what happened with regards to a problem in the current test code which you may have seen before where the theme
value is not always set in the state. That's my mistake -- I wrote some of the test code expecting a deep merge of the Redux state and then we ended up with a shallow merge.
PASS client client/modules/IDE/components/Preferences/Preferences.unit.test.jsx (13.318 s)
● Console
console.error
Warning: Failed prop type: The prop `currentTheme` is marked as required in `Provider`, but its value is `undefined`.
in Provider (created by Connect(Provider))
in Connect(Provider) (created by Wrapper)
in Provider (created by Wrapper)
in I18nextProvider (created by Wrapper)
in Wrapper
115 | };
116 |
> 117 | return { store, ...render(ui, { wrapper: Wrapper, ...renderOptions }) };
| ^
118 | }
119 |
120 | /**
I'm going to go ahead and fix that now and merge it into this branch.
Progress on #2042
Changes:
mapStateToProps
andconnect
functions with useSelector to select the desired state.currentTheme
from the PropTypes as it is obtained from Redux Store.I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123