summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-05-26 22:01:40 +0200
committerSamy Pesse <samypesse@gmail.com>2016-05-26 22:01:40 +0200
commitb32685c698dd9ca8e2a4083b14d2bc9702ca5e83 (patch)
tree1fbbc6308a94a9b71321817601690b1121571df7
parent09b3618da88ce9cdde948e0511ef95886e24d676 (diff)
downloadgitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.zip
gitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.tar.gz
gitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.tar.bz2
Add test for custom glossary file
-rw-r--r--lib/output/__tests__/website.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/output/__tests__/website.js b/lib/output/__tests__/website.js
index 0415fbb..501503a 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"]');
+ });
+ });
});