diff --git a/crates/voelin-ui-vm/src/social/logic.rs b/crates/voelin-ui-vm/src/social/logic.rs index a3745b3..480a543 100644 --- a/crates/voelin-ui-vm/src/social/logic.rs +++ b/crates/voelin-ui-vm/src/social/logic.rs @@ -1552,6 +1552,14 @@ mod tests { assert!(ups[0].refresh.conversations && ups[0].rest.is_none()); } + /// The search lists the settings pages by these titles, which the pages + /// are shown under. + #[test] + fn the_settings_pages_the_search_finds_are_named_as_the_settings_name_them() { + let titles: Vec<&str> = SETTING_PAGES.iter().map(|(title, _, _)| *title).collect(); + assert!(titles.contains(&"Voice & Video"), "{titles:?}"); + } + fn spot(session: i64, channel: &str) -> FriendSpot { FriendSpot { session: session as u64, diff --git a/crates/voelin-ui-vm/src/social/mod.rs b/crates/voelin-ui-vm/src/social/mod.rs index ca10266..a973cf6 100644 --- a/crates/voelin-ui-vm/src/social/mod.rs +++ b/crates/voelin-ui-vm/src/social/mod.rs @@ -441,6 +441,18 @@ mod tests { NaiveDateTime::parse_from_str(text, "%Y-%m-%d %H:%M").unwrap() } + /// The bell's rows carry the kind's name and the Slint side picks the + /// colour and the icon by it (`ui/screens/overlays.slint`; the message is + /// what no other name matches), so a renamed kind must fail here. + #[test] + fn notice_kinds_are_named_as_the_bell_keys_them() { + use NoticeKind::{Event, Friend, Mention, Message, Poke}; + assert_eq!( + [Mention, Poke, Message, Event, Friend].map(NoticeKind::name), + ["mention", "poke", "message", "event", "friend"] + ); + } + #[test] fn times() { let now = 1_800_000_000_000;