fix tests

This commit is contained in:
vitalets 2013-01-11 11:10:32 +04:00
parent c2cda5dfb1
commit 775deede07
2 changed files with 23 additions and 19 deletions
src/containers
test/unit

@ -49,6 +49,8 @@
destroy: function() {
this.tip().remove();
this.$element.off('destroyed');
this.$element.removeData('editableContainer');
}
});

@ -667,7 +667,7 @@ $(function () {
$.mockjax({
url: 'groups1.php',
responseText: {a: 1, 2: 2}
responseText: [{value: 'a', text: 1}, {value: 'b', text: 2}]
});
//set new source
@ -675,14 +675,16 @@ $(function () {
e.click();
setTimeout(function() {
p = tip(e);
ok(p.find('select').length, 'select exists');
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();
ok(!p.is(':visible'), 'popover was closed');
e.remove();
start();
}, timeout);
}, timeout);
});