File: yuitests.js

package info (click to toggle)
strophejs 1.0.1.dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 924 kB
  • ctags: 249
  • sloc: python: 174; makefile: 11; xml: 6
file content (26 lines) | stat: -rw-r--r-- 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
YUI().use("test", "console", function (Y) {
    Y.namespace("strophe.test");
    var Assert = Y.Assert;

    Y.strophe.test.JIDTestCase = new Y.Test.Case({
        name: "JIDs",

        testNormalJid: function () {
            var jid = "darcy@pemberley.lit/library";

            Assert.areSame("darcy", Strophe.getNodeFromJid(jid));
            Assert.areSame("pemberley.lit", Strophe.getDomainFromJid(jid));
            Assert.areSame("library", Strophe.getResourceFromJid(jid));
            Assert.areSame("darcy@pemberley.lit",
                           Strophe.getBareJidFromJid(jid));
        }
    });

    Y.strophe.test.StropheSuite = new Y.Test.Suite("Strophe Suite");
    Y.strophe.test.StropheSuite.add(Y.strophe.test.JIDTestCase);

    new Y.Console({newestOnTop: false}).render('#console');

    Y.Test.Runner.add(Y.strophe.test.StropheSuite);
    Y.Test.Runner.run();
});