angular.io-package: fix up test to match new functionality
This commit is contained in:
parent
3e7f837f1a
commit
bdc647462e
|
@ -11,12 +11,13 @@ describe('addJadeDataDocsProcessor', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add a doc for each module', function() {
|
it('should add a doc for each module', function() {
|
||||||
|
var exportDoc;
|
||||||
var docs = [
|
var docs = [
|
||||||
{
|
{
|
||||||
docType: 'module',
|
docType: 'module',
|
||||||
id: 'someModule',
|
id: 'someModule',
|
||||||
exports: [
|
exports: [
|
||||||
{ name: 'someObj', docType: 'var', symbolTypeName: 'MyClass', originalModule: 'some/private/module' }
|
exportDoc = { name: 'someObj', docType: 'var', symbolTypeName: 'MyClass', originalModule: 'some/private/module' }
|
||||||
],
|
],
|
||||||
fileInfo: { baseName: 'x_y' },
|
fileInfo: { baseName: 'x_y' },
|
||||||
description: 'some description\nsecond line'
|
description: 'some description\nsecond line'
|
||||||
|
@ -24,28 +25,30 @@ describe('addJadeDataDocsProcessor', function() {
|
||||||
];
|
];
|
||||||
docs = processor.$process(docs);
|
docs = processor.$process(docs);
|
||||||
|
|
||||||
expect(docs[1]).toEqual({
|
expect(docs.filter(function(doc) { return doc.docType === 'jade-data'; })[0]).toEqual({
|
||||||
id : 'someModule-data',
|
id : 'someModule-data',
|
||||||
aliases : [ 'someModule-data' ],
|
aliases : [ 'someModule-data' ],
|
||||||
docType : 'jade-data',
|
docType : 'jade-data',
|
||||||
originalDoc : docs[0],
|
originalDoc : docs[0],
|
||||||
data : [
|
data : [
|
||||||
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
|
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
|
||||||
{ name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var', originalModule: 'some/private/module' }
|
{ name : 'someObj-var', title : 'someObj', varType : 'MyClass', docType: 'var',
|
||||||
|
originalModule: 'some/private/module', exportDoc: exportDoc }
|
||||||
] });
|
] });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should sort the exports into alphabetical order', function() {
|
it('should sort the exports into alphabetical order', function() {
|
||||||
|
var alpha, beta, gamma, nu, mu;
|
||||||
var docs = [
|
var docs = [
|
||||||
{
|
{
|
||||||
docType: 'module',
|
docType: 'module',
|
||||||
id: 'someModule',
|
id: 'someModule',
|
||||||
exports: [
|
exports: [
|
||||||
{ name: 'Beta', docType: 'class'},
|
beta = { name: 'Beta', docType: 'class'},
|
||||||
{ name: 'Alpha', docType: 'class'},
|
alpha = { name: 'Alpha', docType: 'class'},
|
||||||
{ name: 'Gamma', docType: 'class'},
|
gamma = { name: 'Gamma', docType: 'class'},
|
||||||
{ name: 'Nu', docType: 'class'},
|
nu = { name: 'Nu', docType: 'class'},
|
||||||
{ name: 'Mu', docType: 'class'}
|
mu = { name: 'Mu', docType: 'class'}
|
||||||
],
|
],
|
||||||
fileInfo: { baseName: 'x_y' },
|
fileInfo: { baseName: 'x_y' },
|
||||||
description: 'some description\nsecond line'
|
description: 'some description\nsecond line'
|
||||||
|
@ -53,13 +56,13 @@ describe('addJadeDataDocsProcessor', function() {
|
||||||
];
|
];
|
||||||
docs = processor.$process(docs);
|
docs = processor.$process(docs);
|
||||||
|
|
||||||
expect(docs[1].data).toEqual([
|
expect(docs[2].data).toEqual([
|
||||||
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
|
{ name : 'index', title : 'X Y', intro : 'some description second line', docType : 'module' },
|
||||||
{ name: 'Alpha-class', title: 'Alpha', docType: 'class' },
|
{ name: 'Alpha-class', title: 'Alpha', docType: 'class', exportDoc: alpha },
|
||||||
{ name: 'Beta-class', title: 'Beta', docType: 'class' },
|
{ name: 'Beta-class', title: 'Beta', docType: 'class', exportDoc: beta },
|
||||||
{ name: 'Gamma-class', title: 'Gamma', docType: 'class' },
|
{ name: 'Gamma-class', title: 'Gamma', docType: 'class', exportDoc: gamma },
|
||||||
{ name: 'Mu-class', title: 'Mu', docType: 'class' },
|
{ name: 'Mu-class', title: 'Mu', docType: 'class', exportDoc: mu },
|
||||||
{ name: 'Nu-class', title: 'Nu', docType: 'class' }
|
{ name: 'Nu-class', title: 'Nu', docType: 'class', exportDoc: nu }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue