material-ui 最新版本5.10.7导致快照中出现重复类

holgip5t  于 2022-10-29  发布在  其他
关注(0)|答案(6)|浏览(140)

重复

  • 我已经搜索了存在的问题

最新版本

  • 我已经测试了最新版本

重现步骤🕹

操作步骤:
1.从5.10.6升级到5.10.7

当前行为😯

>
              Sprite Icons
            </h2>
            <label
    -         class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-shrink MuiFormLabel-colorPrimary emotion-120"
    +         class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-shrink MuiFormLabel-colorPrimary MuiInputLabel-root MuiInputLabel-shrink emotion-120"
              data-shrink="true"
              id="demo-simple-select-label"
            >

### Expected behavior 🤔

Take a look, the classes like MuiInputLabel-root are getting doubled up.

### Context 🔦

Jest snapshots should match without duplicate classes.

### Your environment 🌎

<details>
  <summary><code>npx @mui/envinfo</code></summary>
jest
</details>
cbwuti44

cbwuti441#

@httpete您可以共享在沙箱测试中呈现的组件吗?

ykejflvf

ykejflvf2#

这是一个Mui/输入标签

ia2d9nvy

ia2d9nvy3#

在此沙箱中看不到它的副本-https://codesandbox.io/s/inspiring-rumple-gt7jxf?file=/src/App.tsx请共享生成此输出的代码。

ux6nzvsh

ux6nzvsh4#

我觉得那个沙盒用的是@mui/material的5.0.0,如果我选5.10.7,我就可以重现了:
https://codesandbox.io/s/serene-mendel-iy02fz的最大值

htzpubme

htzpubme6#

我只想强调一下,它在5.10.6中运行良好。

相关问题