Issues (791)

test/file-attr.js (4 issues)

1
var chai = require('chai');
2
var path = require('path');
3
4
var config = require('../src/cli').config
5
config.set({root: path.join(__dirname,'fixtures')})
6
7
var cmsData = require('../src/cli').cmsData;
8
var Manager = require('../src/cli').Manager;
9
var fse = require('fs-extra');
10
11
describe('fileAttr', function() {
12
  before( function(done) {
13
    Manager.instance.init()
14
      .then(function () {
15
        Manager.instance._whereKeys = ['title', 'priority', 'abe_meta', 'articles']
16
        Manager.instance.updateList()
17
18
        this.fixture = {
19
          jsonDraft: fse.readJsonSync(__dirname + '/fixtures/data/article-1-abe-d20160919T125255138Z.json')
0 ignored issues
show
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
20
        }
21
        done()
22
        
23
      }.bind(this))
24
  });
25
  
26
  /**
27
   * cmsData.fileAttr.test
28
   * 
29
   */
30
  it('cmsData.fileAttr.test()', function() {
31
    var bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
32
    chai.expect(bool).to.be.true;
0 ignored issues
show
The result of the property access to chai.expect(bool).to.be.true is not used.
Loading history...
33
    bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.link)
34
    chai.expect(bool).to.be.false;
0 ignored issues
show
The result of the property access to chai.expect(bool).to.be.false is not used.
Loading history...
35
  });
36
37
  /**
38
   * cmsData.fileAttr.delete
39
   * 
40
   */
41
  it('cmsData.fileAttr.delete()', function() {
42
  	var str = cmsData.fileAttr.delete(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
43
    var bool = cmsData.fileAttr.test(str)
44
    chai.expect(bool).to.be.false;
0 ignored issues
show
The result of the property access to chai.expect(bool).to.be.false is not used.
Loading history...
45
  });
46
});
47