Remove "class-name" from svg icon (#33540)

Only use "class" attribute

(cherry picked from commit 06088ec672a053b11a20ca6dd21588380d67f396)
This commit is contained in:
wxiaoguang 2025-02-10 04:39:54 +08:00 committed by Gusted
parent d81baf21e9
commit 0ff2c11432
No known key found for this signature in database
GPG key ID: FD821B732837125F
5 changed files with 20 additions and 30 deletions

View file

@ -16,12 +16,11 @@ test('svgParseOuterInner', () => {
test('SvgIcon', () => {
const root = document.createElement('div');
createApp({render: () => h(SvgIcon, {name: 'octicon-link', size: 24, class: 'base', className: 'extra'})}).mount(root);
createApp({render: () => h(SvgIcon, {name: 'octicon-link', size: 24, class: 'base'})}).mount(root);
const node = root.firstChild;
expect(node.nodeName).toEqual('svg');
expect(node.getAttribute('width')).toEqual('24');
expect(node.getAttribute('height')).toEqual('24');
expect(node.classList.contains('octicon-link')).toBeTruthy();
expect(node.classList.contains('base')).toBeTruthy();
expect(node.classList.contains('extra')).toBeTruthy();
});