church-core/tests/config_functions_test.rs
RTSDA 4d6b23beb3
Some checks are pending
iOS UniFFI Build / build-ios (push) Waiting to run
Initial commit: Church Core Rust library
Add church management API library with cross-platform support for iOS, Android, and WASM.
Features include event management, bulletin handling, contact forms, and authentication.
2025-08-16 19:25:01 -04:00

71 lines
2.7 KiB
Rust

use church_core::uniffi_wrapper::{
get_church_name,
get_contact_phone,
get_contact_email,
get_brand_color,
get_about_text,
get_donation_url,
get_church_address,
get_coordinates,
get_website_url,
get_facebook_url,
get_youtube_url,
get_instagram_url,
get_mission_statement,
};
#[test]
fn test_config_functions_return_fallback_values() {
println!("🔍 Testing church-core config functions...");
// Test that all functions return non-empty strings (fallback values)
let church_name = get_church_name();
assert!(!church_name.is_empty(), "Church name should have fallback");
println!("✅ Church Name: {}", church_name);
let contact_phone = get_contact_phone();
assert!(!contact_phone.is_empty(), "Contact phone should have fallback");
println!("✅ Contact Phone: {}", contact_phone);
let contact_email = get_contact_email();
assert!(!contact_email.is_empty(), "Contact email should have fallback");
println!("✅ Contact Email: {}", contact_email);
let brand_color = get_brand_color();
assert!(!brand_color.is_empty(), "Brand color should have fallback");
assert!(brand_color.starts_with("#"), "Brand color should be hex");
println!("✅ Brand Color: {}", brand_color);
let about_text = get_about_text();
assert!(!about_text.is_empty(), "About text should have fallback");
println!("✅ About Text: {}", about_text);
let donation_url = get_donation_url();
assert!(!donation_url.is_empty(), "Donation URL should have fallback");
assert!(donation_url.starts_with("http"), "Donation URL should be valid");
println!("✅ Donation URL: {}", donation_url);
let church_address = get_church_address();
assert!(!church_address.is_empty(), "Church address should have fallback");
println!("✅ Church Address: {}", church_address);
let coords = get_coordinates();
// Coordinates should be empty when no coordinates are configured
assert_eq!(coords.len(), 0, "Coordinates should be empty when not configured");
println!("✅ Coordinates: {:?} (empty when not configured)", coords);
let website_url = get_website_url();
assert!(!website_url.is_empty(), "Website URL should have fallback");
println!("✅ Website URL: {}", website_url);
let mission_statement = get_mission_statement();
assert!(!mission_statement.is_empty(), "Mission statement should have fallback");
println!("✅ Mission Statement: {}", mission_statement);
// Social media URLs can be empty
let _facebook_url = get_facebook_url();
let _youtube_url = get_youtube_url();
let _instagram_url = get_instagram_url();
println!("🎉 All config functions working properly!");
}