From 8e2675029f5ca404a7c649cc161df3ea642d941f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Sat, 28 Apr 2012 22:45:28 -0700 Subject: chore(docs): re-skin main documentation --- docs/spec/ngdocSpec.js | 103 ++++++++----------------------------------------- 1 file changed, 16 insertions(+), 87 deletions(-) (limited to 'docs/spec/ngdocSpec.js') diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 7359819f..b591a7de 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -39,15 +39,6 @@ describe('ngdoc', function() { expect(ngdoc.metadata([d3])[0].shortName).toEqual('more text'); }); - it('should have depth information', function() { - var d1 = new Doc('@name a.b.c').parse(); - var d2 = new Doc('@name a.b.ng-c').parse(); - var d3 = new Doc('@name some text: more text').parse(); - expect(ngdoc.metadata([d1])[0].depth).toEqual(2); - expect(ngdoc.metadata([d2])[0].depth).toEqual(2); - expect(ngdoc.metadata([d3])[0].depth).toEqual(1); - }); - }); describe('parse', function() { @@ -89,38 +80,6 @@ describe('ngdoc', function() { expect(doc.name).toEqual('friendly name'); }); - it('should escape element', function() { - var doc = new Doc('@name a\n@description before ' + - '\n<>\n after'); - doc.parse(); - expect(doc.description).toContain('

before

' + - '
\n<>\n

after

'); - }); - - it('should preserve the source attribute', function() { - var doc = new Doc('@name a\n@description before ' + - 'lala after'); - doc.parse(); - expect(doc.description).toContain('

before

' + - '
lala

after

'); - }); - - it('should preserve the jsfiddle attribute', function() { - var doc = new Doc('@name a\n@description before ' + - 'lala after'); - doc.parse(); - expect(doc.description).toContain('

before

' + - '
lala

after

'); - }); - - it('should escape element', function() { - var doc = new Doc('@name a\n@description before ' + - '\n<>\n after'); - doc.parse(); - expect(doc.description).toContain('

before

' + - '
\n<>\n

after

'); - }); - it('should store all links', function() { var doc = new Doc('@name a\n@description {@link api/angular.link}'); doc.parse(); @@ -173,51 +132,33 @@ describe('ngdoc', function() { }); describe('markdown', function() { - it('should replace angular in markdown', function() { - expect(new Doc().markdown('')). - toEqual('

<angular/>

'); - }); - it('should not replace anything in
, but escape the html escape the content', function() {
       expect(new Doc().markdown('bah x\n
\nangular.k\n
\n asdf x')). toEqual( - '

bah x

' + - '
\n' +
+            '

bah x\n' + + '

\n' +
             '<b>angular</b>.k\n' +
-            '
' + - '

asdf x

'); - }); - - it('should ignore doc widgets', function() { - expect(new Doc().markdown('textdo not touch')). - toEqual('

text

do not touch'); - - expect(new Doc().markdown('textdo not touch')). - toEqual('

text

do not touch'); - }); - - it('should ignore doc widgets with params', function() { - expect(new Doc().markdown('textdo not touch')). - toEqual('

text

do not touch'); + '
\n' + + ' asdf x

'); }); it('should replace text between two
 tags', function() {
-      expect(new Doc().markdown('
x
# One
b
')). - toMatch('

One

x\n# One\n
b
')). + toMatch('\n\n

One

\n\n\n' + - '' + + 'before
\n' + + '
' + '\ngit bla bla\n\n' + '')).toEqual( - '

before

\n' + - '\n' + + '

before

\n' + + '
\n' + 'git bla bla\n' + '\n' + - ''); + '

'); }); it('should unindent text before processing based on the second line', function() { @@ -437,18 +378,18 @@ describe('ngdoc', function() { var doc = new Doc("@name a\n@description
abc
"); doc.parse(); expect(doc.description). - toBe('
<b>abc</b>
'); + toBe('
<b>abc</b>
'); }); it('should support multiple pre blocks', function() { var doc = new Doc("@name a\n@description foo \n
abc
\n#bah\nfoo \n
cba
"); doc.parse(); expect(doc.description). - toBe('

foo

' + - '
abc
' + + toBe('

foo \n' + + '

abc
\n\n' + '

bah

\n\n' + - '

foo

' + - '
cba
'); + '

foo \n' + + '

cba
'); }); @@ -493,18 +434,6 @@ describe('ngdoc', function() { doc.parse(); expect(doc.example).toEqual('

text {{ abc }}

'); }); - - it('should support doc:example', function() { - var doc = new Doc('@name a\n@ngdoc overview\n@example \n' + - '\n' + - ' \n' + - ' \n' + - '').parse(); - var html = doc.html(); - expect(html).toContain('
<escapeme>
'); - expect(html).toContain('
<scenario>
'); - expect(doc.scenarios).toEqual(['']); - }); }); describe('@deprecated', function() { -- cgit v1.2.3