summaryrefslogtreecommitdiffstats
path: root/test/navigation.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 19:39:26 -0700
committerAaron O'Mullan <aaron.omullan@friendco.de>2014-03-31 19:39:38 -0700
commitb16f6d548ca0b85a0464a01da6f87db628069d7d (patch)
tree6be759c4171f6c2ba8457f6aaa1320aea1b57672 /test/navigation.js
parent07c10da91fa689adcc17c5677b21fb3b5dbf17e2 (diff)
downloadgitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.zip
gitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.tar.gz
gitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.tar.bz2
Add tests for level attribute in navigation
Diffstat (limited to 'test/navigation.js')
-rw-r--r--test/navigation.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/navigation.js b/test/navigation.js
index 9cc5745..9b17f7f 100644
--- a/test/navigation.js
+++ b/test/navigation.js
@@ -54,4 +54,15 @@ describe('Summary navigation', function() {
assert(nav['chapter-2/README.html']);
assert(nav['chapter-3/README.html']);
});
+
+ it('should detect levels correctly', function() {
+ var nav = navigation(LEXED);
+
+ assert.equal(nav['README.html'].level, '0');
+ assert.equal(nav['chapter-1/README.html'].level, '1');
+ assert.equal(nav['chapter-1/ARTICLE1.html'].level, '1.1');
+ assert.equal(nav['chapter-1/ARTICLE2.html'].level, '1.2');
+ assert.equal(nav['chapter-2/README.html'].level, '2');
+ assert.equal(nav['chapter-3/README.html'].level, '3');
+ });
});