-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: writes test for icon component
- Loading branch information
1 parent
269a8f2
commit f4175ff
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`Icon > renders properly 1`] = ` | ||
<svg | ||
aria-hidden="true" | ||
fill="currentColor" | ||
style="color: rgb(255, 255, 255);" | ||
viewBox="0 0 20 20" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M5 4a1 1 0 00-2 0v7.268a2 2 0 000 3.464V16a1 1 0 102 0v-1.268a2 2 0 000-3.464V4zM11 4a1 1 0 10-2 0v1.268a2 2 0 000 3.464V16a1 1 0 102 0V8.732a2 2 0 000-3.464V4zM16 3a1 1 0 011 1v7.268a2 2 0 010 3.464V16a1 1 0 11-2 0v-1.268a2 2 0 010-3.464V4a1 1 0 011-1z" | ||
/> | ||
</svg> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
|
||
import { mount } from '@vue/test-utils'; | ||
import Icon from './Icon.vue'; | ||
|
||
describe('Icon', () => { | ||
it('renders properly', () => { | ||
const wrapper = mount(Icon, { | ||
props: { | ||
name: 'AdjustmentsIcon', | ||
size: '24', | ||
color: 'rgb(255, 255, 255)', | ||
kind: 'solid', | ||
}, | ||
}); | ||
expect(wrapper.exists()).toBe(true); | ||
expect(wrapper.find('svg').exists()).toBe(true); | ||
expect(wrapper.find('svg').element.getAttribute('aria-hidden')).toBe( | ||
'true' | ||
); | ||
expect(wrapper.find('svg').element.getAttribute('style')).toBe( | ||
'color: rgb(255, 255, 255);' | ||
); | ||
expect(wrapper.find('svg').element.getAttribute('fill')).toBe( | ||
'currentColor' | ||
); | ||
}); | ||
}); |