Skip to content

Commit

Permalink
Fix for knockout#562, value binding should always write when triggere…
Browse files Browse the repository at this point in the history
…d. (fix error in last minute variable name change).
  • Loading branch information
rniemeyer committed Sep 14, 2012
1 parent 4fe4f0f commit 9125570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/defaultBindings/valueBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ describe('Binding: Value', {
testNode.childNodes[0].value = "1234";
ko.utils.triggerEvent(testNode.childNodes[0], "change");
value_of(validValue()).should_be("1234");
value_of(valid()).should_be(true);
value_of(isValid()).should_be(true);

//set to an invalid value
testNode.childNodes[0].value = "1234a";
ko.utils.triggerEvent(testNode.childNodes[0], "change");
value_of(validValue()).should_be("1234");
value_of(valid()).should_be(false);
value_of(isValid()).should_be(false);

//set to a valid value where the current value of the writeable computed is the same as the written value
testNode.childNodes[0].value = "1234";
ko.utils.triggerEvent(testNode.childNodes[0], "change");
value_of(validValue()).should_be("1234");
value_of(valid()).should_be(true);
value_of(isValid()).should_be(true);
},

'For non-observable property values, should catch the node\'s onchange and write values back to the property': function () {
Expand Down

0 comments on commit 9125570

Please sign in to comment.