summaryrefslogtreecommitdiffstats
path: root/test/parsing.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-24 12:18:23 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-24 12:18:23 +0100
commit99d9d4961076424dc9681ee7f2ab2fed28d5d7c0 (patch)
tree7d33bce96d5c872aa962495590c07247243e95f6 /test/parsing.js
parentfd98746c2b14985b914678f39361b31028437d5b (diff)
downloadgitbook-99d9d4961076424dc9681ee7f2ab2fed28d5d7c0.zip
gitbook-99d9d4961076424dc9681ee7f2ab2fed28d5d7c0.tar.gz
gitbook-99d9d4961076424dc9681ee7f2ab2fed28d5d7c0.tar.bz2
Improve navigation with non existant entries
Use i18n for introduction title
Diffstat (limited to 'test/parsing.js')
-rw-r--r--test/parsing.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/parsing.js b/test/parsing.js
index 0166e85..fcda739 100644
--- a/test/parsing.js
+++ b/test/parsing.js
@@ -18,18 +18,22 @@ describe('Book parsing', function () {
assert.equal(LEXED.chapters[0].path, 'intro.md');
assert.equal(LEXED.chapters[0].exists, true);
+ assert.equal(LEXED.chapters[0].introduction, true);
assert.equal(LEXED.chapters[0].external, false);
assert.equal(LEXED.chapters[1].path, 'test.md');
assert.equal(LEXED.chapters[1].exists, false);
+ assert.equal(LEXED.chapters[1].introduction, false);
assert.equal(LEXED.chapters[1].external, false);
assert.equal(LEXED.chapters[2].path, 'test2.md');
assert.equal(LEXED.chapters[2].exists, false);
+ assert.equal(LEXED.chapters[2].introduction, false);
assert.equal(LEXED.chapters[2].external, false);
assert.equal(LEXED.chapters[3].path, 'https://www.google.com');
assert.equal(LEXED.chapters[3].exists, true);
+ assert.equal(LEXED.chapters[3].introduction, false);
assert.equal(LEXED.chapters[3].external, true);
});
@@ -69,6 +73,10 @@ describe('Book parsing', function () {
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");
+ assert.equal(NAVIGATION["intro.md"].next.title, "Article 1");
+
+ assert.equal(NAVIGATION["sub/test1.md"].title, "Article 1");
+ assert.equal(NAVIGATION["sub/test1.md"].prev.title, "Introduction");
+ assert.equal(NAVIGATION["sub/test1.md"].next, null);
});
});