mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-23 18:59:29 +01:00
10
package.json
10
package.json
@@ -18,7 +18,15 @@
|
|||||||
"**/react-dom",
|
"**/react-dom",
|
||||||
"**/react-dom/**",
|
"**/react-dom/**",
|
||||||
"**/react-test-renderer",
|
"**/react-test-renderer",
|
||||||
"**/react-test-renderer/**"
|
"**/react-test-renderer/**",
|
||||||
|
"**/vue",
|
||||||
|
"**/vue/**",
|
||||||
|
"**/vue-template-compiler",
|
||||||
|
"**/vue-template-compiler/**",
|
||||||
|
"**/vue-template-es2015-compiler",
|
||||||
|
"**/vue-template-es2015-compiler/**",
|
||||||
|
"**/@testing-library/vue",
|
||||||
|
"**/@testing-library/vue/**"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^16.5.1",
|
"react": "^16.5.1",
|
||||||
|
"react-dom": "^16.5.1",
|
||||||
"react-native": "^0.69.0",
|
"react-native": "^0.69.0",
|
||||||
"react-native-svg": "^12.0.0"
|
"react-native-svg": "^12.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
66
packages/lucide-react-native/tests/__mocks__/react-native-svg.js
vendored
Normal file
66
packages/lucide-react-native/tests/__mocks__/react-native-svg.js
vendored
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
// @flow
|
||||||
|
|
||||||
|
// https://github.com/FormidableLabs/react-native-svg-mock
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
const createComponent = function(name) {
|
||||||
|
const component = (props) => {
|
||||||
|
return React.createElement(name, props, props.children);
|
||||||
|
}
|
||||||
|
|
||||||
|
component.displayName = name;
|
||||||
|
|
||||||
|
return component
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mock all react-native-svg exports
|
||||||
|
// from https://github.com/magicismight/react-native-svg/blob/master/index.js
|
||||||
|
const Svg = createComponent('svg');
|
||||||
|
const Circle = createComponent('circle');
|
||||||
|
const Ellipse = createComponent('ellipse');
|
||||||
|
const G = createComponent('g');
|
||||||
|
const Text = createComponent('text');
|
||||||
|
const TextPath = createComponent('textPath');
|
||||||
|
const TSpan = createComponent('tSpan');
|
||||||
|
const Path = createComponent('path');
|
||||||
|
const Polygon = createComponent('polygon');
|
||||||
|
const Polyline = createComponent('polyline');
|
||||||
|
const Line = createComponent('line');
|
||||||
|
const Rect = createComponent('rect');
|
||||||
|
const Use = createComponent('use');
|
||||||
|
const Image = createComponent('image');
|
||||||
|
const Symbol = createComponent('symbol');
|
||||||
|
const Defs = createComponent('defs');
|
||||||
|
const LinearGradient = createComponent('linearGradient');
|
||||||
|
const RadialGradient = createComponent('radialGradient');
|
||||||
|
const Stop = createComponent('stop');
|
||||||
|
const ClipPath = createComponent('clipPath');
|
||||||
|
const Pattern = createComponent('pattern');
|
||||||
|
const Mask = createComponent('mask');
|
||||||
|
|
||||||
|
export {
|
||||||
|
Svg,
|
||||||
|
Circle,
|
||||||
|
Ellipse,
|
||||||
|
G,
|
||||||
|
Text,
|
||||||
|
TextPath,
|
||||||
|
TSpan,
|
||||||
|
Path,
|
||||||
|
Polygon,
|
||||||
|
Polyline,
|
||||||
|
Line,
|
||||||
|
Rect,
|
||||||
|
Use,
|
||||||
|
Image,
|
||||||
|
Symbol,
|
||||||
|
Defs,
|
||||||
|
LinearGradient,
|
||||||
|
RadialGradient,
|
||||||
|
Stop,
|
||||||
|
ClipPath,
|
||||||
|
Pattern,
|
||||||
|
Mask,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Svg;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`Using lucide icon components should adjust the size, stroke color and stroke width 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"4\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid\\" data-testid=\\"grid-icon\\"><rect x=\\"3\\" y=\\"3\\" width=\\"18\\" height=\\"18\\" rx=\\"2\\" ry=\\"2\\"></rect><line x1=\\"3\\" y1=\\"9\\" x2=\\"21\\" y2=\\"9\\"></line><line x1=\\"3\\" y1=\\"15\\" x2=\\"21\\" y2=\\"15\\"></line><line x1=\\"9\\" y1=\\"3\\" x2=\\"9\\" y2=\\"21\\"></line><line x1=\\"15\\" y1=\\"3\\" x2=\\"15\\" y2=\\"21\\"></line></svg>"`;
|
exports[`Using lucide icon components should adjust the size, stroke color and stroke width 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"48\\" height=\\"48\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"red\\" stroke-width=\\"4\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" data-testid=\\"grid-icon\\"><rect x=\\"3\\" y=\\"3\\" width=\\"18\\" height=\\"18\\" rx=\\"2\\" ry=\\"2\\"></rect><line x1=\\"3\\" y1=\\"9\\" x2=\\"21\\" y2=\\"9\\"></line><line x1=\\"3\\" y1=\\"15\\" x2=\\"21\\" y2=\\"15\\"></line><line x1=\\"9\\" y1=\\"3\\" x2=\\"9\\" y2=\\"21\\"></line><line x1=\\"15\\" y1=\\"3\\" x2=\\"15\\" y2=\\"21\\"></line></svg>"`;
|
||||||
|
|
||||||
exports[`Using lucide icon components should render an component 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\" class=\\"lucide lucide-grid\\"><rect x=\\"3\\" y=\\"3\\" width=\\"18\\" height=\\"18\\" rx=\\"2\\" ry=\\"2\\"></rect><line x1=\\"3\\" y1=\\"9\\" x2=\\"21\\" y2=\\"9\\"></line><line x1=\\"3\\" y1=\\"15\\" x2=\\"21\\" y2=\\"15\\"></line><line x1=\\"9\\" y1=\\"3\\" x2=\\"9\\" y2=\\"21\\"></line><line x1=\\"15\\" y1=\\"3\\" x2=\\"15\\" y2=\\"21\\"></line></svg>"`;
|
exports[`Using lucide icon components should render an component 1`] = `"<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" stroke=\\"currentColor\\" stroke-width=\\"2\\" stroke-linecap=\\"round\\" stroke-linejoin=\\"round\\"><rect x=\\"3\\" y=\\"3\\" width=\\"18\\" height=\\"18\\" rx=\\"2\\" ry=\\"2\\"></rect><line x1=\\"3\\" y1=\\"9\\" x2=\\"21\\" y2=\\"9\\"></line><line x1=\\"3\\" y1=\\"15\\" x2=\\"21\\" y2=\\"15\\"></line><line x1=\\"9\\" y1=\\"3\\" x2=\\"9\\" y2=\\"21\\"></line><line x1=\\"15\\" y1=\\"3\\" x2=\\"15\\" y2=\\"21\\"></line></svg>"`;
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ describe('Using lucide icon components', () => {
|
|||||||
|
|
||||||
const [icon] = document.getElementsByClassName('my-icon');
|
const [icon] = document.getElementsByClassName('my-icon');
|
||||||
|
|
||||||
console.log(icon);
|
|
||||||
|
|
||||||
expect(icon).toHaveClass('my-icon')
|
expect(icon).toHaveClass('my-icon')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,11 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^5.16.2",
|
"@testing-library/jest-dom": "^5.16.2",
|
||||||
"@testing-library/vue": "^5.8.2",
|
"@testing-library/vue": "^5.8.2",
|
||||||
"@vue/test-utils": "^1.1.2",
|
"@vue/test-utils": "1.3.0",
|
||||||
"jest-serializer-vue": "^2.0.2",
|
"jest-serializer-vue": "^2.0.2",
|
||||||
"vue": "^2.6.12",
|
"vue": "2.6.14",
|
||||||
"vue-jest": "^3.0.7",
|
"vue-jest": "^3.0.7",
|
||||||
"vue-template-compiler": "^2.6.12"
|
"vue-template-compiler": "2.6.14"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vue": "^2.6.12"
|
"vue": "^2.6.12"
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
|
||||||
import {render, fireEvent} from '@testing-library/vue'
|
import {render, fireEvent} from '@testing-library/vue'
|
||||||
import { Smile } from '../src/icons'
|
import { Smile } from '../src/icons'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user