mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-16 23:57:43 +01:00
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();
|
||
|
|
});
|
||
|
|
});
|