Skip to content

Commit

Permalink
Adjust lucide-static tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Nov 20, 2023
1 parent bcee3fd commit b26e0ff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/lucide-react/tests/lucide-react.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Using lucide icon components', () => {
expect( container.innerHTML ).toMatchSnapshot();
});

it('should merge default classNames with the provided classNames', () => {
it('should apply all classNames to the element', () => {
const testClass = 'my-class';
const { container } = render(
<Club className={testClass} />,
Expand Down
2 changes: 1 addition & 1 deletion packages/lucide-solid/tests/lucide-solid.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Using lucide icon components', () => {
cleanup()
});

it('should merge default classes with the provided classes', () => {
it('should add all classes to the element', () => {
const testClass = 'my-class';
const { container } = render(() =>
<Droplet class={testClass} />,
Expand Down
5 changes: 4 additions & 1 deletion packages/lucide-static/scripts/buildLib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ svgs.forEach(({ name, contents }) => {
const importString = `module.exports.${componentName} = require('./icons/${name}');\n`;
appendFile(importString, `index.js`, LIB_DIR);

const exportString = `${jsLicense}module.exports = \`${contents}\`;\n`;
const svgContent = contents.replace('<svg', `<svg
class="lucide lucide-${name}"`);

const exportString = `${jsLicense}module.exports = \`${svgContent}\`;\n`;
appendFile(exportString, `${name}.js`, ICON_MODULE_DIR);
});

Expand Down
3 changes: 2 additions & 1 deletion packages/lucide-static/scripts/copyIcons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default async function copyIcons(parsedSvgs, packageDir, license) {
}
// eslint-disable-next-line arrow-body-style
const writeIconPromises = parsedSvgs.map(({ name, contents }) => {
const content = `<!-- ${license} -->\n${contents}`;
let content = `<!-- ${license} -->\n${contents}`;
content = content.replace('<svg', `<svg\n class="lucide lucide-${name}"`);

return writeFile(`${iconsDirectory}/${name}.svg`, content);
});
Expand Down

0 comments on commit b26e0ff

Please sign in to comment.