url param for testing with different version jquery

This commit is contained in:
vitalets
2012-12-06 13:02:36 +04:00
parent a33c337567
commit 9d7b75d3d5
10 changed files with 50 additions and 11598 deletions

@ -68,43 +68,7 @@ $(function () {
ok(!('dob' in values), 'date value not present') ;
});
/*
//deprecated in 2.0
asyncTest("'update' event", function () {
expect(2);
var e = $('<a href="#" data-pk="1" data-url="post.php" data-name="text1">abc</a>').appendTo(fx).editable(),
e_nopk = $('<a href="#" data-url="post.php" data-name="text1">abc</a>').appendTo(fx).editable(),
newVal = 'xyt';
e.on('update', function() {
equal($(this).data('editable').value, newVal, 'triggered update after submit');
});
e_nopk.on('update', function() {
equal($(this).data('editable').value, newVal, 'triggered update after no-submit');
});
e_nopk.click();
var p = e_nopk.data('popover').$tip;
p.find('input').val(newVal);
p.find('form').submit();
e.click();
p = tip(e);
p.find('input').val(newVal);
p.find('form').submit();
setTimeout(function() {
e.remove();
e_nopk.remove();
start();
}, timeout);
});
*/
/*
//deprecated in 2.0
test("'init' event", function () {
test("'init' event", function () {
expect(1);
var e = $('<a href="#" data-pk="1" data-url="post.php" data-name="text1">abc</a>').appendTo('#qunit-fixture');
@ -113,71 +77,8 @@ $(function () {
});
e.editable();
});
*/
asyncTest("'render' event for text", function () {
expect(4);
var val = 'afas',
e = $('<a href="#" data-pk="1" data-type="text" data-url="post.php" data-name="text1">'+val+'</a>').appendTo(fx),
isInit = true;
e.on('render', function(e, editable) {
equal(editable.isInit, isInit, 'isInit flag correct');
equal(editable.value, val, 'value correct');
});
e.editable();
isInit = false;
val = '123';
e.click();
var p = tip(e);
p.find('input[type=text]').val(val);
p.find('form').submit();
setTimeout(function() {
e.remove();
start();
}, timeout);
});
asyncTest("'render' event for select", function () {
expect(4);
var val = '1',
e = $('<a href="#" data-pk="1" data-type="select" data-url="post.php" data-name="text1" data-value="'+val+'"></a>').appendTo(fx),
isInit = true;
e.on('render', function(e, editable) {
equal(editable.isInit, isInit, 'isInit flag correct');
equal(editable.value, val, 'init triggered, value correct');
});
e.editable({
source: 'groups.php',
autotext: 'always'
});
setTimeout(function() {
isInit = false;
val = '3';
e.click();
var p = tip(e);
p.find('select').val(val);
p.find('form').submit();
setTimeout(function() {
e.remove();
start();
}, timeout);
}, timeout);
});
});
asyncTest("events: shown / cancel / hidden", function () {
expect(3);
var val = '1',

@ -445,40 +445,5 @@
start();
}, timeout);
});
//unfortunatly, testing this feature does not always work in browsers. Tested manually.
/*
test("enablefocus option", function () {
// focusing not passed in phantomjs
if($.browser.webkit) {
ok(true, 'skipped in PhantomJS');
return;
}
var e = $('<a href="#">abc</a>').appendTo('#qunit-fixture').editable({
enablefocus: true
}),
e1 = $('<a href="#">abcd</a>').appendTo('#qunit-fixture').editable({
enablefocus: false
});
e.click()
var p = tip(e);
ok(p.is(':visible'), 'popover 1 visible');
p.find('button[type=button]').click();
ok(!p.is(':visible'), 'popover closed');
ok(e.is(':focus'), 'element 1 is focused');
e1.click()
p = tip(e1);
ok(p.is(':visible'), 'popover 2 visible');
p.find('button[type=button]').click();
ok(!p.is(':visible'), 'popover closed');
ok(!e1.is(':focus'), 'element 2 is not focused');
});
*/
}(jQuery));