@@ -3,29 +3,37 @@ import { networkInterfaces } from 'os';
33
44describe ( 'Tree unit test' , ( ) => {
55 describe ( 'Constructor' , ( ) => {
6- let newTree = new Tree ( { } ) ;
6+ const newTree = new Tree ( { } ) ;
77
88 it ( 'should be able to create a newTree' , ( ) => {
99 expect ( newTree . state ) . toEqual ( { } ) ;
10- } )
10+ } ) ;
1111
12- it ( 'should have 5 properties' , ( ) => {
12+ it ( 'should have 8 properties' , ( ) => {
1313 expect ( newTree ) . toHaveProperty ( 'state' ) ;
1414 expect ( newTree ) . toHaveProperty ( 'name' ) ;
1515 expect ( newTree ) . toHaveProperty ( 'componentData' ) ;
1616 expect ( newTree ) . toHaveProperty ( 'children' ) ;
1717 expect ( newTree ) . toHaveProperty ( 'parent' ) ;
18- } )
18+ expect ( newTree ) . toHaveProperty ( 'isExpanded' ) ;
19+ expect ( newTree ) . toHaveProperty ( 'rtid' ) ;
20+ expect ( newTree ) . toHaveProperty ( 'route' ) ;
21+ } ) ;
1922
2023 it ( 'has name default value as stateless' , ( ) => {
2124 expect ( newTree . name ) . toBe ( 'nameless' ) ;
22- } )
25+ } ) ;
2326
2427 it ( 'has children as an empty array' , ( ) => {
2528 expect ( newTree . children ) . toEqual ( [ ] ) ;
26- } )
27- } )
28-
29+ } ) ;
30+ } ) ;
31+
32+ /**
33+ *
34+ * the tree should have initial values of state, name, etc to be default as per newly created tree
35+ *
36+ */
2937
3038 describe ( 'Adding children' , ( ) => {
3139 let newTree = new Tree ( { } ) ;
0 commit comments