[Time Conductor] Update spec

Verify that validation occurs against state in formModel;
remove obsolete test case for enforcing minimum outer span
This commit is contained in:
Victor Woeltjen 2016-01-11 18:28:44 -08:00
parent bb993dc94f
commit 3b5c1bf2e6

View File

@ -93,7 +93,7 @@ define(
it("exposes start time validator", function () {
var testValue = 42000000;
mockScope.ngModel.outer = { end: testValue };
mockScope.formModel = { end: testValue };
expect(mockScope.validateStart(testValue + 1))
.toBe(false);
expect(mockScope.validateStart(testValue - 60 * 60 * 1000 - 1))
@ -102,7 +102,7 @@ define(
it("exposes end time validator", function () {
var testValue = 42000000;
mockScope.ngModel.outer = { start: testValue };
mockScope.formModel = { start: testValue };
expect(mockScope.validateEnd(testValue - 1))
.toBe(false);
expect(mockScope.validateEnd(testValue + 60 * 60 * 1000 + 1))
@ -212,26 +212,6 @@ define(
fireWatchCollection("ngModel", mockScope.ngModel);
});
it("enforces a minimum outer span", function () {
mockScope.ngModel.outer.end =
mockScope.ngModel.outer.start - DAY * 100;
fireWatch(
"ngModel.outer.end",
mockScope.ngModel.outer.end
);
expect(mockScope.ngModel.outer.end)
.toBeGreaterThan(mockScope.ngModel.outer.start);
mockScope.ngModel.outer.start =
mockScope.ngModel.outer.end + DAY * 100;
fireWatch(
"ngModel.outer.start",
mockScope.ngModel.outer.start
);
expect(mockScope.ngModel.outer.end)
.toBeGreaterThan(mockScope.ngModel.outer.start);
});
it("enforces a minimum inner span when outer span changes", function () {
mockScope.ngModel.outer.end =
mockScope.ngModel.outer.start - DAY * 100;