Skip to content

Commit 6564b5d

Browse files
committed
use variable for test
1 parent e8e2c5e commit 6564b5d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

web_src/js/svg.test.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ test('svgParseOuterInner', () => {
1818
test('SvgIcon', () => {
1919
const root = document.createElement('div');
2020
createApp({render: () => h(SvgIcon, {name: 'octicon-link', size: 24, class: 'base', className: 'extra'})}).mount(root);
21-
expect(root.firstChild.nodeName).toEqual('svg');
22-
expect(root.firstChild.getAttribute('width')).toEqual('24');
23-
expect(root.firstChild.getAttribute('height')).toEqual('24');
24-
expect(root.firstChild.classList.contains('octicon-link')).toBeTruthy();
25-
expect(root.firstChild.classList.contains('base')).toBeTruthy();
26-
expect(root.firstChild.classList.contains('extra')).toBeTruthy();
21+
const node = root.firstChild;
22+
expect(node.nodeName).toEqual('svg');
23+
expect(node.getAttribute('width')).toEqual('24');
24+
expect(node.getAttribute('height')).toEqual('24');
25+
expect(node.classList.contains('octicon-link')).toBeTruthy();
26+
expect(node.classList.contains('base')).toBeTruthy();
27+
expect(node.classList.contains('extra')).toBeTruthy();
2728
});

0 commit comments

Comments
 (0)