Completed
Push — master ( b89808...cd3036 )
by greg
02:02
created

form.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
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();
0 ignored issues
show
Unused Code introduced by
The variable sinonInstance seems to be never used. Consider removing it.
Loading history...
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