Remove check for invalid return, update spec

Remove a check for an invalid return value, update the spec to
return the proper value.  Also updated the subscribe method
to fetch defaults the same as the request method.

https://github.com/nasa/openmct/pull/1544
This commit is contained in:
Pete Richards 2017-04-27 13:43:54 -07:00
parent 26e13a6cd0
commit fce8f13984
2 changed files with 5 additions and 7 deletions

View File

@ -212,10 +212,8 @@ define(
var telemetryAPI = this.openmct.telemetry;
var metadata = telemetryAPI.getMetadata(domainObject);
var domainMetadata = metadata.valuesForHints(['x'])[0] || {};
var rangeMetadata = metadata.valuesForHints(['y'])[0] || {};
var defaultDomain = domainMetadata.source || domainMetadata.key;
var defaultRange = rangeMetadata.source || rangeMetadata.key;
var defaultDomain = metadata.valuesForHints(['x'])[0].source;
var defaultRange = metadata.valuesForHints(['y'])[0].source;
var isLegacyProvider = telemetryAPI.findRequestProvider(domainObject) ===
telemetryAPI.legacyProvider;
@ -276,8 +274,8 @@ define(
var telemetryAPI = this.openmct.telemetry;
var metadata = telemetryAPI.getMetadata(domainObject);
var defaultDomain = (metadata.valuesForHints(['domain'])[0] || {}).key;
var defaultRange = (metadata.valuesForHints(['range'])[0] || {}).key;
var defaultDomain = metadata.valuesForHints(['x'])[0].source;
var defaultRange = metadata.valuesForHints(['y'])[0].source;
var isLegacyProvider = telemetryAPI.findSubscriptionProvider(domainObject) ===
telemetryAPI.legacyProvider;

View File

@ -92,7 +92,7 @@ define(
]);
mockTelemetryAPI.getMetadata.andReturn({
valuesForHints: function () {
return [];
return [{}];
}
});