/
githubmirror
/
ionic-framework
Обзор
Документация
Войти
/
githubmirror
/
ionic-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
core/setupJest.js
23 строки
793 B
Brandy Smith
feat(range): add classes and expose parts to allow individual styling of dual knobs (#30941)
04 мар 2026, 18:36
Не верифицирован
04 мар 2026, 18:36
5bcf921
Код
Авторство
О чём код?
expect.extend({ toHaveShadowPart(received, part) { if (typeof part !== 'string') { throw new Error('expected toHaveShadowPart to be called with a string of the CSS shadow part name'); } if (received.shadowRoot === null) { throw new Error('expected toHaveShadowPart to be called on an element with a shadow root'); } // Use attribute selector with ~= to match space-separated part values // e.g., [part~="knob"] matches elements with part="knob" or part="knob knob-a" const shadowPart = received.shadowRoot.querySelector(`[part~="${part}"]`); const pass = shadowPart !== null; const message = `expected ${received.tagName.toLowerCase()} to have shadow part "${part}"`; return { pass, message: () => message, }; }, });