Skip to content

Commit

Permalink
chore(decorator-mui): update test snapshots again
Browse files Browse the repository at this point in the history
Use hard-coded dates when testing date fields. CSS classes updated again
though. Not sure why exactly.
  • Loading branch information
soup-in-boots committed May 2, 2024
1 parent 362264c commit 840f2ea
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ exports[`Material UI with no model renders empty root date consistently 1`] = `
inputmode="text"
placeholder="MM/DD/YYYY"
type="text"
value="04/28/2024"
value="01/01/2020"
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
>
<button
aria-label="Choose date, selected date is Apr 28, 2024"
aria-label="Choose date, selected date is Jan 1, 2020"
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-edgeEnd MuiIconButton-sizeMedium css-1yq5fb3-MuiButtonBase-root-MuiIconButton-root"
tabindex="0"
type="button"
Expand Down
6 changes: 3 additions & 3 deletions packages/decorator-mui/src/__tests__/mui.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Material UI', function () {
['root string', { type: 'string' }],
['root number', { type: 'number' }],
['root integer', { type: 'integer' }],
['root date', { type: 'string', format: 'date' }],
['root date', { type: 'string', format: 'date' }, '2020-01-01'],
// ['root date-time', { type: 'string', format: 'date-time' }],
['root enumeration', { type: 'string', enum: ['a', 'b', 'c'] }],
[
Expand Down Expand Up @@ -60,9 +60,9 @@ describe('Material UI', function () {
const form = ['*'];
const decorator = mui;

for (let [name, schema] of tests) {
for (let [name, schema, maybeModel] of tests) {
test(`renders empty ${name} consistently`, function () {
const model = util.defaultForSchema(schema);
const model = maybeModel ?? util.defaultForSchema(schema);
const { container } = render(
<ThemeProvider theme={theme}>
<LocalizationProvider dateAdapter={AdapterMoment}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ exports[`renders with description and no title 1`] = `
</li>
</ul>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-p4v2qm"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1mfchec-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1uj6erk-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -74,7 +74,7 @@ exports[`renders with description and no title 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-mbccmm"
class="MuiBox-root css-mj0ya4"
form="[object Object]"
>
<div
Expand Down Expand Up @@ -131,11 +131,11 @@ exports[`renders with form options layout horizontal 1`] = `
</li>
</ul>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-1c8t2r7"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-tzftsp-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-16nkhj0-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -169,7 +169,7 @@ exports[`renders with form options layout horizontal 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-169sr6u"
class="MuiBox-root css-1tqg69w"
form="[object Object]"
>
<div
Expand Down Expand Up @@ -226,11 +226,11 @@ exports[`renders with form options layout vertical 1`] = `
</li>
</ul>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-p4v2qm"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1mfchec-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1uj6erk-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -264,7 +264,7 @@ exports[`renders with form options layout vertical 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-mbccmm"
class="MuiBox-root css-mj0ya4"
form="[object Object]"
>
<div
Expand All @@ -287,11 +287,11 @@ exports[`renders with no title or description 1`] = `
form="[object Object]"
>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-p4v2qm"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1mfchec-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1uj6erk-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -325,7 +325,7 @@ exports[`renders with no title or description 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-mbccmm"
class="MuiBox-root css-mj0ya4"
form="[object Object]"
>
<div
Expand Down Expand Up @@ -382,11 +382,11 @@ exports[`renders with title and description 1`] = `
</li>
</ul>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-p4v2qm"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1mfchec-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1uj6erk-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -420,7 +420,7 @@ exports[`renders with title and description 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-mbccmm"
class="MuiBox-root css-mj0ya4"
form="[object Object]"
>
<div
Expand Down Expand Up @@ -472,11 +472,11 @@ exports[`renders with title and no description 1`] = `
</li>
</ul>
<div
class="MuiBox-root css-190bvqr"
class="MuiBox-root css-p4v2qm"
tabs="1"
>
<div
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1mfchec-MuiPaper-root"
class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation0 css-1uj6erk-MuiPaper-root"
form="[object Object]"
>
<ul
Expand Down Expand Up @@ -510,7 +510,7 @@ exports[`renders with title and no description 1`] = `
</ul>
</div>
<div
class="MuiBox-root css-mbccmm"
class="MuiBox-root css-mj0ya4"
form="[object Object]"
>
<div
Expand Down

0 comments on commit 840f2ea

Please sign in to comment.