diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-26 18:12:59 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-26 18:12:59 -0600 |
| commit | 5eb90dbbd18cf9b22d83fe31303fbb09099088ed (patch) | |
| tree | e064dc5609bb9db75c7b3d7b1a24726321a0fc60 /tests/test-video-audio-recording--get-available-mics.el | |
| parent | ed5e3f61d00a9462801e15179fcceca65315050a (diff) | |
feat(recording): replace icons with text state labels in quick-setup
Replace hard-to-distinguish nerd font icons with clear text labels:
Jabra SPEAK 510 Mono [active - running]
Shure MV7+ Analog Stereo [active - idle]
Ryzen HD Audio Controller [inactive - suspended]
Both mic and sink steps use the same labeling. Devices sorted
running → idle → suspended. Removed mic-active-p and sink-active-p
helpers — state now comes directly from the verbose pactl parsers
via get-available-mics/sinks which return (name description state).
Diffstat (limited to 'tests/test-video-audio-recording--get-available-mics.el')
| -rw-r--r-- | tests/test-video-audio-recording--get-available-mics.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/test-video-audio-recording--get-available-mics.el b/tests/test-video-audio-recording--get-available-mics.el index 2fea0d7a..de9335af 100644 --- a/tests/test-video-audio-recording--get-available-mics.el +++ b/tests/test-video-audio-recording--get-available-mics.el @@ -6,6 +6,7 @@ ;; - Monitor sources are excluded (they capture output, not input) ;; - Muted sources are excluded ;; - Friendly descriptions from PulseAudio are used +;; - PulseAudio state is included ;;; Code: @@ -38,7 +39,7 @@ Each source is (name description mute state)." ("alsa_output.usb-Jabra.monitor" "Monitor of Jabra" "no" "SUSPENDED")))))) (let ((mics (cj/recording--get-available-mics))) (should (= 1 (length mics))) - (should (equal "alsa_input.usb-Jabra.mono" (car (car mics))))))) + (should (equal "alsa_input.usb-Jabra.mono" (nth 0 (car mics))))))) (ert-deftest test-video-audio-recording--get-available-mics-normal-filters-muted () "Test that muted sources are excluded from mic list." @@ -49,16 +50,25 @@ Each source is (name description mute state)." ("muted-mic" "Muted Mic" "yes" "SUSPENDED")))))) (let ((mics (cj/recording--get-available-mics))) (should (= 1 (length mics))) - (should (equal "active-mic" (car (car mics))))))) + (should (equal "active-mic" (nth 0 (car mics))))))) (ert-deftest test-video-audio-recording--get-available-mics-normal-uses-descriptions () - "Test that friendly descriptions are returned as cdr." + "Test that friendly descriptions are returned as second element." (cl-letf (((symbol-function 'shell-command-to-string) (lambda (_cmd) (test-mics--make-pactl-output '(("raw-device-name" "Friendly Device Name" "no" "IDLE")))))) (let ((mics (cj/recording--get-available-mics))) - (should (equal "Friendly Device Name" (cdr (car mics))))))) + (should (equal "Friendly Device Name" (nth 1 (car mics))))))) + +(ert-deftest test-video-audio-recording--get-available-mics-normal-includes-state () + "Test that PulseAudio state is returned as third element." + (cl-letf (((symbol-function 'shell-command-to-string) + (lambda (_cmd) + (test-mics--make-pactl-output + '(("mic-a" "Mic A" "no" "RUNNING")))))) + (let ((mics (cj/recording--get-available-mics))) + (should (equal "RUNNING" (nth 2 (car mics))))))) (ert-deftest test-video-audio-recording--get-available-mics-normal-multiple-mics () "Test that multiple non-muted, non-monitor mics are returned." |
