diff --git a/src/bookmarks.rs b/src/bookmarks.rs index 4c449faf..bf81335a 100644 --- a/src/bookmarks.rs +++ b/src/bookmarks.rs @@ -88,4 +88,19 @@ mod tests { let elem2 = Element::from(Storage::new()); assert!(elem1.compare_to(&elem2)); } + + #[test] + fn complete() { + let elem: Element = "Coucousecret".parse().unwrap(); + let storage = Storage::try_from(elem).unwrap(); + assert_eq!(storage.urls.len(), 1); + assert_eq!(storage.urls[0].name, "Example"); + assert_eq!(storage.urls[0].url, "https://example.org/"); + assert_eq!(storage.conferences.len(), 1); + assert_eq!(storage.conferences[0].autojoin, Autojoin::True); + assert_eq!(storage.conferences[0].jid, Jid::bare("test-muc", "muc.localhost")); + assert_eq!(storage.conferences[0].name, "Test MUC"); + assert_eq!(storage.conferences[0].clone().nick.unwrap(), "Coucou"); + assert_eq!(storage.conferences[0].clone().password.unwrap(), "secret"); + } }