@@ -5,6 +5,15 @@ import {deepFreeze, isDeepFrozen} from '../deepFreeze'
5
5
6
6
describe ( 'ReplicationBuilder' , ( ) => {
7
7
8
+ it ( 'should clone a property and execute function on the clone ' , function ( ) {
9
+ let rootState = new ClassorientedTeststate ( ) ;
10
+ let someNewValue = 'someNewValue' ;
11
+ let manipulatedRoot = ReplicationBuilder . forObject ( rootState ) . replaceProperty ( 'subTypeA' ) . andDo ( ( clonedSubTypeA ) => {
12
+ clonedSubTypeA . setSubTypeAAttribute ( someNewValue )
13
+ } ) . build ( ) ;
14
+ expect ( manipulatedRoot . subTypeA . subTypeAAttribute ) . to . equal ( someNewValue ) ;
15
+ } ) ;
16
+
8
17
it ( 'Inputstate must not be modified, output must be modified' , ( ) => {
9
18
let rootState = new ClassorientedTeststate ( ) ;
10
19
let manipulatedRoot = ReplicationBuilder . forObject ( rootState ) . getProperty ( 'subTypeA' ) . getProperty ( 'subTypeB' ) . replaceProperty ( 'subTypeBAttribute' ) . with ( 'Test' ) . build ( ) ;
@@ -76,7 +85,7 @@ describe('ReplicationBuilder', () => {
76
85
} ) ;
77
86
78
87
it ( 'test performance of frozen big array' , ( ) => {
79
- let objectCount = 5000 ;
88
+ let objectCount = 5000 ;
80
89
let rootState = new ObjectArray ( objectCount ) ;
81
90
deepFreeze ( rootState ) ;
82
91
@@ -93,7 +102,7 @@ describe('ReplicationBuilder', () => {
93
102
} ) ;
94
103
95
104
it ( 'test performance of not frozen big array' , ( ) => {
96
- let objectCount = 5000 ;
105
+ let objectCount = 5000 ;
97
106
let rootState = new ObjectArray ( objectCount ) ;
98
107
99
108
let repeatCount = 1 ;
0 commit comments