Skip to content

Commit

Permalink
add a test for undefined that also needs to unwrap the observable
Browse files Browse the repository at this point in the history
  • Loading branch information
rniemeyer committed Jun 11, 2013
1 parent 7941d32 commit 67c04ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/defaultBindings/optionsBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ describe('Binding: Options', function() {
expect(testNode.childNodes[0]).toHaveTexts(['A', 'B']);
});

it('Should not include the caption if the optionsCaption value is undefined', function() {
testNode.innerHTML = "<select data-bind='options: [\"A\", \"B\"], optionsCaption: test'></select>";
ko.applyBindings({ test: ko.observable() }, testNode);
expect(testNode.childNodes[0]).toHaveTexts(['A', 'B']);
});

it('Should include a caption even if it\'s blank', function() {
testNode.innerHTML = "<select data-bind='options: [\"A\",\"B\"], optionsCaption: \"\"'></select>";
ko.applyBindings({}, testNode);
Expand Down

0 comments on commit 67c04ed

Please sign in to comment.