mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Test for AppliedPatchSet result
This commit is contained in:
parent
5f5bfadf2b
commit
0a1fa9588f
3 changed files with 26 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue