Files
lucide/packages/lucide-vue-next/tests/lucide-vue-next.spec.js
Eric Fennis 81b85839eb Add vue 3 package (#293)
* 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>
2021-05-20 21:24:54 +02:00

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')
});
});