| Total Complexity | 4 |
| Complexity/F | 1 |
| Lines of Code | 40 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | var chai = require('chai'); |
||
| 2 | var sinonChai = require('sinon-chai') |
||
| 3 | var expect = chai.expect |
||
| 4 | chai.use(sinonChai) |
||
| 5 | var sinon = require('sinon'); |
||
| 6 | var path = require('path'); |
||
| 7 | var fse = require('fs-extra'); |
||
| 8 | |||
| 9 | var config = require('../../../src/cli').config |
||
| 10 | config.set({root: path.join(process.cwd(), 'test', 'fixtures')}) |
||
| 11 | |||
| 12 | var cmsEditor = require('../../../src/cli').cmsEditor; |
||
| 13 | var Manager = require('../../../src/cli').Manager; |
||
| 14 | |||
| 15 | describe('Form', function() { |
||
| 16 | before( function(done) { |
||
| 17 | Manager.instance.init() |
||
| 18 | .then(function () { |
||
| 19 | this.fixture = {} |
||
| 20 | done() |
||
| 21 | |||
| 22 | }.bind(this)) |
||
| 23 | }); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * getTemplatesTexts |
||
| 27 | * |
||
| 28 | */ |
||
| 29 | it('new Form', function() { |
||
| 30 | // stub |
||
| 31 | var sinonInstance = sinon.sandbox.create(); |
||
|
|
|||
| 32 | // sinonInstance.stub(fse, 'readFileSync'); |
||
| 33 | |||
| 34 | var form = new cmsEditor.form() |
||
| 35 | form.add({key: 'test'}) |
||
| 36 | chai.expect(form._form.default.item[0].key).to.be.equal('test'); |
||
| 37 | chai.expect(form.dontHaveKey('test')).to.be.equal(false); |
||
| 38 | chai.expect(form.form.default.item.length).to.be.above(0); |
||
| 39 | }); |
||
| 40 | }); |
||
| 41 |