diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-31 17:35:46 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-31 17:36:01 -0700 |
commit | 45574cf7a51cc15daa685be463a116e91f0a13f5 (patch) | |
tree | 5524d332a1fc0f4cce47817c8c21022dd31b9730 | |
parent | 4607f406abe78b56944582549f4ffc5dbc1ed8cf (diff) | |
download | gitbook-45574cf7a51cc15daa685be463a116e91f0a13f5.zip gitbook-45574cf7a51cc15daa685be463a116e91f0a13f5.tar.gz gitbook-45574cf7a51cc15daa685be463a116e91f0a13f5.tar.bz2 |
Add better tests for chapter navigation
Proves previous and next chapter logic is broken
-rw-r--r-- | test/navigation.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/navigation.js b/test/navigation.js index 8f82911..4ed2c04 100644 --- a/test/navigation.js +++ b/test/navigation.js @@ -16,7 +16,8 @@ describe('Summary navigation', function() { 'README.html', 'chapter-1/README.html', 'chapter-1/ARTICLE1.html', - 'chapter-1/ARTICLE2.html' + 'chapter-1/ARTICLE2.html', + 'chapter-2/README.html', ]); // Make sure it found the files we gave it @@ -24,6 +25,8 @@ describe('Summary navigation', function() { assert(nav['chapter-1/README.html']); assert(nav['chapter-1/ARTICLE1.html']); assert(nav['chapter-1/ARTICLE2.html']); + assert(nav['chapter-2/README.html']); + assert.equal(nav['README.html'].prev, null); assert.equal(nav['README.html'].next.path, 'chapter-1/README.html'); @@ -36,6 +39,9 @@ describe('Summary navigation', function() { assert.equal(nav['chapter-1/ARTICLE2.html'].prev.path, 'chapter-1/ARTICLE1.html'); assert.equal(nav['chapter-1/ARTICLE2.html'].next.path, 'chapter-2/README.html'); + + assert.equal(nav['chapter-2/README.html'].prev.path, 'chapter-1/ARTICLE2.html'); + assert.equal(nav['chapter-2/README.html'].next.path, 'chapter-3/README.html'); }); it('should give full tree, when not limited', function() { |