1
suite = new Y.Test.Suite("Node as EventTarget, and NodeList API");
3
suite.add(new Y.Test.Case({
4
name: "node as EventTarget"
11
suite.add(new Y.Test.Case({
12
name: "nodelist.on once, onceAfter, detach, detachAll, etc"
16
suite.add(new Y.Test.Case({
19
test_node_publish: function() {
20
var node = Y.one('#adiv');
22
var preventCount = 0, heard = 0;
23
node.publish('foo1', {
25
// should only be called once
26
preventedFn: function() {
28
Y.Assert.isTrue(this instanceof Y.Node);
32
node.on('foo1', function(e) {
33
Y.Assert.areEqual('faking foo', e.type);
34
Y.Assert.areEqual('foo1', e._type);
39
node.on('foo1', function(e) {
48
Y.Assert.areEqual(1, preventCount);
49
Y.Assert.areEqual(2, heard);
53
Y.Test.Runner.add(suite);