-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug unknow file include + unit test get template
- Loading branch information
nicolaslabbe
committed
Sep 28, 2016
1 parent
bf7a8a0
commit b665c9b
Showing
6 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -564,6 +564,7 @@ export default class Utils { | |
tab: 'default', | ||
type: 'text', | ||
value: '', | ||
file: '', | ||
visible: true | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
"{{abe type='data' key='top_things_slider_highlight' desc='Automatic slider' source='select abe_meta from ./' editable='false'}}" | ||
{{abe type='data' key='top_things_slider_highlight' desc='Automatic slider' source='select abe_meta from ./' editable='false'}} | ||
|
||
{{abe type='import' file='title.html'}} | ||
|
||
<div>{{abe type='import' file='test.html'}}</div>{{abe type='import' file='test.html'}} | ||
{{abe type='import' file='test.html'}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{abe type='text' key='title' desc='titre' tab='default'}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var chai = require('chai'); | ||
|
||
var config = require('../src/cli').config | ||
config.set({root: __dirname + '/fixtures'}) | ||
|
||
var getTemplate = require('../src/cli').getTemplate | ||
var includePartials = require('../src/cli/helpers/abe-template').includePartials | ||
var getAbeImport = require('../src/cli/helpers/abe-template').getAbeImport | ||
var Manager = require('../src/cli').Manager; | ||
var fse = require('fs-extra'); | ||
|
||
describe('Template', function() { | ||
before( function(done) { | ||
Manager.instance.init() | ||
.then(function () { | ||
this.fixture = { | ||
template: fse.readFileSync(__dirname + '/fixtures/templates/article.html', 'utf-8') | ||
} | ||
done() | ||
|
||
}.bind(this)) | ||
}); | ||
|
||
/** | ||
* getAbeImport | ||
* | ||
*/ | ||
it('getAbeImport()', function() { | ||
var res = getAbeImport(this.fixture.template) | ||
chai.expect(res).to.have.length(4); | ||
}); | ||
|
||
/** | ||
* includePartials | ||
* | ||
*/ | ||
it('includePartials()', function() { | ||
var template = includePartials(this.fixture.template) | ||
chai.expect(template).to.contain("{{abe type='text' key='title' desc='titre' tab='default'}}"); | ||
}); | ||
|
||
/** | ||
* getTemplate | ||
* | ||
*/ | ||
it('getTemplate()', function() { | ||
var template = getTemplate('article') | ||
chai.expect(template).to.contain("{{abe type='text' key='title' desc='titre' tab='default' order='1'}}"); | ||
}); | ||
}); |