/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/TableBody/TableBody.test.js
44 строки
1 KB
Zeeshan Tamboli
[test] Remove `componentsProp` from `describeConformance` tests (#48142)
30 мар 2026, 10:17
Не верифицирован
30 мар 2026, 10:17
f6db10a
Код
Авторство
О чём код?
import { expect } from 'chai'; import { createRenderer, screen } from '@mui/internal-test-utils'; import TableBody, { tableBodyClasses as classes } from '@mui/material/TableBody'; import describeConformance from '../../test/describeConformance'; describe('<TableBody />', () => { const { render } = createRenderer(); function renderInTable(node) { return render(<table>{node}</table>); } describeConformance(<TableBody />, () => ({ classes, inheritComponent: 'tbody', render: (node) => { const { container, ...other } = render(<table>{node}</table>); return { container: container.firstChild, ...other }; }, muiName: 'MuiTableBody', testVariantProps: { variant: 'foo' }, refInstanceof: window.HTMLTableSectionElement, // can't test with custom `component` with `renderInTable` testComponentPropWith: 'tbody', })); it('should render children', () => { const children = <tr data-testid="test" />; renderInTable(<TableBody>{children}</TableBody>); screen.getByTestId('test'); }); describe('prop: component', () => { it('can render a different component', () => { const { container } = render(<TableBody component="div" />); expect(container.firstChild).to.have.property('nodeName', 'DIV'); }); it('sets role="rowgroup"', () => { const { container } = render(<TableBody component="div" />); expect(container.firstChild).to.have.attribute('role', 'rowgroup'); }); }); });