Add initial keyboard shortcut support.

This commit is contained in:
Dermot Duffy
2024-06-05 21:44:17 -07:00
parent 904f6d8142
commit 7ab545738d
186 changed files with 9564 additions and 3658 deletions
@@ -0,0 +1,26 @@
import { expect, it, vi } from 'vitest';
import { mock } from 'vitest-mock-extended';
import { UnmuteAction } from '../../../../src/card-controller/actions/actions/unmute';
import { FrigateCardMediaPlayer } from '../../../../src/types';
import { createCardAPI, createMediaLoadedInfo } from '../../../test-utils';
it('should handle unmute action', async () => {
const api = createCardAPI();
const player = mock<FrigateCardMediaPlayer>();
vi.mocked(api.getMediaLoadedInfoManager().get).mockReturnValue(
createMediaLoadedInfo({
player: player,
}),
);
const action = new UnmuteAction(
{},
{
action: 'fire-dom-event',
frigate_card_action: 'unmute',
},
);
await action.execute(api);
expect(player.unmute).toBeCalled();
});