/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/DialogActions/DialogActions.test.js
40 строк
1 KB
Zeeshan Tamboli
[test] Remove `componentsProp` from `describeConformance` tests (#48142)
30 мар 2026, 10:17
Не верифицирован
30 мар 2026, 10:17
f6db10a
Код
Авторство
О чём код?
import { createRenderer, isJsdom } from '@mui/internal-test-utils'; import DialogActions, { dialogActionsClasses as classes } from '@mui/material/DialogActions'; import Button from '@mui/material/Button'; import { expect } from 'chai'; import describeConformance from '../../test/describeConformance'; describe('<DialogActions />', () => { const { render } = createRenderer(); describeConformance(<DialogActions />, () => ({ classes, inheritComponent: 'div', render, refInstanceof: window.HTMLDivElement, muiName: 'MuiDialogActions', testVariantProps: { disableSpacing: true }, skip: ['componentProp'], })); it.skipIf(isJsdom())('should apply margin to all children but the first one', function test() { const { container } = render( <DialogActions> <Button data-testid="child-1">Agree</Button> <Button data-testid="child-2" href="#"> Agree </Button> <Button data-testid="child-3" component="span"> Agree </Button> <div data-testid="child-4" /> </DialogActions>, ); const children = container.querySelectorAll('[data-testid^="child-"]'); expect(children[0]).toHaveComputedStyle({ marginLeft: '0px' }); expect(children[1]).toHaveComputedStyle({ marginLeft: '8px' }); expect(children[2]).toHaveComputedStyle({ marginLeft: '8px' }); expect(children[3]).toHaveComputedStyle({ marginLeft: '8px' }); }); });