mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Fix a lot eslint errors.
This commit is contained in:
parent
0c6143704a
commit
39ea94daa8
88 changed files with 3872 additions and 4930 deletions
|
@ -1,129 +1,106 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
describe('view', function () {
|
||||
|
||||
before(function () {
|
||||
|
||||
this.configBackup = modulejs._private.definitions.config;
|
||||
this.storeKey = '_h5ai';
|
||||
this.xConfig = {
|
||||
setup: {
|
||||
PUBLIC_HREF: uniq.path('-PUBLIC/'),
|
||||
ROOT_HREF: uniq.path('-ROOT/')
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
after(function () {
|
||||
|
||||
modulejs._private.definitions.config = this.configBackup;
|
||||
util.clearModulejs();
|
||||
util.restoreHtml();
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
|
||||
delete modulejs._private.definitions.config;
|
||||
modulejs.define('config', this.xConfig);
|
||||
util.clearModulejs();
|
||||
util.restoreHtml();
|
||||
$('<div id="fallback"/>').appendTo('body');
|
||||
$('<div id="fallback-hints"/>').appendTo('body');
|
||||
});
|
||||
|
||||
describe('requiring \'view/viewmode\' sets up basic HTML', function () {
|
||||
|
||||
it('runs without errors', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
describe('view', function () {
|
||||
before(function () {
|
||||
this.configBackup = modulejs._private.definitions.config;
|
||||
this.storeKey = '_h5ai';
|
||||
this.xConfig = {
|
||||
setup: {
|
||||
PUBLIC_HREF: uniq.path('-PUBLIC/'),
|
||||
ROOT_HREF: uniq.path('-ROOT/')
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
it('adds id root to body', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.strictEqual($('body').attr('id'), 'root');
|
||||
after(function () {
|
||||
modulejs._private.definitions.config = this.configBackup;
|
||||
util.clearModulejs();
|
||||
util.restoreHtml();
|
||||
});
|
||||
|
||||
it('removes HTML #fallback', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#fallback'), 0);
|
||||
beforeEach(function () {
|
||||
delete modulejs._private.definitions.config;
|
||||
modulejs.define('config', this.xConfig);
|
||||
util.clearModulejs();
|
||||
util.restoreHtml();
|
||||
$('<div id="fallback"/>').appendTo('body');
|
||||
$('<div id="fallback-hints"/>').appendTo('body');
|
||||
});
|
||||
|
||||
it('removes HTML #fallback-hints', function () {
|
||||
describe('requiring \'view/viewmode\' sets up basic HTML', function () {
|
||||
it('runs without errors', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#fallback-hints'), 0);
|
||||
});
|
||||
it('adds id root to body', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.strictEqual($('body').attr('id'), 'root');
|
||||
});
|
||||
|
||||
it('adds HTML #mainrow to #root', function () {
|
||||
it('removes HTML #fallback', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#fallback'), 0);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#root > #mainrow'), 1);
|
||||
});
|
||||
it('removes HTML #fallback-hints', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#fallback-hints'), 0);
|
||||
});
|
||||
|
||||
it('adds HTML #content to #mainrow', function () {
|
||||
it('adds HTML #mainrow to #root', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#root > #mainrow'), 1);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#mainrow > #content'), 1);
|
||||
});
|
||||
it('adds HTML #content to #mainrow', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#mainrow > #content'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #view to #content', function () {
|
||||
it('adds HTML #view to #content', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#content > #view'), 1);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#content > #view'), 1);
|
||||
});
|
||||
it('adds HTML #items to #view', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#view > #items'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #items to #view', function () {
|
||||
it('adds HTML #topbar to #root', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#root > #topbar'), 1);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#view > #items'), 1);
|
||||
});
|
||||
it('adds HTML #toolbar to #topbar', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #toolbar'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #topbar to #root', function () {
|
||||
it('adds HTML #flowbar to #topbar', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #flowbar'), 1);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#root > #topbar'), 1);
|
||||
});
|
||||
it('adds HTML #backlink to #topbar', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #backlink'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #toolbar to #topbar', function () {
|
||||
it('adds HTML #sidebar-toggle to #toolbar', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#toolbar > #sidebar-toggle'), 1);
|
||||
});
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #toolbar'), 1);
|
||||
});
|
||||
it('adds HTML #viewmode-settings to #sidebar', function () {
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#sidebar > #viewmode-settings'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #flowbar to #topbar', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #flowbar'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #backlink to #topbar', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#topbar > #backlink'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #sidebar-toggle to #toolbar', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#toolbar > #sidebar-toggle'), 1);
|
||||
});
|
||||
|
||||
it('adds HTML #viewmode-settings to #sidebar', function () {
|
||||
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('#sidebar > #viewmode-settings'), 1);
|
||||
});
|
||||
|
||||
it('adds style to head', function () {
|
||||
|
||||
var styleTagCount = $('head > style').length;
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('head > style'), styleTagCount + 1);
|
||||
it('adds style to head', function () {
|
||||
var styleTagCount = $('head > style').length;
|
||||
modulejs.require('view/viewmode');
|
||||
assert.lengthOf($('head > style'), styleTagCount + 1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue