From dc5d27cded3fd14820aef5b049acc949c45fa8d8 Mon Sep 17 00:00:00 2001 From: Lucas Batista Vargas Date: Wed, 25 Nov 2026 12:35:25 -0300 Subject: [PATCH] Default apps: restore test for xdg-mime word types and exclusion of plain text (#7317) (#7541) --- apps/wordcraft/src/default_apps.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/wordcraft/src/default_apps.rs b/apps/wordcraft/src/default_apps.rs index ae0955fcee..2519f86256 100644 --- a/apps/wordcraft/src/default_apps.rs +++ b/apps/wordcraft/src/default_apps.rs @@ -54,6 +54,23 @@ pub fn identity() -> AppIdentity { mod tests { use super::*; + /// Every type the button claims is included in identity, and plain text/Markdown are never claimed. + #[test] + fn xdg_mime_sets_every_word_type_in_one_call() { + let id = identity(); + assert_eq!(id.desktop_id, "ai.storyteller.wordcraft.desktop"); + assert_eq!(id.registered_name, "WordCraft"); + for t in [ + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/msword", + "application/rtf", + "application/vnd.oasis.opendocument.text", + ] { + assert!(id.mime_types.iter().any(|a| a == t), "{t}"); + } + assert!(!id.mime_types.iter().any(|a| a == "text/plain" || a == "text/markdown"), "plain text and Markdown are never claimed"); + } + /// Every type the button claims is one the desktop entry declares, or desktops ignore it. #[test] fn the_desktop_entry_declares_every_claimed_type() {