Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 36 lines (30 sloc) 1.03 kb
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 27 28 29 30 31 32 33 34 35
import haxe.unit.TestCase;
import haxe.unit.TestRunner;

import jQuery.JQuery;

class Test extends TestCase{
public function test1():Void {
var body = new JQuery("body");
body.addClass("myclass");
this.assertTrue(body.hasClass("myclass"));
this.assertEquals(3,body.add("html").add("title").size());
}

public function test2():Void {
var div = new JQuery("div#test2")[0];
JQuery._static.data(div, "test", { first: 16, last: "pizza!" } );
new JQuery("span:first").text(JQuery._static.data(div, "test").first);
new JQuery("span:last").text(JQuery._static.data(div, "test").last);
this.assertEquals("The values stored were 16 and pizza!",JQuery._static.trim(new JQuery(div).text()));
}

public function test3():Void {
var me = this;
var d = new Deferred().done(function () me.assertTrue(true));
d.resolve();
}

static public function main():Void {
new JQuery(function():Void{
var runner = new TestRunner();
runner.add(new Test());
runner.run();
});
}
}
Something went wrong with that request. Please try again.