Files
gods-eye-view/src/testSupport/voiceUi.mjs
T
Sameh Khamis 1de4f635ca feat(voice): render the voice control from a presenter
createVoiceControl now returns a presenter instead of building the
control with innerHTML: the session, cost, input, card and panel owners
write its state by part and listen for interactions, and VoiceControl.vue
renders it in the command dock, between the location bar and the visual
presets as before. Focus moves wait for the render; the waveform's bars
publish apart from the control and only when they change; the minutes
field keeps a draft until its owner writes it. Owner tests use a real
presenter on their own store, and view tests render the control.
2026-10-31 19:22:03 -07:00

17 lines
575 B
JavaScript

import { createPinia } from 'pinia';
import { useVoiceStore } from '../ui/stores/voice.js';
import { createVoiceControl } from '../voice/control.js';
/**
* A real voice control presenter on its own store, for owner tests that run
* without a page. Read what it shows from `ui.state`; report interactions
* with `ui.emit(name, ...args)`.
* @param {{panel?: boolean, pinia?: import('pinia').Pinia}} [options]
*/
export function createTestVoiceUi({
panel = false,
pinia = createPinia(),
} = {}) {
return createVoiceControl({ panel, store: useVoiceStore(pinia) });
}