mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 16:36:13 +00:00
[Forms] Add test for date-time controller
Add test case to complete coverage of date-time controller; done in the context of WTD-884 (albeit unrelated) to improve code coverage.
This commit is contained in:
parent
d7e43026cd
commit
fd63aa30ea
@ -84,6 +84,22 @@ define(
|
|||||||
// Should have cleared out the time stamp
|
// Should have cleared out the time stamp
|
||||||
expect(mockScope.ngModel.test).toBeUndefined();
|
expect(mockScope.ngModel.test).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("initializes form fields with values from ng-model", function () {
|
||||||
|
mockScope.ngModel = { test: 1417215313000 };
|
||||||
|
mockScope.field = "test";
|
||||||
|
mockScope.$watch.calls.forEach(function (call) {
|
||||||
|
if (call.args[0] === 'ngModel[field]') {
|
||||||
|
call.args[1](mockScope.ngModel.test);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
expect(mockScope.datetime).toEqual({
|
||||||
|
date: "2014-332",
|
||||||
|
hour: "22",
|
||||||
|
min: "55",
|
||||||
|
sec: "13"
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user