Skip to content

Commit

Permalink
UT: test locale & editor
Browse files Browse the repository at this point in the history
  • Loading branch information
wonknu committed Nov 25, 2016
1 parent 9ff28a8 commit a86fb08
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
13 changes: 12 additions & 1 deletion test/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import data from './fixtures/editor/index'
describe('Editor', function() {

/**
* cmsData.fileAttr.test
* cmsEditor.printInput
*
*/
it('cmsEditor.printInput()', function() {
Expand Down Expand Up @@ -48,4 +48,15 @@ describe('Editor', function() {
this.sinon.restore()
});

/**
* cmsEditor.folders
*
*/
it('cmsEditor.folders()', function() {
var result = cmsEditor.folders([{path: ''}], 1, null, {'level-1': 'my wording'})
var wordingExist = result.indexOf('my wording')
chai.expect(result).to.be.a('string')
chai.expect(wordingExist).to.equal(110)
});

});
3 changes: 2 additions & 1 deletion test/fixtures/abe.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
],
"upload": {
"image": "unitimage"
}
},
"siteLocaleFolder": "locales"
}
3 changes: 3 additions & 0 deletions test/fixtures/locales/en-US/some-locales.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"word": "a word"
}
21 changes: 21 additions & 0 deletions test/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var chai = require('chai');
var path = require('path');

var config = require('../src/cli').config
config.set({root: path.join(__dirname, 'fixtures')})

import locale from '../src/server/helpers/abe-locale'

describe('locale', function() {

/**
* locale
*
*/
it('locale', function() {
chai.expect(locale).to.have.property('word')
chai.expect(locale.word).to.be.a('string')
chai.expect(locale.word).to.equal('a word')
});

});

0 comments on commit a86fb08

Please sign in to comment.