2024-04-26 17:59:04 +02:00
|
|
|
import { describe, it, expect } from 'vitest';
|
|
|
|
|
import { createLucideIcon } from '../src/lucide-react';
|
|
|
|
|
import { airVent } from './testIconNodes';
|
|
|
|
|
import { render } from '@testing-library/react';
|
|
|
|
|
|
|
|
|
|
describe('Using createLucideIcon', () => {
|
|
|
|
|
it('should create a component from an iconNode', () => {
|
|
|
|
|
const AirVent = createLucideIcon('AirVent', airVent);
|
|
|
|
|
|
|
|
|
|
const { container } = render(<AirVent />);
|
|
|
|
|
|
|
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
|
|
|
|
expect(container.firstChild).toBeDefined();
|
|
|
|
|
});
|
2025-03-21 10:35:54 +00:00
|
|
|
|
|
|
|
|
it('should create a component from an iconNode with iconName', () => {
|
|
|
|
|
const AirVent = createLucideIcon('air-vent', airVent);
|
|
|
|
|
|
|
|
|
|
const { container } = render(<AirVent />);
|
|
|
|
|
|
|
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
|
|
|
|
expect(container.firstChild).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should include backwards compatible className', () => {
|
|
|
|
|
const Layout2 = createLucideIcon('layout-2', airVent);
|
|
|
|
|
|
|
|
|
|
const { container } = render(<Layout2 />);
|
|
|
|
|
|
|
|
|
|
expect(container.firstChild).toMatchSnapshot();
|
|
|
|
|
expect(container.firstChild).toBeDefined();
|
|
|
|
|
});
|
2024-04-26 17:59:04 +02:00
|
|
|
});
|