From 7cfbadf1697aeccbdbe748113032f7c36f91a54c Mon Sep 17 00:00:00 2001 From: NeilClack Date: Sat, 8 Aug 2026 00:23:33 -0500 Subject: [PATCH] Enable audio output list even with only one device --- internal/page/AudioDevices_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/page/AudioDevices_test.go b/internal/page/AudioDevices_test.go index 8ec4695..20eee7b 100644 --- a/internal/page/AudioDevices_test.go +++ b/internal/page/AudioDevices_test.go @@ -12,6 +12,10 @@ func TestCurrentDeviceIndex(t *testing.T) { {Name: "Built-in Audio Digital Stereo (HDMI)", Label: "HDMI | Monitor | TV"}, } + singleDevice := []mixer.Device{ + {Name: "Built-in Audio Analog Stereo", Label: "Internal Speakers"}, + } + tests := []struct { name string devices []mixer.Device @@ -24,6 +28,9 @@ func TestCurrentDeviceIndex(t *testing.T) { {"exact first device match", devices, "Built-in Audio Analog Stereo", 1}, {"exact second device match", devices, "Built-in Audio Digital Stereo (HDMI)", 2}, {"no match", devices, "USB Audio", -1}, + {"single device, default", singleDevice, "", 0}, + {"single device, exact match", singleDevice, "Built-in Audio Analog Stereo", 1}, + {"single device, no match", singleDevice, "USB Audio", -1}, } for _, tt := range tests {