Skip to content

Commit

Permalink
Call withStyles callback during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Sep 22, 2021
1 parent 2737d7c commit 85308bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/src/main/resources/sc-material-ui-styles-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ module.exports = {
MuiThemeProvider: 'MuiThemeProvider',
ThemeProvider: 'ThemeProvider',

withStyles: function () {
styles.withStyles(...arguments)
withStyles: function (stylesArg) {
if (typeof stylesArg == 'function') {
const theme = styles.createTheme({})
stylesArg(theme)
}

return comp => {
return "WithStylesMock-" + comp + "-" + (withStylesCompCounter++);
Expand Down

0 comments on commit 85308bb

Please sign in to comment.