From 6a63708939c62c74dd3e8a032fbf0accaa2b03a5 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Tue, 1 Apr 2014 00:42:14 -0700 Subject: [PATCH] Add tests for null paths in navigation Unfinished chapters/articles should be put in navigation --- test/fixtures/SUMMARY.md | 3 +++ test/navigation.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/test/fixtures/SUMMARY.md b/test/fixtures/SUMMARY.md index 9f55e4cbc..74bbd1b8b 100644 --- a/test/fixtures/SUMMARY.md +++ b/test/fixtures/SUMMARY.md @@ -5,3 +5,6 @@ * [Article 2](chapter-1/ARTICLE2.md) * [Chapter 2](chapter-2/README.md) * [Chapter 3](chapter-3/README.md) +* [Chapter 4](chapter-4/README.md) + * Unfinished article +* Unfinished Chapter diff --git a/test/navigation.js b/test/navigation.js index 9b17f7f02..23d98ac7f 100644 --- a/test/navigation.js +++ b/test/navigation.js @@ -65,4 +65,10 @@ describe('Summary navigation', function() { assert.equal(nav['chapter-2/README.html'].level, '2'); assert.equal(nav['chapter-3/README.html'].level, '3'); }); + + it('should not accept null paths', function() { + var nav = navigation(LEXED); + + assert(!nav[null]); + }); });