Skip to content

Commit

Permalink
Merge pull request #656 from bnordli/issue-655
Browse files Browse the repository at this point in the history
Fix for #655
  • Loading branch information
einari committed Jun 12, 2015
2 parents 07c24b2 + 02f73cf commit 05aeb03
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<Content Include="markup\for_ObjectModelElementVisitor\given\an_object_model_element_visitor.js" />
<Content Include="markup\for_ObjectModelElementVisitor\when_visiting_custom_element.js" />
<Content Include="navigation\for_NavigationFrame\when_setting_container_and_no_mapping_for_url.js" />
<Content Include="read\for_Query\when_asking_if_all_parameters_are_set_and_one_observable_parameter_is_not_set.js" />
<Content Include="specifications\for_Or\when_both_sides_are_not_satisfied.js" />
<Content Include="specifications\for_Or\when_both_sides_are_not_satisfied_but_left_becomes_satisfied.js" />
<Content Include="specifications\for_Or\when_both_sides_are_not_satisfied_but_right_becomes_satisfied.js" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
describe("when asking if all parameters are set and one observable parameter is not set", function () {

var queryType = Bifrost.read.Query.extend(function () {
var self = this;

this.firstParameter = ko.observable(1);
this.secondParameter = ko.observable(ko.observable());
});

var queryableFactory = {};
var region = {};

var instance = queryType.create({
queryableFactory: queryableFactory,
region: region
});
var result = instance.areAllParametersSet();

it("should return false", function () {
expect(result).toBe(false);
});
});
2 changes: 1 addition & 1 deletion Source/Bifrost.JavaScript/Bifrost.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -5862,7 +5862,7 @@ Bifrost.namespace("Bifrost.read", {
for (var property in self.target) {
if (ko.isObservable(self.target[property]) === true) {
hasParameters = true;
var value = self.target[property]();
var value = ko.unwrap(self.target[property]());
if (typeof value === "undefined" || value === null) {
isSet = false;
break;
Expand Down
2 changes: 1 addition & 1 deletion Source/Bifrost.JavaScript/read/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
for (var property in self.target) {
if (ko.isObservable(self.target[property]) === true) {
hasParameters = true;
var value = self.target[property]();
var value = ko.unwrap(self.target[property]());
if (typeof value === "undefined" || value === null) {
isSet = false;
break;
Expand Down

0 comments on commit 05aeb03

Please sign in to comment.