/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/TableRow/TableRow.test.js
51 строка
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 TableRow, { tableRowClasses as classes } from '@mui/material/TableRow'; import describeConformance from '../../test/describeConformance'; describe('<TableRow />', () => { const { render } = createRenderer(); function renderInTable(node) { return render( <table> <tbody>{node}</tbody> </table>, ); } describeConformance(<TableRow />, () => ({ classes, inheritComponent: 'tr', render: (node) => { const { container, ...other } = render( <table> <tbody>{node}</tbody> </table>, ); return { container: container.firstChild.firstChild, ...other }; }, muiName: 'MuiTableRow', testVariantProps: { variant: 'foo' }, refInstanceof: window.HTMLTableRowElement, testComponentPropWith: 'tr', })); it('should render children', () => { const children = <td data-testid="test" />; renderInTable(<TableRow>{children}</TableRow>); screen.getByTestId('test'); }); describe('prop: component', () => { it('can render a different component', () => { const { container } = render(<TableRow component="div" />); expect(container.firstChild).to.have.property('nodeName', 'DIV'); }); it('sets role="rowgroup"', () => { const { container } = render(<TableRow component="div" />); expect(container.firstChild).to.have.attribute('role', 'row'); }); }); });