fix tests
This commit is contained in:
parent
c2cda5dfb1
commit
775deede07
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.tip().remove();
|
this.tip().remove();
|
||||||
|
this.$element.off('destroyed');
|
||||||
|
this.$element.removeData('editableContainer');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -656,33 +656,35 @@ $(function () {
|
|||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
||||||
e.click();
|
e.click();
|
||||||
var p = tip(e);
|
var p = tip(e);
|
||||||
|
|
||||||
equal(p.find('select').find('option').length, size, 'options loaded');
|
equal(p.find('select').find('option').length, size, 'options loaded');
|
||||||
equal(p.find('select').val(), e.data('editable').value, 'selected value correct') ;
|
equal(p.find('select').val(), e.data('editable').value, 'selected value correct') ;
|
||||||
|
|
||||||
p.find('.editable-cancel').click();
|
p.find('.editable-cancel').click();
|
||||||
ok(!p.is(':visible'), 'popover was closed');
|
ok(!p.is(':visible'), 'popover was closed');
|
||||||
|
|
||||||
$.mockjax({
|
$.mockjax({
|
||||||
url: 'groups1.php',
|
url: 'groups1.php',
|
||||||
responseText: {a: 1, 2: 2}
|
responseText: [{value: 'a', text: 1}, {value: 'b', text: 2}]
|
||||||
});
|
});
|
||||||
|
|
||||||
//set new source
|
//set new source
|
||||||
e.editable('option', 'source', 'groups1.php');
|
e.editable('option', 'source', 'groups1.php');
|
||||||
e.click();
|
e.click();
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
p = tip(e);
|
||||||
ok(p.find('select').length, 'select exists');
|
ok(p.find('select').length, 'select exists');
|
||||||
equal(p.find('select').find('option').length, 2, 'new options loaded');
|
equal(p.find('select').find('option').length, 2, 'new options loaded');
|
||||||
equal(p.find('select').val(), e.data('editable').value, 'selected value correct') ;
|
equal(p.find('select').val(), 'a', 'selected value correct') ;
|
||||||
p.find('.editable-cancel').click();
|
p.find('.editable-cancel').click();
|
||||||
ok(!p.is(':visible'), 'popover was closed');
|
ok(!p.is(':visible'), 'popover was closed');
|
||||||
e.remove();
|
e.remove();
|
||||||
start();
|
start();
|
||||||
}, timeout);
|
}, timeout);
|
||||||
|
|
||||||
}, timeout);
|
}, timeout);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user