From b32685c698dd9ca8e2a4083b14d2bc9702ca5e83 Mon Sep 17 00:00:00 2001 From: Samy Pesse Date: Thu, 26 May 2016 22:01:40 +0200 Subject: [PATCH] Add test for custom glossary file --- lib/output/__tests__/website.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/output/__tests__/website.js b/lib/output/__tests__/website.js index 0415fbb50..501503a90 100644 --- a/lib/output/__tests__/website.js +++ b/lib/output/__tests__/website.js @@ -44,6 +44,20 @@ describe('WebsiteGenerator', function() { expect(html).toHaveDOMElement('.page-inner a[href="../GLOSSARY.html#hello"]'); }); + it('should accept a custom glossary file', function() { + return generateMock(WebsiteGenerator, { + 'README.md': 'Hello World', + 'book.json': '{ "structure": { "glossary": "custom.md" } }', + 'custom.md': '# Glossary\n\n## Hello\n\nHello World' + }) + .then(function(folder) { + expect(folder).toHaveFile('custom.html'); + expect(folder).toNotHaveFile('GLOSSARY.html'); + + var html = fs.readFileSync(folder + '/index.html', 'utf8'); + expect(html).toHaveDOMElement('.page-inner a[href="custom.html#hello"]'); + }); + }); });