Files
TREK/client/src/components/Admin/addons/PhotoProviderIcons.test.tsx
T
Maurice e0fd2c296b refactor(admin): draw the photo provider marks from one icons file
The desktop and the phone addon manager each carried their own copy of the Immich and Synology SVGs. Both now import them from components/Admin/addons/PhotoProviderIcons, which has its own test. The rendered marks are unchanged.
2026-10-09 16:29:40 +02:00

30 lines
1.1 KiB
TypeScript

// FE-ADMIN-PHOTOICONS-001 to FE-ADMIN-PHOTOICONS-002
import { describe, expect, it } from 'vitest';
import { render } from '../../../../tests/helpers/render';
import { ImmichIcon, SynologyIcon } from './PhotoProviderIcons';
const marks = [
['ImmichIcon', ImmichIcon],
['SynologyIcon', SynologyIcon],
] as const;
describe('PhotoProviderIcons', () => {
it.each(marks)('FE-ADMIN-PHOTOICONS-001: %s draws a 14px currentColor glyph by default', (_name, Icon) => {
const { container } = render(<Icon />);
const svg = container.querySelector('svg');
expect(svg).toHaveAttribute('viewBox', '0 0 24 24');
expect(svg).toHaveAttribute('width', '14');
expect(svg).toHaveAttribute('height', '14');
expect(svg).toHaveStyle({ flexShrink: '0' });
expect(container.querySelector('path')).toHaveAttribute('fill', 'currentColor');
});
it.each(marks)('FE-ADMIN-PHOTOICONS-002: %s takes its size from the caller', (_name, Icon) => {
const { container } = render(<Icon size={22} />);
const svg = container.querySelector('svg');
expect(svg).toHaveAttribute('width', '22');
expect(svg).toHaveAttribute('height', '22');
});
});