mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 11:57:43 +01:00
* init vue next package * Refactor naming * adjust readme * add typescript support * Fix es module build * Bump alpha version * Fix size property not working * Fix issue with default attributes in this PR * small fixes * Update README.md * Fix peer dep * Add return * update release workflow Co-authored-by: AdamSGit <adamelio@protonmail.com>
45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
import { mount } from '@vue/test-utils'
|
|
import { Smile } from '../src/icons'
|
|
|
|
describe('Using lucide icon components', () => {
|
|
it('should render an component', () => {
|
|
const wrapper = mount(Smile)
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
it('should adjust the size, stroke color and stroke width', () => {
|
|
const wrapper = mount(Smile, {
|
|
propsData: {
|
|
size: 48,
|
|
stroke: 'red',
|
|
strokeWidth: 4
|
|
}
|
|
})
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
|
|
it('should add a class to the element', () => {
|
|
const wrapper = mount(Smile, {
|
|
attrs: {
|
|
class: "lucide-icon my-icon"
|
|
}
|
|
})
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
expect(String(wrapper.classes())).toBe(String(['lucide-icon', 'my-icon']))
|
|
});
|
|
|
|
it('should add a style attribute to the element', () => {
|
|
const wrapper = mount(Smile, {
|
|
attrs: {
|
|
style: 'position: absolute',
|
|
}
|
|
})
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
expect(wrapper.attributes('style')).toContain('position: absolute')
|
|
});
|
|
});
|