@@ -2,18 +2,27 @@ module("graph.js");
2
2
3
3
test ( "nodeFromTask" , function ( ) {
4
4
var task = {
5
- deps : [ "B" , "C" ] ,
6
- taskId : "A" ,
7
- status : "DONE"
5
+ deps : [ "B1" , "C1" ] ,
6
+ taskId : "A1" ,
7
+ status : "DONE" ,
8
+ name : "A" ,
9
+ params : { } ,
10
+ priority : 0 ,
8
11
} ;
9
12
var expected = {
10
- taskId : "A " ,
13
+ taskId : "A1 " ,
11
14
status : "DONE" ,
12
- trackingUrl : "#A" ,
13
- deps : [ "B" , "C" ] ,
14
- depth : - 1
15
+ trackingUrl : "#A1" ,
16
+ deps : [ "B1" , "C1" ] ,
17
+ depth : - 1 ,
18
+ name : "A" ,
19
+ params : { } ,
20
+ priority : 0 ,
15
21
} ;
16
- deepEqual ( Graph . testableMethods . nodeFromTask ( task ) , expected ) ;
22
+ let graph = {
23
+ hashBase : "#"
24
+ }
25
+ deepEqual ( Graph . testableMethods . nodeFromTask . bind ( graph ) ( task ) , expected ) ;
17
26
} ) ;
18
27
19
28
test ( "uniqueIndexByProperty" , function ( ) {
@@ -70,7 +79,7 @@ test("computeRowsSelfDeps", function () {
70
79
var rowSizes = Graph . testableMethods . computeRows ( nodes , nodeIndex )
71
80
equal ( A1 . depth , 0 )
72
81
equal ( A2 . depth , 1 )
73
- equal ( rowSizes , [ 1 , 1 ] )
82
+ deepEqual ( rowSizes , [ 1 , 1 ] )
74
83
} ) ;
75
84
76
85
test ( "computeRowsGrouped" , function ( ) {
@@ -83,6 +92,8 @@ test("computeRowsGrouped", function() {
83
92
var D2 = { name : "D" , taskId : "D2" , deps : [ ] , depth : - 1 }
84
93
var E1 = { name : "E" , taskId : "E1" , deps : [ ] , depth : - 1 }
85
94
var E2 = { name : "E" , taskId : "E2" , deps : [ ] , depth : - 1 }
95
+ var nodes = [ A0 , B0 , C1 , C2 , D0 , D1 , D2 , E1 , E2 ]
96
+ var nodeIndex = { "A0" : 0 , "B0" : 1 , "C1" : 2 , "C2" : 3 , "D0" : 4 , "D1" : 5 , "D2" : 6 , "E1" : 7 , "E2" : 8 }
86
97
var rowSizes = Graph . testableMethods . computeRows ( nodes , nodeIndex )
87
98
equal ( A0 . depth , 0 )
88
99
equal ( B0 . depth , 1 )
@@ -93,7 +104,7 @@ test("computeRowsGrouped", function() {
93
104
equal ( D2 . depth , 3 )
94
105
equal ( E1 . depth , 4 )
95
106
equal ( E2 . depth , 4 )
96
- equal ( rowSizes , [ 1 , 1 , 2 , 3 , 2 ] )
107
+ deepEqual ( rowSizes , [ 1 , 1 , 2 , 3 , 2 ] )
97
108
} ) ;
98
109
99
110
test ( "createGraph" , function ( ) {
0 commit comments