summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/summary.js6
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() {