@@ -3,29 +3,37 @@ import { networkInterfaces } from 'os';
3
3
4
4
describe ( 'Tree unit test' , ( ) => {
5
5
describe ( 'Constructor' , ( ) => {
6
- let newTree = new Tree ( { } ) ;
6
+ const newTree = new Tree ( { } ) ;
7
7
8
8
it ( 'should be able to create a newTree' , ( ) => {
9
9
expect ( newTree . state ) . toEqual ( { } ) ;
10
- } )
10
+ } ) ;
11
11
12
- it ( 'should have 5 properties' , ( ) => {
12
+ it ( 'should have 8 properties' , ( ) => {
13
13
expect ( newTree ) . toHaveProperty ( 'state' ) ;
14
14
expect ( newTree ) . toHaveProperty ( 'name' ) ;
15
15
expect ( newTree ) . toHaveProperty ( 'componentData' ) ;
16
16
expect ( newTree ) . toHaveProperty ( 'children' ) ;
17
17
expect ( newTree ) . toHaveProperty ( 'parent' ) ;
18
- } )
18
+ expect ( newTree ) . toHaveProperty ( 'isExpanded' ) ;
19
+ expect ( newTree ) . toHaveProperty ( 'rtid' ) ;
20
+ expect ( newTree ) . toHaveProperty ( 'route' ) ;
21
+ } ) ;
19
22
20
23
it ( 'has name default value as stateless' , ( ) => {
21
24
expect ( newTree . name ) . toBe ( 'nameless' ) ;
22
- } )
25
+ } ) ;
23
26
24
27
it ( 'has children as an empty array' , ( ) => {
25
28
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
+ */
29
37
30
38
describe ( 'Adding children' , ( ) => {
31
39
let newTree = new Tree ( { } ) ;
0 commit comments