From b68249c47b37b048b9de90aeb21a8acea50579da Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 17:18:13 +0000 Subject: [PATCH] test(lottie): cover archive without animation --- crates/lottie/src/tests.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/lottie/src/tests.rs b/crates/lottie/src/tests.rs index cf8543fdf..19f8a4c32 100644 --- a/crates/lottie/src/tests.rs +++ b/crates/lottie/src/tests.rs @@ -12,7 +12,7 @@ use effectcraft_render::render_frame; use effectcraft_time::{FrameRate, Tick}; use serde_json::{Value as Json, json}; -use crate::{ExportOptions, export_comp, import}; +use crate::{ExportOptions, LottieError, export_comp, import}; fn s(x: f64) -> Tick { Tick::from_seconds_f64(x) @@ -799,6 +799,14 @@ fn dotlottie_archive_roundtrip() { assert_eq!(q.comp(imp.comp).unwrap().layers.len(), 1); } +#[test] +fn dotlottie_archive_without_animation_is_rejected() { + let zip = craft_lottie::zip::try_store(&[("manifest.json".into(), b"{}".to_vec())]).unwrap(); + let mut project = Project::default(); + let err = import(&mut project, &zip, "empty archive", "", &mut |_| None).unwrap_err(); + assert!(matches!(err, LottieError::Parse(message) if message.contains("without a JSON animation"))); +} + #[test] fn deflated_dotlottie_archive_imports() { let (mut p, cid) = setup();