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,29 @@
import { afterAll, expect, it, vi } from 'vitest';
import { createCardAPI } from '../../../test-utils';
import { SleepAction } from '../../../../src/card-controller/actions/actions/sleep';
import { sleep } from '../../../../src/utils/basic';
vi.mock('../../../../src/utils/basic');
afterAll(() => {
vi.restoreAllMocks();
});
it('should handle sleep action', async () => {
const api = createCardAPI();
const action = new SleepAction(
{},
{
action: 'fire-dom-event',
frigate_card_action: 'sleep',
duration: {
s: 5,
ms: 200
},
},
);
await action.execute(api);
expect(sleep).toBeCalledWith(5.2);
});