diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-19 21:19:41 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-19 21:19:41 +0100 |
commit | d6f7f1f4fb12ac1c24624aa8358f8149ec720622 (patch) | |
tree | a97487e04393ce0109cd71f3bc9efd783acffcc5 /test/parsing.js | |
parent | a67dad8cbef26f800a9be67cd15bea5a304de140 (diff) | |
download | gitbook-d6f7f1f4fb12ac1c24624aa8358f8149ec720622.zip gitbook-d6f7f1f4fb12ac1c24624aa8358f8149ec720622.tar.gz gitbook-d6f7f1f4fb12ac1c24624aa8358f8149ec720622.tar.bz2 |
Add test for parsing of navigation
Diffstat (limited to 'test/parsing.js')
-rw-r--r-- | test/parsing.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/parsing.js b/test/parsing.js index bde8be3..477631f 100644 --- a/test/parsing.js +++ b/test/parsing.js @@ -28,7 +28,7 @@ describe('Book parsing', function () { assert.equal(LEXED[1].description, "a second test"); }); - it('should correctly parse files', function() { + it('should correctly parse list of files', function() { var FILES = book1.files; assert.equal(FILES.length, 2); @@ -45,4 +45,14 @@ describe('Book parsing', function () { assert.equal(book2.books[1].options.lang, "fr"); assert.equal(book2.books[1].options.title, "French Book"); }); + + it('should correctly parse the navigation', function() { + var NAVIGATION = book1.navigation; + + assert.equal(_.size(NAVIGATION), 1); + assert(NAVIGATION["intro.md"]) + assert.equal(NAVIGATION["intro.md"].title, "Introduction"); + assert.equal(NAVIGATION["intro.md"].prev, null); + assert.equal(NAVIGATION["intro.md"].next.title, "Chapter 1"); + }); }); |