fix: Rationalize custom icons to avoid duplication (#1639)

This commit is contained in:
Dermot Duffy
2024-10-13 16:24:51 -07:00
committed by GitHub
parent 0ec9afbad2
commit 7895de96d2
29 changed files with 573 additions and 272 deletions
@@ -1,6 +1,5 @@
import { handleActionConfig } from '@dermotduffy/custom-card-helpers';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { FRIGATE_ICON_SVG_PATH } from '../../src/camera-manager/frigate/icon';
import { MenuController } from '../../src/components-lib/menu-controller';
import { MenuConfig, menuConfigSchema } from '../../src/config/types';
import { StateParameters } from '../../src/types';
@@ -395,26 +394,6 @@ describe('MenuController', () => {
});
});
describe('should get svg path', () => {
it('frigate icon', () => {
const controller = new MenuController(createLitElement());
const button = {
type: 'custom:frigate-card-menu-icon' as const,
icon: 'frigate',
};
expect(controller.getSVGPath(button)).toEqual(FRIGATE_ICON_SVG_PATH);
});
it('non-frigate icon', () => {
const controller = new MenuController(createLitElement());
const button = {
type: 'custom:frigate-card-menu-icon' as const,
icon: 'mdi:cow',
};
expect(controller.getSVGPath(button)).toBeFalsy();
});
});
describe('should handle actions', () => {
it('should bail without config', () => {
const controller = new MenuController(createLitElement());