Skip to content

Commit e608893

Browse files
committed
fix: Icon unit test
1 parent 0e4ce11 commit e608893

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

test/unit/specs/Icon.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe('Icon.vue', () => {
88
beforeEach(() => {
99
cmp = shallow(Icon, {
1010
propsData: {
11+
title: 'test text',
1112
name: 'type'
1213
}
1314
})
@@ -17,6 +18,10 @@ describe('Icon.vue', () => {
1718
expect(cmp.vm.name).toEqual('type')
1819
})
1920

21+
it('equals title to `test text`', () => {
22+
expect(cmp.vm.title).toEqual('test text')
23+
})
24+
2025
it('should render correct contents', () => {
2126
const renderer = createRenderer()
2227
renderer.renderToString(cmp.vm, (err, str) => {

test/unit/specs/__snapshots__/Icon.spec.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Icon.vue should render correct contents 1`] = `
4-
<i class="icon svg-icon">
4+
<i title="test text" class="icon svg-icon">
55
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-type">
66
<polyline points="4 7 4 4 20 4 20 7"></polyline>
77
<line x1="9" y1="20" x2="15" y2="20"></line>

0 commit comments

Comments
 (0)