You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Getting the State on a Container Node with nested state containing an array, or object returns an array or object of VirtualNodes, rather than the formatted object. Rather, it should return an array of the primitive values only, not VirutalNodes
To Reproduce
Steps to reproduce the behavior:
Create A ConstructorNode, and Initialize the State with an Array Populated with Values
CombineNodes with the ConstructorNode
Called Get State on the SiloNode returned by combineNodes
Notice that the array is returned as a set of virtual nodes rather than an array of values
Expected behavior
If I initialize state with an array, [1, 2] the array returned when calling get state should consist of [1, 2] rather than the current returned value of [VirtualNode {val: 1 ...}, VirtualNode {val: 2 ...}]. This should be true of all values in VirtualNodes that are not ContainerNodes.
Test Snippet
test('State Is Correctly Initialized',()=>{letrootNode=newconstructorNode('Root');rootNode.initializeState({testString: 'Testing',testNum: 123,testArr: ['1','2','3'],testObject: {key1: '1',key2: '2',key3: '3'}});letgeneratedTree=combineNodes(rootNode);expect(generatedTree.Root.getState().testString.val).toBe('Testing');expect(generatedTree.Root.getState().testNum.val).toBe(123);console.warn('State Is Correctly Initialized: Removed Due to Bug #56 - https://github.com/radonjs/Radon/issues/56');//Removed Due to Bug #56 - https://github.com/radonjs/Radon/issues/56//expect(generatedTree.Root.getState().testArr).toEqual(['1', '2', '3']);//expect(generatedTree.Root.getState().testObject).toEqual({key1: '1', key2: '2', key3: '3'});});
The text was updated successfully, but these errors were encountered:
G0ldenSp00n-zz
changed the title
Getting State of Nodes with Nested Arrays Don't Return Formatted Array
Getting State of Nodes with Nested Collections Don't Return Formatted Array
Oct 14, 2018
Describe the bug
Getting the State on a Container Node with nested state containing an array, or object returns an array or object of VirtualNodes, rather than the formatted object. Rather, it should return an array of the primitive values only, not VirutalNodes
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If I initialize state with an array,
[1, 2]
the array returned when calling get state should consist of[1, 2]
rather than the current returned value of[VirtualNode {val: 1 ...}, VirtualNode {val: 2 ...}]
. This should be true of all values in VirtualNodes that are not ContainerNodes.Test Snippet
The text was updated successfully, but these errors were encountered: