feat: Add microphone_disconnect action (#1536)

This commit is contained in:
Felipe Santos
2024-09-15 15:44:40 -07:00
committed by GitHub
parent b251911fbc
commit e13e53b430
7 changed files with 74 additions and 25 deletions
@@ -0,0 +1,18 @@
import { expect, it } from 'vitest';
import { MicrophoneDisconnectAction } from '../../../../src/card-controller/actions/actions/microphone-disconnect';
import { createCardAPI } from '../../../test-utils';
it('should handle microphone_disconnect action', async () => {
const api = createCardAPI();
const action = new MicrophoneDisconnectAction(
{},
{
action: 'fire-dom-event',
frigate_card_action: 'microphone_disconnect',
},
);
await action.execute(api);
expect(api.getMicrophoneManager().disconnect).toBeCalled();
});