diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-24 17:19:52 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-24 17:19:52 +0100 |
commit | 52eccb29e49f2199cbd73f522de47a7bd764c7dd (patch) | |
tree | 6be72bce0a06533a1a1ef249057132f91f6e74b4 /test | |
parent | 86e4a935e2956e0929b273aece04bea528d1cf4e (diff) | |
download | gitbook-52eccb29e49f2199cbd73f522de47a7bd764c7dd.zip gitbook-52eccb29e49f2199cbd73f522de47a7bd764c7dd.tar.gz gitbook-52eccb29e49f2199cbd73f522de47a7bd764c7dd.tar.bz2 |
Add property depth to article and pages
Diffstat (limited to 'test')
-rw-r--r-- | test/summary.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/summary.js b/test/summary.js index a98b6b7..08b9db8 100644 --- a/test/summary.js +++ b/test/summary.js @@ -105,6 +105,12 @@ describe('Summary / Table of contents', function() { book.summary.getArticleByLevel('2.1').title.should.equal('Hello 3'); book.summary.getArticleByLevel('2.1.1').title.should.equal('Hello 4'); }); + + it('should correctly calcul depth', function() { + book.summary.getArticleByLevel('0').depth().should.equal(1); + book.summary.getArticleByLevel('1.1').depth().should.equal(2); + book.summary.getArticleByLevel('1.1.1').depth().should.equal(3); + }); }); describe('External', function() { |