mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-23 00:49:22 +01:00
Lucide Vue Package (#174)
* add configs
* Add vue components
* Add documentation
* add alpha release version
* improve npm ignore files
* add tests
* Make style and class attrs work
* 📦 bump version
* Add Icon suffix for component names
* bump version
* Add icon component example
* remove space
* improvements package.json
* update tests
* update workflow
This commit is contained in:
45
packages/lucide-vue/tests/lucide-vue.spec.js
Normal file
45
packages/lucide-vue/tests/lucide-vue.spec.js
Normal file
@@ -0,0 +1,45 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { Smile } from '..'
|
||||
|
||||
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: "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')
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user