~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/yui/tests/simpleyui/tests/simpleyui-tests.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI.add('simpleyui-tests', function(Y) {
2
 
 
3
 
var suite = new Y.Test.Suite("simpleYUI");
4
 
 
5
 
suite.add( new Y.Test.Case({
6
 
    name: "simpleyui",
7
 
 
8
 
    "test global Y": function () {
9
 
        var global = (function () { return this; })();
10
 
 
11
 
        Y.Assert.isInstanceOf(YUI, global.Y);
12
 
    },
13
 
 
14
 
    "test module inclusion": function () {
15
 
        var global = (function () { return this; })(),
16
 
            attached = global.Y.Env._attached,
17
 
            aliases = YUI.Env.aliases,
18
 
            modules = [
19
 
                'yui-base',
20
 
                'oop',
21
 
                'dom',
22
 
                'event-custom',
23
 
                'event-base',
24
 
                'pluginhost',
25
 
                'node',
26
 
                'event-delegate',
27
 
                'io-base',
28
 
                'json-parse',
29
 
                'transition',
30
 
                'selector-css3',
31
 
                'dom-style-ie'
32
 
            ], i;
33
 
 
34
 
        // Expand aliases
35
 
        for (i = modules.length - 1; i >= 0; --i) {
36
 
            if (aliases[modules[i]]) {
37
 
                modules.splice.apply(modules, [i, 1].concat(aliases[modules[i]]));
38
 
            }
39
 
        }
40
 
 
41
 
        for (i = modules.length - 1; i >= 0; --i) {
42
 
            Y.Assert.isTrue(attached[modules[i]], modules[i]);
43
 
        }
44
 
    }
45
 
}));
46
 
 
47
 
Y.Test.Runner.add(suite);
48
 
 
49
 
 
50
 
}, '@VERSION@' ,{requires:['simpleyui', 'test']});