test: recover server host message regression

- Restore the existing HostMessage fixture scenario and pre-integration evidence without changing capacity or quota coverage.
- Leave the private fixture and its configuration outside the commit.
This commit is contained in:
omar committed 2026-11-28 07:56:22 +03:00
1 parent ce440ae0da
commit e95778946f
3 files changed
+47 -3

No files matched your search

+42 -2
View File
@@ -1165,7 +1165,7 @@ fn participant_context_menu_projects_muted_beta14_capabilities() {
#[cfg(target_os = "windows")]
#[derive(Clone, Copy, PartialEq)]
enum ParticipantFixture { Info, Statistics, Poke, Context, Volume, Commander, Move, ServerInfo, ServerText, WelcomeOnly, ServerCapacity, ServerQuota, ServerLog, VirtualLog, ServerPermissions, GroupLifecycle(teamspeach_core::admin::extra::GroupKind), ChannelSubscriptions, VoiceToolbar }
enum ParticipantFixture { Info, Statistics, Poke, Context, Volume, Commander, Move, ServerInfo, ServerText, WelcomeOnly, HostMessage, ServerCapacity, ServerQuota, ServerLog, VirtualLog, ServerPermissions, GroupLifecycle(teamspeach_core::admin::extra::GroupKind), ChannelSubscriptions, VoiceToolbar }
#[cfg(target_os="windows")]
#[test]
@@ -1231,6 +1231,14 @@ fn server_editor_allows_welcome_without_rename_permission() {
run_muted_beta14_participant_fixture(ParticipantFixture::WelcomeOnly);
}
#[cfg(target_os="windows")]
#[test]
#[ignore="requires exclusive private beta14 with HostMessageQA"]
fn host_message_and_mode_roundtrip_without_changing_welcome() {
if !headless::install_for_test(){return;}
run_muted_beta14_participant_fixture(ParticipantFixture::HostMessage);
}
#[cfg(target_os = "windows")]
#[path = "server_capacity.rs"]
mod server_capacity;
@@ -1312,7 +1320,7 @@ fn run_muted_beta14_participant_fixture(scenario: ParticipantFixture) {
let uids = await_muted_beta14_roster(runtime, &tabs, clients).await?;
match scenario {
ParticipantFixture::VoiceToolbar => return exercise_voice_toolbar(runtime,ui,&owner,&tabs,clients,&uids).await,
ParticipantFixture::ServerInfo | ParticipantFixture::ServerText | ParticipantFixture::WelcomeOnly => return exercise_server_info(runtime,ui,&owner,&tabs,scenario).await,
ParticipantFixture::ServerInfo | ParticipantFixture::ServerText | ParticipantFixture::WelcomeOnly | ParticipantFixture::HostMessage => return exercise_server_info(runtime,ui,&owner,&tabs,scenario).await,
ParticipantFixture::ServerCapacity | ParticipantFixture::ServerQuota => return exercise_server_info(runtime,ui,&owner,&tabs,scenario).await,
ParticipantFixture::ServerLog => return server_log::exercise(runtime, ui, &owner, &tabs).await,
ParticipantFixture::VirtualLog => return server_log::permitted(runtime, ui, &owner, &tabs[0]).await,
@@ -1469,6 +1477,38 @@ async fn exercise_server_info(runtime:&AppRuntime,ui:&AppWindow,owner:&crate::ap
if scenario == ParticipantFixture::ServerQuota && view == 0 {
server_capacity::exercise_quotas(runtime, ui, owner, tabs, uid, row).await?;
}
if scenario==ParticipantFixture::HostMessage && view==0 {
const MESSAGE:&str="virtualserver_hostmessage";
const MODE:&str="virtualserver_hostmessage_mode";
const TEXT:&str="Fixture host notice\nSecond line";
let dialog=ui.global::<crate::DialogBridge>();
let old=row[MESSAGE].as_str().unwrap_or_default();let old_mode=row[MODE].as_str().unwrap_or("0");
let mode=if old_mode=="1" {"2"} else {"1"};
let field=|id:&str,v:&str|dialog.get_fields().iter().any(|f|f.id==id && f.value==v);
for (start,start_mode,text,setting,save) in [(old,old_mode,TEXT,mode,false),(old,old_mode,TEXT,mode,true),(TEXT,mode,old,old_mode,true)] {
let label=catalog.text(crate::ui::shell::forms::label_key(Operation::ServerEdit));
let edit=shell.get_detail_actions().iter().find(|a|a.enabled && a.label==label).ok_or("missing server editor")?;
pace_beta14().await?;shell.invoke_invoke(edit.id);
until("current host message in editor",||dialog.get_visible() && field(MESSAGE,start) && field(MODE,start_mode)).await?;
if !save {
dialog.invoke_edit(MESSAGE.into(),"x".repeat(8193).into());
for invalid in ["-1","4"] {
dialog.invoke_edit(MODE.into(),invalid.into());dialog.invoke_confirm(name.into());dialog.invoke_submit();
assert!(dialog.get_fields().iter().any(|f|f.id==MESSAGE && !f.error.is_empty()));
assert!(dialog.get_fields().iter().any(|f|f.id==MODE && f.value==invalid && !f.error.is_empty()));
}
}
dialog.invoke_edit(MESSAGE.into(),text.into());dialog.invoke_edit(MODE.into(),setting.into());
if save {dialog.invoke_confirm(name.into());pace_beta14().await?;dialog.invoke_submit();}else{dialog.invoke_cancel();}
until("host message editor closed",||!dialog.get_visible() && runtime.snapshot().dialog.is_none()).await.map_err(|e|format!("{e}: {} {}",dialog.get_error(),runtime.snapshot().error))?;
pace_beta14().await?;
let observed=owner.request(&tabs[1],Command::Admin(teamspeach_core::admin::AdminCommand::ServerInfo)).await.map_err(|e|e.message)?;
let [r]=observed["rows"].as_array().ok_or("missing observer properties")?.as_slice() else{return Err("unexpected observer row count".into())};
let (expected,expected_mode)=if save{(text,setting)}else{(start,start_mode)};
assert_eq!(r[MESSAGE].as_str().unwrap_or_default(),expected);assert_eq!(r[MODE].as_str().unwrap_or("0"),expected_mode);
assert_eq!(r["virtualserver_name"],name);assert_eq!(r["virtualserver_welcomemessage"].as_str().unwrap_or_default(),welcome);
}
}
if scenario==ParticipantFixture::WelcomeOnly && view==0 {
let dialog=ui.global::<crate::DialogBridge>();
let label=catalog.text(crate::ui::shell::forms::label_key(Operation::ServerEdit));