#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_greet_command() {
        let result = greet("World");
        assert_eq!(result, "Hello, World! You've been greeted from Rust!");
    }

    #[test]
    fn test_app_state_default() {
        let state = AppState::default();
        assert!(!state.app_version.is_empty());
        assert_eq!(state.is_dev_mode, cfg!(debug_assertions));
    }

    #[test]
    fn test_window_state_serialization() {
        let state = WindowState {
            width: 1280.0,
            height: 800.0,
            x: 100,
            y: 100,
            is_maximized: false,
        };

        let serialized = serde_json::to_string(&state).unwrap();
        let deserialized: WindowState = serde_json::from_str(&serialized).unwrap();

        assert_eq!(state.width, deserialized.width);
        assert_eq!(state.height, deserialized.height);
        assert_eq!(state.x, deserialized.x);
        assert_eq!(state.y, deserialized.y);
        assert_eq!(state.is_maximized, deserialized.is_maximized);
    }

    #[test]
    fn test_update_info_serialization() {
        let update_info = UpdateInfo {
            current_version: "0.1.0".to_string(),
            latest_version: "0.2.0".to_string(),
            release_notes: "Bug fixes".to_string(),
            download_url: "https://example.com/update".to_string(),
            is_update_available: true,
        };

        let serialized = serde_json::to_string(&update_info).unwrap();
        assert!(serialized.contains("0.2.0"));
        assert!(serialized.contains("Bug fixes"));
    }
}
