Merge branch 'master' of github.com:ericfennis/lucide

This commit is contained in:
Eric Fennis
2021-09-22 08:46:59 +02:00
3 changed files with 15 additions and 1 deletions
+2 -1
View File
@@ -3,5 +3,6 @@
"id": "939567362549682242",
"api": "1.0.0",
"ui": "build/ui.html",
"main": "build/main.js"
"main": "build/main.js",
"editorType": ["figma"]
}
@@ -52,6 +52,7 @@ export default (iconName, iconNode) => ({
'stroke-width': strokeWidth,
...data.attrs,
},
on: data?.on || {}
},
iconNode.map(([tag, attrs]) => createElement(tag, { attrs })),
);
@@ -41,4 +41,16 @@ describe('Using lucide icon components', () => {
expect(wrapper).toMatchSnapshot();
expect(wrapper.attributes('style')).toContain('position: absolute')
});
it('should call the onClick event', () => {
const onClick = jest.fn()
const wrapper = mount(Smile, {
listeners: {
click: onClick
}
})
wrapper.trigger('click')
expect(onClick).toHaveBeenCalled()
});
});