Files
lucide/packages/lucide-solid/tests/context.spec.tsx

38 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-06-18 20:21:58 +02:00
import { render } from "@solidjs/testing-library";
import { describe, expect, it } from "vitest";
import { House, LucideProvider } from "../src/lucide-solid";
describe('Using LucideProvider', () => {
it('should render the icon with LucideProvider', () => {
const { container } = render(() => (
<LucideProvider
size={48}
color="red"
>
<House/>
</LucideProvider>
));
expect(container.firstChild).toMatchSnapshot();
});
it('should render the icon with LucideProvider and custom strokeWidth', () => {
const { container } = render(() => (
<LucideProvider
size={48}
color="red"
strokeWidth={4}
>
<House/>
</LucideProvider>
));
const IconComponent = container.firstElementChild;
expect(IconComponent).toHaveAttribute('width', '48');
expect(IconComponent).toHaveAttribute('height', '48');
expect(IconComponent).toHaveAttribute('stroke', 'red');
expect(IconComponent).toHaveAttribute('stroke-width', '4');
});
})