summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-18 17:50:10 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-18 17:50:10 +0100
commit3d3302e547929a4f728aefa89ad7634f234fa726 (patch)
treeb6961ce750ea9dc1c6ffea36e3054047238f8d54 /test
parent95d81d02a12dc6ae5e9d845e2eb69b7e1dc1debd (diff)
downloadgitbook-3d3302e547929a4f728aefa89ad7634f234fa726.zip
gitbook-3d3302e547929a4f728aefa89ad7634f234fa726.tar.gz
gitbook-3d3302e547929a4f728aefa89ad7634f234fa726.tar.bz2
Add detection of text direction and provide: 'page.dir'
Diffstat (limited to 'test')
-rw-r--r--test/page.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/page.js b/test/page.js
index 52d86d8..9afec1c 100644
--- a/test/page.js
+++ b/test/page.js
@@ -29,6 +29,8 @@ describe('Page', function() {
'variables/page/title.md': '{{ page.title }}',
'variables/page/previous.md': '{{ page.previous.title }} {{ page.previous.path }}',
'variables/page/next.md': '{{ page.next.title }} {{ page.next.path }}',
+ 'variables/page/dir/ltr.md': 'This is english: {{ page.dir }}',
+ 'variables/page/dir/rtl.md': 'بسيطة {{ page.dir }}',
'GLOSSARY.md': '# Glossary\n\n\n## abracadabra\n\nthis is the description'
}, [
@@ -312,6 +314,20 @@ describe('Page', function() {
return page.toHTML(output)
.should.be.fulfilledWith('<p>Test Variables variables/page/title.md</p>\n');
});
+
+ describe('page.dir', function() {
+ it('should detect ltr', function() {
+ var page = book.addPage('variables/page/dir/ltr.md');
+ return page.toHTML(output)
+ .should.be.fulfilledWith('<p>This is english: ltr</p>\n');
+ });
+
+ it('should detect rtl', function() {
+ var page = book.addPage('variables/page/dir/rtl.md');
+ return page.toHTML(output)
+ .should.be.fulfilledWith('<p>&#x628;&#x633;&#x64A;&#x637;&#x629; rtl</p>\n');
+ });
+ });
});
describe('Annotations / Glossary', function() {