From 65b60f2bb7bafa97c36f3a84c67f36037af43b82 Mon Sep 17 00:00:00 2001 From: faumaray Date: Wed, 28 Oct 2026 10:18:15 +0300 Subject: [PATCH] voelin-gpui: a test for the deafen mark of the voice page A person whose sound is off has the headphone mark in the corner of their avatar, and a talker's bars win over the marks, as in the Slint page. Co-Authored-By: Claude Sonnet 5.5 --- crates/voelin-gpui/src/view/voice_tests.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/voelin-gpui/src/view/voice_tests.rs b/crates/voelin-gpui/src/view/voice_tests.rs index 0f354da..5de8e3b 100644 --- a/crates/voelin-gpui/src/view/voice_tests.rs +++ b/crates/voelin-gpui/src/view/voice_tests.rs @@ -660,3 +660,26 @@ fn a_person_without_a_unique_id_has_the_controls_off(cx: &mut TestAppContext) { click(cx, "member-mute"); assert!(shell.app.read_with(cx, |app, _| app.take_sent()).is_empty(), "nothing is sent"); } + +/// A person whose sound is off, who does not hear, has the headphone mark in +/// the corner of their avatar, and a talker's bars win over both marks, as in +/// the Slint page. +#[gpui::test] +fn a_person_whose_sound_is_off_has_the_deafen_mark(cx: &mut TestAppContext) { + let (shell, cx) = on_the_voice_page(cx, Switches::default()); + assert!(at(cx, "voice-off-2").is_none(), "Lumen hears"); + shell + .events + .send(sample_presence!(p => p.clients.get_mut(&2).unwrap().output_muted = true)) + .unwrap(); + frame(cx); + assert!(at(cx, "voice-off-2").is_some(), "Lumen's sound is off: the mark"); + assert!(people(&shell, cx).iter().any(|m| m.id == 2 && m.sound_off)); + // Kairo talks and is muted too: the bars, not the mark. + shell + .events + .send(sample_presence!(p => p.clients.get_mut(&3).unwrap().input_muted = true)) + .unwrap(); + frame(cx); + assert!(at(cx, "voice-speaking-3").is_some() && at(cx, "voice-off-3").is_none()); +}