null value for select not trigger source load

This commit is contained in:
vitalets
2012-12-28 17:01:39 +04:00
parent 94cee0731a
commit d56271c021
3 changed files with 46 additions and 14 deletions

@ -596,7 +596,34 @@ $(function () {
e.remove();
start();
}, timeout);
})
});
asyncTest("set value to null should not trigger source load", function () {
var req = 0;
$.mockjax({
url: 'groups-null.php',
response: function() {
req++;
}
});
var e = $('<a href="#" data-type="select" data-pk="1" data-name="name1" data-value="1" data-url="post.php" data-source="groups-null.php">11</a>').appendTo(fx).editable(),
d = e.data('editable');
e.editable('setValue', null);
setTimeout(function() {
equal(req, 0, 'no request');
equal(e.text(), d.options.emptytext, 'text correct');
equal(d.value, null, 'value correct');
e.remove();
start();
}, timeout);
});
});