diff --git a/platform/forms/test/controllers/DateTimeControllerSpec.js b/platform/forms/test/controllers/DateTimeControllerSpec.js index 11c97ada07..230d6a7a33 100644 --- a/platform/forms/test/controllers/DateTimeControllerSpec.js +++ b/platform/forms/test/controllers/DateTimeControllerSpec.js @@ -84,6 +84,22 @@ define( // Should have cleared out the time stamp 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" + }); + }); }); } -); \ No newline at end of file +);