fix(anatomy): R5.4 review drawings bounded per annotation, report tables summed, docs counts
This commit is contained in:
1 parent
29eb499539
commit
411e1058c0
9 files changed
+271
-36
No files matched your search
@@ -511,9 +511,38 @@ fn review_drawings_past_their_bound_are_refused_before_rendering() {
|
||||
}
|
||||
let error = render_draft_artifacts(&draft, &result.anomalies).unwrap_err();
|
||||
assert!(
|
||||
error
|
||||
.to_string()
|
||||
.contains("bytes of review drawings, past the"),
|
||||
error.to_string().contains("past the 67108864 bound"),
|
||||
"{error}"
|
||||
);
|
||||
}
|
||||
|
||||
/// An unnamed trigger writes the opened view's names in its markup: many of them opening a
|
||||
/// long-named view are refused before rendering too (security gate R5.4 round 10: a 485 KB
|
||||
/// changeset wrote a 131 MB drawing). The equine draft stays far below the bound.
|
||||
#[test]
|
||||
fn unnamed_triggers_repeating_a_long_view_name_are_refused_before_rendering() {
|
||||
use faunosteo_core::curation::draft::pipeline::{
|
||||
MAX_REVIEW_DRAWINGS_BYTES, review_drawings_bytes,
|
||||
};
|
||||
let (result, mut draft) = equine();
|
||||
let equine = review_drawings_bytes(&draft).unwrap();
|
||||
println!("equine review drawings projected at {equine} bytes");
|
||||
assert!(equine * 4 < MAX_REVIEW_DRAWINGS_BYTES, "{equine}");
|
||||
draft.document["views"][1]["name"]["fr"] = Value::from("t".repeat(32_768));
|
||||
let annotations = draft.document["annotations"].as_array_mut().unwrap();
|
||||
let trigger = annotations
|
||||
.iter()
|
||||
.find(|a| a["kind"] == "detail_trigger")
|
||||
.unwrap()
|
||||
.clone();
|
||||
for index in 0..1_000 {
|
||||
let mut copy = trigger.clone();
|
||||
copy["id"] = Value::from(format!("trigger-{index}"));
|
||||
annotations.push(copy);
|
||||
}
|
||||
let error = render_draft_artifacts(&draft, &result.anomalies).unwrap_err();
|
||||
assert!(
|
||||
error.to_string().contains("past the 67108864 bound"),
|
||||
"{error}"
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user