mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[Time] Handle missing time system gracefully
When loading the application and no time system is set, the url handler should not cause multiple errors to be logged. This adds a test for the case but does not specify the expected behavior in detail, other than "it should not crash." Fixes bugs as reported here.
This commit is contained in:
parent
34c3763421
commit
4571205871
@ -107,7 +107,9 @@ define([
|
||||
}
|
||||
this.last = params;
|
||||
|
||||
if (params.clock === 'fixed' && params.bounds) {
|
||||
if (!params.timeSystem) {
|
||||
this.updateQueryParams();
|
||||
} else if (params.clock === 'fixed' && params.bounds) {
|
||||
if (!this.time.timeSystem() ||
|
||||
this.time.timeSystem().key !== params.timeSystem) {
|
||||
|
||||
|
@ -132,6 +132,20 @@ define([
|
||||
};
|
||||
});
|
||||
|
||||
it("initializes with missing time system", function () {
|
||||
// This handles an odd transitory case where a url does not include
|
||||
// a timeSystem. It's generally only experienced by those who
|
||||
// based their code on the tutorial before it specified a time
|
||||
// system.
|
||||
search['tc.mode'] = 'clockA';
|
||||
search['tc.timeSystem'] = undefined;
|
||||
search['tc.startDelta'] = '123';
|
||||
search['tc.endDelta'] = '456';
|
||||
|
||||
// We don't specify behavior right now other than "don't break."
|
||||
expect(initialize).not.toThrow();
|
||||
});
|
||||
|
||||
it("can initalize fixed mode from location", function () {
|
||||
search['tc.mode'] = 'fixed';
|
||||
search['tc.timeSystem'] = 'timeSystemA';
|
||||
|
Loading…
Reference in New Issue
Block a user