event-key-tests.js revision b839e41217a63e244d65c3aadf54feec82ddd179
if (typeof code === "string") {
}
if (type) {
} else {
}
};
function setUp() {
body;
if (!testbed) {
}
'<ul id="items">' +
'<li id="item1">' +
'<div id="div1"><input type="text" id="text1" name="text1"></div>' +
'</li>' +
'<li id="item2">' +
'<div id="div2"><input type="text" id="text2" name="text2"></div>' +
'</li>' +
'<li id="item3">' +
'<div id="div3"><textarea id="area1" name="area1"></textarea></div>' +
'</li>' +
'</ul>');
}
function tearDown() {
if (testbed) {
}
}
name: "node.on('key',...)",
"test node.on('key', fn, '65')": function () {
thisObj = this;
}, '65');
},
"test node.on('key', fn, '65', thisObj)": function () {
thisObj = this;
}, '65', obj);
},
"test node.on('key', fn, '65', thisObj, args)": function () {
thisObj = this;
arg = x;
}
}));
name: "nodelist.on('key',...)",
"test nodelist.on('key', fn, '65')": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [];
}, '65');
// Synth infrastructure iterates nodelist input for individual
// subscription for each node, so 'this' is not the nodelist as
// it is with nodelist.on('click');
//Y.ArrayAssert.itemsAreSame([inputs, inputs], thisObj);
},
"test nodelist.on('key', fn, '65', thisObj)": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [];
}, '65', obj);
},
"test nodelist.on('key', fn, '65', thisObj, args)": function () {
target = [],
type = [],
currentTarget = [],
keyCode = [],
thisObj = [],
arg = [];
}
}));
name: "Y.on('key',...)",
"test Y.on('key', fn, '65', selector)": function () {
Y.on("key", function (e) {
thisObj = this;
}, '65', '#text1');
},
"test Y.on('key', fn, '65', node)": function () {
Y.on("key", function (e) {
thisObj = this;
}, '65', input);
},
"test Y.on('key', fn, '65', selector, thisObj)": function () {
Y.on("key", function (e) {
thisObj = this;
},
"test Y.on('key', fn, '65', selector, thisObj, args)": function () {
Y.on("key", function (e, x) {
thisObj = this;
arg = x;
}
}));
name: "node.delegate('key',...)",
"test node.delegate('key', fn, '65', filter)": function () {
},
"test node.delegate('key', fn, '65', filter, thisObj)": function () {
},
"test node.delegate('key', fn, '65', filter, thisObj, args)": function () {
}
}));
name: "Y.delegate('key',...)",
"test Y.delegate('key', fn, '65', node, filter)": function () {
},
"test Y.delegate('key', fn, '65', selector, filter)": function () {
},
"test Y.delegate('key', fn, '65', selector, filter, thisObj)": function () {
},
"test Y.delegate('key', fn, '65', selector, filter, thisObj, args)": function () {
}
}));
"test 'down:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'up:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'press:65'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'down:a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'up:a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'press:a'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'A'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'enter', 'esc', 'backspace', 'tab', 'pageup', 'pagedown'": function () {
count = 0,
map = {
enter : 13,
esc : 27,
backspace: 8,
tab : 9,
pageup : 33,
pagedown : 34
};
function inc() {
count++;
}
count = 0;
// default for named keys is keydown
});
},
"test 'a,b'": function () {
count = 0;
function inc() {
count++;
}
},
"test '65,b,esc'": function () {
count = 0;
function inc() {
count++;
}
// FIXME: unrealistic test, since esc doesn't fire keypress (does it?)
// FIXME: this should be the line that increments count
},
"test 'unknownKeyName'": function () {
count = 0;
function inc() {
count++;
}
// Uses first character
},
"test '65,unknownKeyName'": function () {
},
"test '65,unknownKeyName+alt'": function () {
},
"test 'press:a,b'": function () {
},
"test 'a+shift'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'enter+ctrl'": function () {
count = 0;
function inc() {
count++;
}
},
"test 'up:a+alt'": function () {
},
"test 'a,b+shift+meta'": function () {
count = 0;
function inc() {
count++;
}
}
}));
name: "detach",
"test node.on() + node.detach()": function () {
},
"test Y.on() + node.detach()": function () {
},
"test node.on() + handle.detach()": function () {
},
"test node.on('cat|key',...) + node.detach('cat|...')": function () {
},
"test node.delegate() + node.detach()": function () {
},
"test node.delegate() + handle.detach()": function () {
}
}));