mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
✅ Add test for AppAvatar
This commit is contained in:
16
src/components/AppAvatar.test.tsx
Normal file
16
src/components/AppAvatar.test.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { AppAvatar } from './AppAvatar';
|
||||
|
||||
describe(AppAvatar.name, () => {
|
||||
it.concurrent('display placeholder when no url', () => {
|
||||
const { container } = render(<AppAvatar iconUrl="" color="blue" />);
|
||||
|
||||
expect(container.firstElementChild).not.toBeNull();
|
||||
expect(container.firstElementChild!.className).contain('mantine-Avatar-root');
|
||||
|
||||
const svgElement = container.querySelector('svg');
|
||||
expect(svgElement).not.toBeNull();
|
||||
expect(svgElement?.getAttribute('fill')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user