@@ -3,6 +3,7 @@ var processor = require('../../processors/component-groups-generate');
3
3
var Config = require ( 'dgeni' ) . Config ;
4
4
5
5
describe ( "component-groups processor" , function ( ) {
6
+
6
7
it ( "should create a new doc for each group of components (by docType) in each module" , function ( ) {
7
8
var docs = [ ] ;
8
9
var modules = [ {
@@ -20,8 +21,48 @@ describe("component-groups processor", function() {
20
21
21
22
config = new Config ( ) ;
22
23
config . set ( 'rendering.contentsFolder' , 'partials' ) ;
24
+ config . set ( 'processing.api-docs' , {
25
+ outputPath : '${area}/${module}/${docType}/${name}.html' ,
26
+ path : '${area}/${module}/${docType}/${name}'
27
+ } ) ;
28
+
23
29
processor . process ( docs , config , modules ) ;
24
30
25
31
expect ( docs . length ) . toEqual ( 2 ) ;
32
+
33
+ } ) ;
34
+
35
+
36
+ it ( "should use the outputPath and path specified in processing.api-docs" , function ( ) {
37
+ var docs = [ ] ;
38
+ var modules = [ {
39
+ id : 'mod1' ,
40
+ name : 'test' ,
41
+ area : 'api-docs' ,
42
+ components : [
43
+ { docType : 'a' , id : 'a1' } ,
44
+ { docType : 'a' , id : 'a2' } ,
45
+ { docType : 'a' , id : 'a3' } ,
46
+ { docType : 'a' , id : 'a4' } ,
47
+ { docType : 'b' , id : 'b1' } ,
48
+ { docType : 'b' , id : 'b2' } ,
49
+ { docType : 'b' , id : 'a3' }
50
+ ]
51
+ } ] ;
52
+
53
+ config = new Config ( ) ;
54
+ config . set ( 'rendering.contentsFolder' , 'partials' ) ;
55
+ config . set ( 'processing.api-docs' , {
56
+ outputPath : '${area}/${module}/${docType}/${name}.html' ,
57
+ path : '${area}/${module}/${docType}/${name}'
58
+ } ) ;
59
+
60
+ processor . process ( docs , config , modules ) ;
61
+
62
+ expect ( docs [ 0 ] . path ) . toBe ( 'api-docs/test/a/index' ) ;
63
+ expect ( docs [ 0 ] . outputPath ) . toBe ( 'partials/api-docs/test/a/index.html' ) ;
64
+
26
65
} ) ;
66
+
67
+
27
68
} ) ;
0 commit comments