Files
element-call/src/lotus/lotusAudioOutput.test.ts
T
Lotus CIandClaude Opus 5.5 34d541b707
CI / Build embedded bundle (pull_request) Successful in 3m28s
CI / Publish to Gitea npm registry (pull_request) Skipped
feat(lotus): report the frame's audio outputs to the host (cinny #310)
Browsers hash deviceIds per frame/origin, so ids from the host's own
enumerateDevices() are unknown in here and select() fell back to the
default. io.lotus.audio_output_state now also carries
available: [{id,label}] (frame-valid ids), so the host's call-bar menu
can offer real choices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
2026-10-17 19:48:33 -04:00

25 lines
770 B
TypeScript

/*
Copyright 2026 Lotus Guild
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { expect, test } from "vitest";
import { audioOutputList } from "./lotusAudioOutput";
import { type AudioOutputDeviceLabel } from "../state/MediaDevices";
test("audioOutputList labels every kind of output (cinny #310)", () => {
const m = new Map<string, AudioOutputDeviceLabel>([
["", { type: "default", name: "Speakers" }],
["a1", { type: "name", name: "Headset" }],
["a2", { type: "number", number: 3 }],
]);
expect(audioOutputList(m)).toEqual([
{ id: "", label: "Default (Speakers)" },
{ id: "a1", label: "Headset" },
{ id: "a2", label: "Output 3" },
]);
});