loader-tests.js revision 618fb4ad3b6a85d7f7bc71436ab32b1ee241210f
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.areEqual(0, out.js.length, 'JS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.areEqual(0, out.css.length, 'CSS files returned');
035e109c2dce9f6a9552f75d09b1573311d02546tweenk Assert.isTrue((out.js.length > 0), 'NO JS files returned');
47badd0035ae8c9135c51444f3770b17ae504ddaAlex Valavanis Assert.isTrue((out.css.length > 0), 'NO CSS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js.length > 0), 'NO JS files returned');
23d859f2ce09c04ed802cb4912cc9c50f512f0a2bgk Assert.isTrue((out.css.length > 0), 'NO CSS files returned');
035e109c2dce9f6a9552f75d09b1573311d02546tweenk Assert.isTrue((out.js.length === 1), 'NO JS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js.length === 1), 'NO JS files returned');
738092bcf0d040b2431137e191dfd7cf3ce3afadJohan Engelen Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js[0].indexOf('-debug') > 0), 'Debug filter did not work');
a95be1234ba4df33d6d074589edaa56f0d546069buliabyak Assert.isTrue((out.js.length === 1), 'NO JS files returned');
a95be1234ba4df33d6d074589edaa56f0d546069buliabyak Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js[0].indexOf('-min') > 0), 'Min filter did not work');
d67024fee7c560721468212767fb6aa221d5b542John Smith Assert.isTrue((out.js.length === 1), 'NO JS files returned');
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js[0].indexOf('-min') === -1), 'Raw filter did not work');
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith Assert.isTrue((out.js[0].indexOf('-debug') === -1), 'Raw filter did not work');
963f23115db07f460bdd862b957f8bd9dba88b9bgustav_b Assert.isTrue((out.js.length === 1), 'NO JS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen Assert.isTrue((out.js[0].indexOf('&') === -1), 'comboSep did not work');
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen Assert.isTrue((out.js[0].indexOf('==!!==') > 0), 'comboSep did not work');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.js.length === 1), 'NO JS files returned');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isTrue((out.css.length === 1), 'NO CSS files returned');
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith Assert.isTrue((out.js[0].indexOf('node-base-debug.js') > 0), 'node-base-debug was not found');
c67c19fc5d1f6d97cc795b5a53998434b431c641John Smith Assert.isTrue((out.js[0].indexOf('node-core-debug.js') === -1), 'node-core-debug was found');
8e7d13ca30e4b9671afc47f03dc11affd5507077Alex Valavanis Assert.isTrue(Y.Foo, 'Raw groups module did not load');
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen /* Commenting out until bug #2531436 get's completed.
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen test_module_attrs: function() {
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen var test = this;
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen 'attrs-js': {
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen fullpath: './assets/attrs.js',
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen jsAttributes: {
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen id: 'attrs-js-test'
11d3fae21261f21488c39b12b716385b5a91c847Johan Engelen 'attrs-css': {
b3722066cc416b6582d9a9a3ffc8ba2e868e102cjohanengelen fullpath: './assets/attrs.css',
607ec3f31779845d307f157ff34472da27b8bdbcjohanengelen type: 'css',
b3722066cc416b6582d9a9a3ffc8ba2e868e102cjohanengelen cssAttributes: {
b3722066cc416b6582d9a9a3ffc8ba2e868e102cjohanengelen id: 'attrs-css-test'
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen }).use('attrs-js', 'attrs-css', 'node', function(Y) {
b3722066cc416b6582d9a9a3ffc8ba2e868e102cjohanengelen test.resume(function() {
b3722066cc416b6582d9a9a3ffc8ba2e868e102cjohanengelen Assert.isTrue(Y.davglass, 'Attrs JS did not load');
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen Assert.isNotNull(Y.one('#attrs-js-test'), 'attrs-js-test id was not found');
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith Assert.isNotNull(Y.one('#attrs-css-test'), 'attrs-css-test id was not found');
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith test.wait();
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith test_iter: function() {
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm var test = this;
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm }).use('node', 'base', 'gallery-port', 'yui2-yahoo', function(Y) {
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.areEqual(Y.config.yui2, Y.YUI2.VERSION, 'Failed to load ' + Y.config.yui2);
852b4f6c7a572bc2ccbd96e80c4063a38f77153bjohanengelen Assert.isUndefined(Y.LOADED, 'Callback executed twice.');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.areEqual(Y.config.yui2, Y.YUI2.VERSION, 'Failed to load ' + Y.config.yui2);
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isObject(Y.YUI2.util.Dom, 'YUI2 DOM did not load.');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isFunction(Y.apm.TreeView, 'Treeview gallery module did not load.');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.isUndefined(Y.LOADED, 'Callback executed twice.');
c5526a2c3001be486990d816757dd5ac028b3c3fjohanengelen onProgress: function(e) {
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith if (e.name.indexOf('-ie') === -1) { //Weed out IE only modules
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.areEqual(Y.config.yui2, Y.YUI2.VERSION, 'Failed to load ' + Y.config.yui2);
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.isTrue((counter > 2), 'Did not load enough files..');
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.areSame(proContext, Y, 'onProgress context does not match');
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.isUndefined(Y.LOADED, 'Callback executed twice.');
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.isObject(Y.YUI2.util.Dom, 'YUI2 DOM did not load.');
90a3966dd44e306d23febc15ebd65cde07d7a4ddTed Gould Assert.isFunction(Y.YUI2.widget.Editor, 'YUI2 Editor did not load.');
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak Assert.isFunction(Y.bitly, 'gallery-bitly did not load.');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm test_condpattern: function() {
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm var test = this;
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm var test = this;
f0ed14f45951d21de3ff2c7c131f6aafa6e30c17buliabyak test: function() {
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen return true;
23d859f2ce09c04ed802cb4912cc9c50f512f0a2bgk Assert.isTrue(Y.COND2, 'Conditional module failed to load with test function');
0d00bc9f32167e81375a4be524572b27e2894ee4John Smith Assert.isTrue(Y.COND, 'Conditional module failed to load with no test function or UA defined');
edcba9f1706559e93aa06a7173daa6cd6516acb5Johan B. C. Engelen links = document.getElementsByTagName('link').length;
edcba9f1706559e93aa06a7173daa6cd6516acb5Johan B. C. Engelen YUI().use('cssgrids', 'dial', function(Y) {
edcba9f1706559e93aa06a7173daa6cd6516acb5Johan B. C. Engelen var links2 = document.getElementsByTagName('link').length;
edcba9f1706559e93aa06a7173daa6cd6516acb5Johan B. C. Engelen Assert.areEqual(links, links2, 'A new link tag was injected into the page.');
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm test_forcemap: function() {
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm var test = this;
fd4b29a5cdef220804dfed85fec8acb5daceec5fpjrm Assert.areEqual(loader.sorted[0], 'yui-base', 'Forced yui-base was not included in loader.sorted');
0563fd55cbad59e8a878e6d4cbbdd8e47f74488djohanengelen var suite = new Y.Test.Suite("Loader Automated Tests");