mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 18:43:29 +00:00
Add test for custom glossary file
This commit is contained in:
@@ -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"]');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user