test(lottie): cover archive without animation

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 17:18:13 +00:00
1 parent 9c94c11856
commit b68249c47b
1 file changed
+9 -1
+9 -1
View File
@@ -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();