mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 12:07:10 -04:00
Clean code.
This commit is contained in:
parent
c396800dfa
commit
882bf8ae11
17 changed files with 202 additions and 148 deletions
|
@ -16,7 +16,7 @@ describe('module "' + ID + '"', function () {
|
|||
b: 'myTheme/b.jpg'
|
||||
}
|
||||
};
|
||||
this.xSettings = {appHref: '/some/app/href/'};
|
||||
this.xSettings = {appHref: util.uniqPath('/appHref/')};
|
||||
this.applyFn = function () {
|
||||
|
||||
return this.definition.fn(_, this.xConfig, this.xSettings);
|
||||
|
@ -66,21 +66,15 @@ describe('module "' + ID + '"', function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe('publics', function () {
|
||||
describe('.image()', function () {
|
||||
|
||||
it('.image() is function', function () {
|
||||
it('is function', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
assert.isFunction(instance.image);
|
||||
});
|
||||
|
||||
it('.icon() is function', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
assert.isFunction(instance.icon);
|
||||
});
|
||||
|
||||
it('.image() works', function () {
|
||||
it('works', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
var ui = this.xSettings.appHref + 'client/images/ui/';
|
||||
|
@ -90,8 +84,17 @@ describe('module "' + ID + '"', function () {
|
|||
assert.strictEqual(instance.image(''), ui + '.svg');
|
||||
assert.strictEqual(instance.image('a'), ui + 'a.svg');
|
||||
});
|
||||
});
|
||||
|
||||
it('.icon() works', function () {
|
||||
describe('.icon()', function () {
|
||||
|
||||
it('is function', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
assert.isFunction(instance.icon);
|
||||
});
|
||||
|
||||
it('works', function () {
|
||||
|
||||
var instance = this.applyFn();
|
||||
var themes = this.xSettings.appHref + 'client/images/themes/';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue