diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-31 19:39:26 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-03-31 19:39:38 -0700 |
commit | b16f6d548ca0b85a0464a01da6f87db628069d7d (patch) | |
tree | 6be759c4171f6c2ba8457f6aaa1320aea1b57672 | |
parent | 07c10da91fa689adcc17c5677b21fb3b5dbf17e2 (diff) | |
download | gitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.zip gitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.tar.gz gitbook-b16f6d548ca0b85a0464a01da6f87db628069d7d.tar.bz2 |
Add tests for level attribute in navigation
-rw-r--r-- | test/navigation.js | 11 |
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'); + }); }); |