| Conditions | 1 |
| Paths | 1 |
| Total Lines | 39 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | var chai = require('chai'); |
||
| 12 | describe('Template', function() { |
||
| 13 | before( function(done) { |
||
| 14 | Manager.instance.init() |
||
| 15 | .then(function () { |
||
| 16 | this.fixture = { |
||
| 17 | template: fse.readFileSync(__dirname + '/fixtures/templates/article.html', 'utf-8') |
||
| 18 | } |
||
| 19 | done() |
||
| 20 | |||
| 21 | }.bind(this)) |
||
| 22 | }); |
||
| 23 | |||
| 24 | /** |
||
| 25 | * getAbeImport |
||
| 26 | * |
||
| 27 | */ |
||
| 28 | it('getAbeImport()', function() { |
||
| 29 | var res = getAbeImport(this.fixture.template) |
||
| 30 | chai.expect(res).to.have.length(4); |
||
| 31 | }); |
||
| 32 | |||
| 33 | /** |
||
| 34 | * includePartials |
||
| 35 | * |
||
| 36 | */ |
||
| 37 | it('includePartials()', function() { |
||
| 38 | var template = includePartials(this.fixture.template) |
||
| 39 | chai.expect(template).to.contain("{{abe type='text' key='title' desc='titre' tab='default'}}"); |
||
| 40 | }); |
||
| 41 | |||
| 42 | /** |
||
| 43 | * getTemplate |
||
| 44 | * |
||
| 45 | */ |
||
| 46 | it('getTemplate()', function() { |
||
| 47 | var template = getTemplate('article') |
||
| 48 | chai.expect(template).to.contain("{{abe type='text' key='title' desc='titre' tab='default' order='1'}}"); |
||
| 49 | }); |
||
| 50 | }); |
||
| 51 |