loader-tests.js revision 9d911d4da4d1fb669a022e9e86b4ba7fa62bd2f3
name: "Loader Tests",
test_resolve_no_calc: function() {
ignoreRegistered: true,
});
},
test_resolve_manual_calc: function() {
ignoreRegistered: true,
});
},
test_resolve_auto_calc: function() {
ignoreRegistered: true,
});
},
test_resolve_combo: function() {
combine: true,
ignoreRegistered: true,
});
},
test_resolve_filter_debug: function() {
filter: 'debug',
combine: true,
ignoreRegistered: true,
});
},
test_resolve_filter_min: function() {
filter: 'min',
combine: true,
ignoreRegistered: true,
});
},
test_resolve_filter_raw: function() {
filter: 'raw',
combine: true,
ignoreRegistered: true,
});
},
test_resolve_combo_sep: function() {
comboSep: '==!!==',
combine: true,
ignoreRegistered: true,
});
},
test_resolve_combo_sep_group: function() {
comboSep: '==!!==',
combine: true,
ignoreRegistered: true,
require: ['foo'],
groups: {
extra: {
combine: true,
comboSep: '==;;==',
root: '',
base: '',
modules: {
foo: {
},
bar: {
requires: ['dd']
}
}
}
}
});
},
test_resolve_maxurl_length: function() {
maxURLLength: 1024,
combine: true,
ignoreRegistered: true,
});
},
test_resolve_maxurl_length_higher: function() {
maxURLLength: 8024,
combine: true,
ignoreRegistered: true,
});
},
test_resolve_maxurl_length_too_low: function() {
maxURLLength: 14,
combine: true,
ignoreRegistered: true,
require: ['oop']
});
},
test_resolve_maxurl_length_group: function() {
combine: true,
ignoreRegistered: true,
require: ['foo'],
groups: {
extra: {
combine: true,
maxURLLength: 45,
root: '',
base: '',
modules: {
foo: {
},
bar: {
requires: ['dd']
}
}
}
}
});
},
test_resolve_filters: function() {
combine: true,
ignoreRegistered: true,
});
},
test_group_filters: function() {
var test = this;
YUI({
debug: true,
filter: 'DEBUG',
groups: {
local: {
filter: 'raw',
combine: false,
base: './assets/',
modules: {
foo: {
}
}
}
}
}).use('foo', function(Y) {
});
});
},
/* Commenting out until bug #2531436 get's completed.
test_module_attrs: function() {
var test = this;
YUI({
modules: {
'attrs-js': {
jsAttributes: {
id: 'attrs-js-test'
}
},
'attrs-css': {
type: 'css',
cssAttributes: {
id: 'attrs-css-test'
}
}
}
}).use('attrs-js', 'attrs-css', 'node', function(Y) {
test.resume(function() {
Assert.isTrue(Y.davglass, 'Attrs JS did not load');
Assert.isNotNull(Y.one('#attrs-js-test'), 'attrs-js-test id was not found');
Assert.isNotNull(Y.one('#attrs-css-test'), 'attrs-css-test id was not found');
});
});
test.wait();
},
*/
test_iter: function() {
var test = this;
YUI({
filter: 'debug',
gallery: 'gallery-2010.08.04-19-46',
'2in3': '4',
'yui2': '2.9.0'
Y.LOADED = true;
});
YUI({
filter: 'debug',
gallery: 'gallery-2010.08.04-19-46',
'2in3': '4',
'yui2': '2.9.0'
Y.LOADED = true;
});
});
},
test_progress: function() {
var test = this,
counter = 0;
YUI({
'2in3': '4',
'yui2': '2.9.0',
onProgress: function(e) {
proContext = this;
counter++;
}
},
Y.LOADED = true;
});
});
},
test_condpattern: function() {
var test = this;
YUI({
groups: {
testpatterns: {
patterns: {
modtest: {
return (mname === 'mod')
},
}
}
}
}
}
}).use('mod', function(Y) {
});
});
},
test_cond_with_test_function: function() {
var test = this;
YUI({
modules: {
cond2: {
condition: {
trigger: 'jsonp',
test: function() {
return true;
}
}
}
}
}).use('jsonp', function(Y) {
});
});
},
test_cond_no_test_or_ua: function() {
var test = this;
YUI({
modules: {
cond: {
condition: {
trigger: 'yql'
}
}
}
}).use('yql', function(Y) {
});
});
},
test_css_stamp: function() {
var test = this,
links = document.getElementsByTagName('link').length + document.getElementsByTagName('style').length;
var links2 = document.getElementsByTagName('link').length + document.getElementsByTagName('style').length;
});
});
},
test_forcemap: function() {
var test = this;
ignoreRegistered: true,
force : ['yui-base'],
require : ['json']
});
},
test_global_mods: function() {
var conf = {
combine: false,
require: ['widget-base'],
ignoreRegistered: true // force loader to include modules already on the page
},
Assert.areEqual(mods1.css.length, mods2.css.length, 'CSS Modules are not equal in 2 loader instances');
},
test_skin_default: function() {
Assert.areSame(loader.skin.defaultSkin, Y.Env.meta.skin.defaultSkin, 'Default skin was not set from default');
},
test_skin_string: function() {
skin: 'night'
});
},
test_skin_object: function() {
skin: {
defaultSkin: 'foobar'
}
});
},
test_outside_group: function() {
combine: true,
ignoreRegistered: true,
require: [ 'gallery-calendar' ],
groups: {
mygallery: {
base:'./js/yui-library/',
combine:true,
comboBase: '/yui/?',
root:'yui-library/',
modules: {
'gallery-calendar':{
}
}
},
outside: {
combine:false,
modules:{
'calendar-skin': {
fullpath: '/css/calendar-skin.css',
type:'css'
}
}
}
}
});
},
test_outside_nocombine: function() {
combine: false,
ignoreRegistered: true,
require: [ 'gallery-calendar' ],
groups: {
mygallery: {
base:'./js/yui-library/',
combine:true,
comboBase: '/yui/?',
root:'yui-library/',
modules: {
'gallery-calendar':{
requires: [ 'gallery-calendar2' ]
},
'gallery-calendar2':{
requires: [ 'gallery-calendar3' ]
},
'gallery-calendar3':{
}
}
}
}
});
}
});
});