#[cfg(feature = "web-sys")]
use wasm_bindgen_test::*;
#[cfg(feature = "web-sys")]
wasm_bindgen_test_configure!(run_in_browser);
#[cfg_attr(feature = "web-sys", wasm_bindgen_test)]
#[cfg_attr(not(feature = "web-sys"), test)]
fn test_wasm_environment_basic() {
let handle = crate::AnimationHandle(123);
assert_eq!(handle.0, 123);
let value = crate::AnimationValue::Number(42.0);
match value {
crate::AnimationValue::Number(n) => assert_eq!(n, 42.0),
_ => panic!("Expected Number variant"),
}
}
#[cfg_attr(feature = "web-sys", wasm_bindgen_test)]
#[cfg_attr(not(feature = "web-sys"), test)]
fn test_minimal_engine_creation() {
let engine = crate::MinimalEngine::new();
assert_eq!(engine.active_count(), 0);
}
#[cfg_attr(feature = "web-sys", wasm_bindgen_test)]
#[cfg_attr(not(feature = "web-sys"), test)]
fn test_animation_target_creation() {
use std::collections::HashMap;
let mut target = HashMap::new();
target.insert("opacity".to_string(), crate::AnimationValue::Number(1.0));
target.insert("scale".to_string(), crate::AnimationValue::Number(1.2));
assert_eq!(target.len(), 2);
assert!(target.contains_key("opacity"));
assert!(target.contains_key("scale"));
}
#[cfg_attr(feature = "web-sys", wasm_bindgen_test)]
#[cfg_attr(not(feature = "web-sys"), test)]
fn test_transition_creation() {
let transition = crate::Transition {
duration: Some(1.0),
ease: crate::Easing::Linear,
delay: Some(0.1),
..Default::default()
};
assert_eq!(transition.duration, Some(1.0));
assert_eq!(transition.delay, Some(0.1));
}