mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 06:56:35 +00:00
e0fd2c296b
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.
30 lines
1.1 KiB
TypeScript
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');
|
|
});
|
|
});
|