use crate::config::AgentConfig;
#[test]
fn dm_defaults_to_showing_group_follows_global() {
let cfg = AgentConfig {
redact_sensitive_data: true,
redact_dm: None,
redact_group: None,
..Default::default()
};
assert!(!cfg.redact_for(true));
assert!(cfg.redact_for(false));
}
#[test]
fn group_follows_global_flag_both_ways() {
let off = AgentConfig {
redact_sensitive_data: false,
redact_group: None,
..Default::default()
};
assert!(!off.redact_for(false), "group follows global off");
let on = AgentConfig {
redact_sensitive_data: true,
redact_group: None,
..Default::default()
};
assert!(on.redact_for(false), "group follows global on");
}
#[test]
fn explicit_scope_overrides_win() {
let cfg = AgentConfig {
redact_sensitive_data: true,
redact_dm: Some(true),
redact_group: Some(false),
..Default::default()
};
assert!(cfg.redact_for(true), "dm override on wins over the default");
assert!(
!cfg.redact_for(false),
"group override off wins over the global flag"
);
}