[Capabilities] Avoid erroneous logging

Fix logic error which caused an inaccurate warning to
be logged when capabilities are overridden by priority.
Addresses #49.
This commit is contained in:
Victor Woeltjen
2015-09-11 11:38:22 -07:00
parent 426ab44d93
commit f17410a85b
2 changed files with 16 additions and 3 deletions

View File

@@ -86,7 +86,19 @@ define(
expect(mockLog.warn).not.toHaveBeenCalled();
});
it("prefers higher-priority capability", function () {
KeylessCapability.key = BasicCapability.key;
expect(provider.getCapabilities({}).basic)
.toEqual(BasicCapability);
});
// https://github.com/nasa/openmctweb/issues/49
it("does not log a warning for multiple capabilities with the same key", function () {
KeylessCapability.key = BasicCapability.key;
provider.getCapabilities({});
expect(mockLog.warn).not.toHaveBeenCalled();
});
});
}
);
);