Files
Homarr/src/components/AppAvatar.test.tsx

17 lines
609 B
TypeScript
Raw Normal View History

2023-03-17 23:05:30 +01:00
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();
});
});