From 9e37ebe635a37a12535922ac9902ebd492d7cba9 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 15 Jul 2011 17:18:38 -0700 Subject: test(ngdoc): add test for @ngdoc function --- docs/spec/ngdocSpec.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 6c6a93f2..a184c5df 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -496,6 +496,26 @@ describe('ngdoc', function(){ }); + describe('function', function(){ + it('should format', function(){ + var doc = new Doc({ + ngdoc:'function', + name:'some.name', + param: [ + {name:'a', optional: true}, + {name:'b', type: 'someType', optional: true, 'default': '"xxx"'}, + {name:'c', type: 'string', description: 'param desc'} + ], + returns: {type: 'number', description: 'return desc'} + }); + doc.html_usage_function(dom); + expect(dom).toContain('some.name([a][, b], c)'); //TODO(i) the comma position here is lame + expect(dom).toContain('param desc'); + expect(dom).toContain('(optional="xxx")'); + expect(dom).toContain('return desc'); + }); + }); + describe('filter', function(){ it('should format', function(){ var doc = new Doc({ -- cgit v1.2.3