/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/utils/isMuiElement.test.js
30 строк
958 B
Brijesh Bittu
[code-infra] Remove React import requirement for jsx (#47146)
29 окт 2025, 20:55
Не верифицирован
29 окт 2025, 20:55
6c9e82f
Код
Авторство
О чём код?
import { expect } from 'chai'; import { isMuiElement } from '.'; import { Input, ListItemSecondaryAction, SvgIcon } from '..'; describe('utils/index.js', () => { describe('isMuiElement', () => { it('should match static muiName property', () => { function Component() { return null; } Component.muiName = 'Component'; expect(isMuiElement(<Component />, ['Component'])).to.equal(true); expect(isMuiElement(<div />, ['Input'])).to.equal(false); expect(isMuiElement(null, ['SvgIcon'])).to.equal(false); expect(isMuiElement('TextNode', ['SvgIcon'])).to.equal(false); }); it('should be truthy for matching components', () => { [ [Input, 'Input'], [ListItemSecondaryAction, 'ListItemSecondaryAction'], [SvgIcon, 'SvgIcon'], ].forEach(([Component, muiName]) => { expect(isMuiElement(<Component />, [muiName])).to.equal(true); }); }); }); });