forked from rojo-rbx/rojo
Test for AppliedPatchSet result
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
use insta::assert_yaml_snapshot;
|
||||
use rbx_dom_weak::RbxInstanceProperties;
|
||||
|
||||
use rojo_insta_ext::RedactionMap;
|
||||
|
||||
use crate::snapshot::{
|
||||
apply_patch_set, InstancePropertiesWithMeta, PatchSet, PatchUpdate, RojoTree,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn reify_folder() {
|
||||
fn set_name_and_class_name() {
|
||||
let mut redactions = RedactionMap::new();
|
||||
|
||||
let mut tree = empty_tree();
|
||||
redactions.intern(tree.get_root_id());
|
||||
|
||||
let patch_set = PatchSet {
|
||||
updated_instances: vec![PatchUpdate {
|
||||
@@ -19,10 +25,12 @@ fn reify_folder() {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let _applied_patch_set = apply_patch_set(&mut tree, patch_set);
|
||||
let applied_patch_set = apply_patch_set(&mut tree, patch_set);
|
||||
|
||||
// TODO: Make assertions about tree using snapshots
|
||||
// TODO: make assertions about applied patch set using snapshots
|
||||
// TODO: Snapshot tree, requires RojoTree: Serialize (but not Deserialize!)
|
||||
|
||||
let applied_patch_value = redactions.redacted_yaml(applied_patch_set);
|
||||
assert_yaml_snapshot!(applied_patch_value);
|
||||
}
|
||||
|
||||
fn empty_tree() -> RojoTree {
|
||||
|
||||
Reference in New Issue
Block a user