summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/page.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/page.js b/test/page.js
index f11d55e..ae36660 100644
--- a/test/page.js
+++ b/test/page.js
@@ -8,6 +8,8 @@ describe('Page', function() {
return mock.setupDefaultBook({
'README.md': ' # Hello World\n\nThis is a description',
'heading.md': '# Hello\n\n## World',
+ 'description.md': '# This is a title\n\nThis is the short description.\n\nNot this one.',
+ 'frontmatter.md': '---\ndescription: Hello World\n---\n\n# This is a title\n\nThis is not the description',
'links.md': '[link](hello.md) [link 2](variables/page/next.md) [readme](README.md)',
'links/relative.md': '[link](../hello.md) [link 2](/variables/page/next.md) [readme](../README.md)',
@@ -128,6 +130,28 @@ describe('Page', function() {
});
});
+ describe('Description', function() {
+ it('should extratc page description from content', function() {
+ var page = book.addPage('description.md');
+
+ return page.toHTML(output)
+ .then(function() {
+ page.description.should.equal('This is the short description.');
+ });
+ });
+ });
+
+ describe('Font-Matter', function() {
+ it('should extratc page description from front matter', function() {
+ var page = book.addPage('frontmatter.md');
+
+ return page.toHTML(output)
+ .then(function() {
+ page.description.should.equal('Hello World');
+ });
+ });
+ });
+
describe('Code Blocks', function() {
var page;