feat: add test for new username_display config options

This commit is contained in:
Youwen Wu 2025-06-16 10:42:50 -07:00
parent 7f752da89d
commit d2b06d16ee
Signed by: youwen
GPG key ID: 865658ED1FE61EC3

View file

@ -1179,6 +1179,13 @@ mod tests {
let res: Tunables =
serde_json::from_str("{\"username_display\": \"displayname\"}").unwrap();
assert_eq!(res.username_display, Some(UserDisplayStyle::DisplayName));
let res: Tunables = serde_json::from_str(
"{\"username_display\": \"regex\",\n\"username_display_regex\": \"foo\"}",
)
.unwrap();
assert_eq!(res.username_display, Some(UserDisplayStyle::Regex));
assert_eq!(res.username_display_regex.unwrap_or("FAILED".into()), "foo".to_string());
}
#[test]