mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 06:05:24 +00:00
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 {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
source: src/snapshot/tests/apply.rs
|
||||
expression: applied_patch_value
|
||||
---
|
||||
removed: []
|
||||
added: []
|
||||
updated:
|
||||
- id: id-1
|
||||
changed_name: "Hello, world!"
|
||||
changed_class_name: Folder
|
||||
changed_properties: {}
|
||||
changed_metadata: ~
|
||||
Reference in New Issue
Block a user