diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-26 22:01:40 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-26 22:01:40 +0200 |
commit | b32685c698dd9ca8e2a4083b14d2bc9702ca5e83 (patch) | |
tree | 1fbbc6308a94a9b71321817601690b1121571df7 /lib | |
parent | 09b3618da88ce9cdde948e0511ef95886e24d676 (diff) | |
download | gitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.zip gitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.tar.gz gitbook-b32685c698dd9ca8e2a4083b14d2bc9702ca5e83.tar.bz2 |
Add test for custom glossary file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output/__tests__/website.js | 14 |
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"]'); + }); + }); }); |