mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 07:37:42 +01:00
* Lucide svelte (#1) * Update peerDependencies to support Svelte 5 * Bump svelte version * Bump @testing-library/svelte version * Remove alias in vitest.config.ts that causes tests to fail due to deprecated svelte/internal API * Convert to svelte 5 syntax * Bump vite & @sveltejs/vite-plugin-svelte version * Fix error during render when children prop is missing & fix components being mounted on the server during tests * Update test snapshots to reflect the differences in the html generated by svelte 5 * Convert class attribute to new array syntax with built-in clsx * Convert export template to svelte 5 syntax * Move svelte 5 to separate directory * Update snapshots * Update docs * fix(icon): change variable declaration from let to const in Icon.svelte * Lucide svelte (#1) (#2727) * Update peerDependencies to support Svelte 5 * Bump svelte version * Bump @testing-library/svelte version * Remove alias in vitest.config.ts that causes tests to fail due to deprecated svelte/internal API * Convert to svelte 5 syntax * Bump vite & @sveltejs/vite-plugin-svelte version * Fix error during render when children prop is missing & fix components being mounted on the server during tests * Update test snapshots to reflect the differences in the html generated by svelte 5 * Convert class attribute to new array syntax with built-in clsx * Convert export template to svelte 5 syntax * Revert changes in lucide-svelte library * Update package lock * Update test files * Formatting * Update clean command * Fix build * Update packages * update deps * Fix export script * Format code * Revert version number change in package json * Update workflows --------- Co-authored-by: Aurélien Richard <56389380+aurelienrichard@users.noreply.github.com>
34 lines
818 B
TypeScript
34 lines
818 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { render } from '@testing-library/svelte';
|
|
import { Icon } from '../src/lucide-svelte';
|
|
|
|
import { airVent } from './testIconNodes';
|
|
|
|
describe('Using Icon Component', () => {
|
|
it('should render icon based on a iconNode', async () => {
|
|
const { container } = render(Icon, {
|
|
props: {
|
|
iconNode: airVent,
|
|
size: 48,
|
|
color: 'red',
|
|
absoluteStrokeWidth: true,
|
|
},
|
|
});
|
|
|
|
expect(container.firstChild).toBeDefined();
|
|
});
|
|
|
|
it('should render icon and match snapshot', async () => {
|
|
const { container } = render(Icon, {
|
|
props: {
|
|
iconNode: airVent,
|
|
size: 48,
|
|
color: 'red',
|
|
absoluteStrokeWidth: true,
|
|
},
|
|
});
|
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
|
});
|
|
});
|