summaryrefslogtreecommitdiffstats
path: root/test/navigation.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-05-26 17:42:05 +0200
committerSamy Pessé <samypesse@gmail.com>2014-05-26 17:42:05 +0200
commita0d56460343937451326237107944941b16cdbb9 (patch)
tree058ee45c864785ba978b084a75499246f5eabd2c /test/navigation.js
parent2f8af5f136fb99412f21525f8400871492a64767 (diff)
downloadgitbook-a0d56460343937451326237107944941b16cdbb9.zip
gitbook-a0d56460343937451326237107944941b16cdbb9.tar.gz
gitbook-a0d56460343937451326237107944941b16cdbb9.tar.bz2
Adapt navigation parsing to third and more levels in summary
Diffstat (limited to 'test/navigation.js')
-rw-r--r--test/navigation.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/navigation.js b/test/navigation.js
index b0e5b98..0330d74 100644
--- a/test/navigation.js
+++ b/test/navigation.js
@@ -18,6 +18,8 @@ describe('Summary navigation', function() {
'chapter-1/ARTICLE1.md',
'chapter-1/ARTICLE2.md',
'chapter-2/README.md',
+ 'chapter-1/ARTICLE-1-2-1.md',
+ 'chapter-1/ARTICLE-1-2-2.md'
]);
// Make sure it found the files we gave it
@@ -26,6 +28,8 @@ describe('Summary navigation', function() {
assert(nav['chapter-1/ARTICLE1.md']);
assert(nav['chapter-1/ARTICLE2.md']);
assert(nav['chapter-2/README.md']);
+ assert(nav['chapter-1/ARTICLE-1-2-1.md']);
+ assert(nav['chapter-1/ARTICLE-1-2-2.md']);
assert.equal(nav['README.md'].prev, null);
@@ -38,9 +42,15 @@ describe('Summary navigation', function() {
assert.equal(nav['chapter-1/ARTICLE1.md'].next.path, 'chapter-1/ARTICLE2.md');
assert.equal(nav['chapter-1/ARTICLE2.md'].prev.path, 'chapter-1/ARTICLE1.md');
- assert.equal(nav['chapter-1/ARTICLE2.md'].next.path, 'chapter-2/README.md');
+ assert.equal(nav['chapter-1/ARTICLE2.md'].next.path, 'chapter-1/ARTICLE-1-2-1.md');
- assert.equal(nav['chapter-2/README.md'].prev.path, 'chapter-1/ARTICLE2.md');
+ assert.equal(nav['chapter-1/ARTICLE-1-2-1.md'].prev.path, 'chapter-1/ARTICLE2.md');
+ assert.equal(nav['chapter-1/ARTICLE-1-2-1.md'].next.path, 'chapter-1/ARTICLE-1-2-2.md');
+
+ assert.equal(nav['chapter-1/ARTICLE-1-2-2.md'].prev.path, 'chapter-1/ARTICLE-1-2-1.md');
+ assert.equal(nav['chapter-1/ARTICLE-1-2-2.md'].next.path, 'chapter-2/README.md');
+
+ assert.equal(nav['chapter-2/README.md'].prev.path, 'chapter-1/ARTICLE-1-2-2.md');
assert.equal(nav['chapter-2/README.md'].next.path, 'chapter-3/README.md');
});