Skip to content

Commit

Permalink
simplify class names in test
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Dec 24, 2024
1 parent 6a426c6 commit d2226a0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import renderer from 'react-test-renderer'
// import { createMuiTheme } from '@material-ui/core'
import { createMuiTheme } from '@material-ui/core'

import BucketPreferences from './BucketPreferences'

// const theme = createMuiTheme()
const theme = createMuiTheme()
const noop = () => {}

jest.mock(
Expand Down Expand Up @@ -34,6 +34,16 @@ jest.mock(
{value} from [{options?.join(', ')}]
</div>
)),
makeStyles: jest.fn((cb: any) => () => {
const classes = typeof cb === 'function' ? cb(theme) : cb
return Object.keys(classes).reduce(
(acc, key) => ({
[key]: key,
...acc,
}),
{},
)
}),
})),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPreferences render form with default values 1`] = `
<div
className="makeStyles-root-1 root"
className="root root"
>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Toggle buttons visibility
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6"
className="group group2Columns"
>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -32,7 +32,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -48,7 +48,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -64,7 +64,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -82,18 +82,18 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Toggle blocks visibility
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6"
className="group group2Columns"
>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -109,7 +109,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -125,7 +125,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -141,7 +141,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -157,7 +157,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -175,18 +175,18 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Toggle expanded JSON blocks in METADATA section
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6"
className="group group2Columns"
>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -202,7 +202,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -220,18 +220,18 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Toggle galleries visibility
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6"
className="group group2Columns"
>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -247,7 +247,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -263,7 +263,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -279,7 +279,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -297,18 +297,18 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Toggle navigation items
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6 makeStyles-group3Columns-7"
className="group group2Columns group3Columns"
>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -324,7 +324,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -340,7 +340,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</label>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -358,15 +358,15 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
List of buckets allowed to be as source for packages
</h6>
<div
className="makeStyles-group-5 makeStyles-group2Columns-6"
className="group group2Columns"
>
<div
id="autocomplete"
Expand All @@ -376,7 +376,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
]
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4 MuiFormControl-fullWidth"
className="MuiFormControl-root field pristine MuiFormControl-fullWidth"
>
<label
className="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-marginDense"
Expand All @@ -394,21 +394,21 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<h6
className="MuiTypography-root makeStyles-groupTitle-8 MuiTypography-h6"
className="MuiTypography-root groupTitle MuiTypography-h6"
>
Configure the packages list appearance
</h6>
<div
className="makeStyles-group-5"
className="group"
>
<div
className="makeStyles-root-11 makeStyles-field-3 makeStyles-pristine-4"
className="root field pristine"
>
<div
className="makeStyles-root-12"
className="root"
>
<div
id="text-field"
Expand Down Expand Up @@ -440,7 +440,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-root-12"
className="root"
>
<div
id="text-field"
Expand Down Expand Up @@ -473,7 +473,7 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="MuiFormControl-root makeStyles-field-3 makeStyles-pristine-4"
className="MuiFormControl-root field pristine"
>
<label
className="MuiFormControlLabel-root"
Expand All @@ -491,10 +491,10 @@ exports[`components/FileEditor/QuiltConfigEditor/BucketPreferences/BucketPrefere
</div>
</div>
<div
className="makeStyles-groupWrapper-9"
className="groupWrapper"
>
<div
className="makeStyles-group-5"
className="group"
>
<div
id="text-field"
Expand Down

0 comments on commit d2226a0

Please sign in to comment.