fix(anatomy): V1-2.2 owner arbitrations on SVG references and bytes
Refuse local references to ids a drawing does not define, scope canvas ids per view, upload every drawing in one stored form checked by the verdict and the preview, keep strict numeric rgb() colours, and commit real Inkscape 1.4.3 exports with their generator.
This commit is contained in:
1 parent
17d919971e
commit
e823655f09
31 files changed
+1362
-110
No files matched your search
@@ -4,7 +4,9 @@
|
||||
|
||||
mod common;
|
||||
|
||||
use common::svg_tree::{tree_value, view_names, with_trigger_names_per_language};
|
||||
use common::svg_tree::{
|
||||
tree_value, view_names, with_ids_scoped_per_view, with_trigger_names_per_language,
|
||||
};
|
||||
use faunosteo_core::anatomy::svg::tree::parse_svg;
|
||||
use faunosteo_core::domain::js::parse_json;
|
||||
use faunosteo_core::domain::sheet::{BundledSheetData, LoadedSheet};
|
||||
@@ -33,11 +35,15 @@ fn call(sheet: &LoadedSheet, input: Value) -> Value {
|
||||
serde_json::from_str(&call_with_sheet(sheet, "view.canvas", &input.to_string())).unwrap()
|
||||
}
|
||||
|
||||
/// A frozen canvas golden with the declared trigger-name change applied.
|
||||
fn golden(name: &str, sheet: &LoadedSheet) -> Value {
|
||||
let text = common::repo_file(&format!("apps/app/tests/fixtures/goldens/r3/{name}"));
|
||||
/// A frozen canvas golden with the declared changes applied: trigger names, ids scoped per
|
||||
/// view.
|
||||
fn golden(view: &str, sheet: &LoadedSheet) -> Value {
|
||||
let text = common::repo_file(&format!(
|
||||
"apps/app/tests/fixtures/goldens/r3/canvas.{view}.json"
|
||||
));
|
||||
let mut frozen: Value = serde_json::from_str(&text).unwrap();
|
||||
with_trigger_names_per_language(&mut frozen, &view_names(&sheet.document));
|
||||
with_ids_scoped_per_view(&mut frozen, view);
|
||||
frozen
|
||||
}
|
||||
|
||||
@@ -50,7 +56,7 @@ fn each_view_answers_the_frozen_canvas() {
|
||||
let svg = out["value"]["svg"].as_str().unwrap();
|
||||
assert_eq!(
|
||||
tree_value(&parse_svg(svg).unwrap()),
|
||||
golden(&format!("canvas.{view}.json"), &sheet),
|
||||
golden(view, &sheet),
|
||||
"{view}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user