[Timeline] Remove namespacing from specs

This commit is contained in:
Victor Woeltjen 2015-10-23 14:06:55 -07:00
parent 26db524f0e
commit fffe07e7e6
12 changed files with 42 additions and 42 deletions

View File

@ -44,7 +44,7 @@ define(
it("applies only to activity objects", function () { it("applies only to activity objects", function () {
expect(ActivityTimespanCapability.appliesTo({ expect(ActivityTimespanCapability.appliesTo({
type: 'warp.activity' type: 'activity'
})).toBeTruthy(); })).toBeTruthy();
expect(ActivityTimespanCapability.appliesTo({ expect(ActivityTimespanCapability.appliesTo({
type: 'folder' type: 'folder'

View File

@ -45,13 +45,13 @@ define(
it("applies to subsystem modes", function () { it("applies to subsystem modes", function () {
expect(CostCapability.appliesTo({ expect(CostCapability.appliesTo({
type: "warp.mode" type: "mode"
})).toBeTruthy(); })).toBeTruthy();
expect(CostCapability.appliesTo({ expect(CostCapability.appliesTo({
type: "warp.activity" type: "activity"
})).toBeFalsy(); })).toBeFalsy();
expect(CostCapability.appliesTo({ expect(CostCapability.appliesTo({
type: "warp.other" type: "other"
})).toBeFalsy(); })).toBeFalsy();
}); });

View File

@ -27,7 +27,7 @@ define(
); );
testModel = { testModel = {
type: "warp.activity", type: "activity",
resources: { resources: {
abc: 100, abc: 100,
xyz: 42 xyz: 42
@ -45,7 +45,7 @@ define(
it("is applicable to timelines", function () { it("is applicable to timelines", function () {
expect(GraphCapability.appliesTo({ expect(GraphCapability.appliesTo({
type: "warp.timeline" type: "timeline"
})).toBeTruthy(); })).toBeTruthy();
}); });
@ -82,7 +82,7 @@ define(
it("provides a battery graph for timelines with capacity", function () { it("provides a battery graph for timelines with capacity", function () {
var mockCallback = jasmine.createSpy('callback'); var mockCallback = jasmine.createSpy('callback');
testModel.capacity = 1000; testModel.capacity = 1000;
testModel.type = "warp.timeline"; testModel.type = "timeline";
mockDomainObject.useCapability.andReturn(asPromise([ mockDomainObject.useCapability.andReturn(asPromise([
{ key: "power", start: 0, end: 15 } { key: "power", start: 0, end: 15 }
])); ]));

View File

@ -84,7 +84,7 @@ define(
it("applies only to timeline objects", function () { it("applies only to timeline objects", function () {
expect(TimelineTimespanCapability.appliesTo({ expect(TimelineTimespanCapability.appliesTo({
type: 'warp.timeline' type: 'timeline'
})).toBeTruthy(); })).toBeTruthy();
expect(TimelineTimespanCapability.appliesTo({ expect(TimelineTimespanCapability.appliesTo({
type: 'folder' type: 'folder'

View File

@ -78,7 +78,7 @@ define(
mockCallback = jasmine.createSpy('callback'); mockCallback = jasmine.createSpy('callback');
testModel = { testModel = {
type: "warp.activity", type: "activity",
resources: { resources: {
abc: 100, abc: 100,
xyz: 42 xyz: 42
@ -107,7 +107,7 @@ define(
it("is applicable to timelines", function () { it("is applicable to timelines", function () {
expect(UtilizationCapability.appliesTo({ expect(UtilizationCapability.appliesTo({
type: "warp.timeline" type: "timeline"
})).toBeTruthy(); })).toBeTruthy();
}); });

View File

@ -2,8 +2,8 @@
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/ /*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define( define(
["../../src/controllers/WARPDateTimeController"], ["../../src/controllers/TimelineDateTimeController"],
function (WARPDateTimeController) { function (TimelineDateTimeController) {
"use strict"; "use strict";
describe("The date-time controller for timeline creation", function () { describe("The date-time controller for timeline creation", function () {
@ -14,7 +14,7 @@ define(
mockScope = jasmine.createSpyObj('$scope', ['$watchCollection']); mockScope = jasmine.createSpyObj('$scope', ['$watchCollection']);
mockScope.field = 'testField'; mockScope.field = 'testField';
mockScope.ngModel = { testField: { timestamp: 0, epoch: "SET" } }; mockScope.ngModel = { testField: { timestamp: 0, epoch: "SET" } };
controller = new WARPDateTimeController(mockScope); controller = new TimelineDateTimeController(mockScope);
}); });

View File

@ -50,13 +50,13 @@ define(
}); });
it("provides three handles for activities", function () { it("provides three handles for activities", function () {
testType = "warp.activity"; testType = "activity";
expect(factory.handles(mockDomainObject).length) expect(factory.handles(mockDomainObject).length)
.toEqual(3); .toEqual(3);
}); });
it("provides two handles for timelines", function () { it("provides two handles for timelines", function () {
testType = "warp.timeline"; testType = "timeline";
expect(factory.handles(mockDomainObject).length) expect(factory.handles(mockDomainObject).length)
.toEqual(2); .toEqual(2);
}); });

View File

@ -61,13 +61,13 @@ define(
it("adds a 'modes' getter-setter to activities", function () { it("adds a 'modes' getter-setter to activities", function () {
expect(mockSwimlane.modes).toEqual(jasmine.any(Function)); expect(mockSwimlane.modes).toEqual(jasmine.any(Function));
expect(mockCapabilities.type.instanceOf) expect(mockCapabilities.type.instanceOf)
.toHaveBeenCalledWith('warp.activity'); .toHaveBeenCalledWith('activity');
}); });
it("adds a 'link' getter-setter to activities", function () { it("adds a 'link' getter-setter to activities", function () {
expect(mockSwimlane.link).toEqual(jasmine.any(Function)); expect(mockSwimlane.link).toEqual(jasmine.any(Function));
expect(mockCapabilities.type.instanceOf) expect(mockCapabilities.type.instanceOf)
.toHaveBeenCalledWith('warp.activity'); .toHaveBeenCalledWith('activity');
}); });
it("gets modes from the domain object model", function () { it("gets modes from the domain object model", function () {

View File

@ -1,11 +1,11 @@
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/ /*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define( define(
['../../src/directives/WARPSwimlaneDrag', '../../src/directives/SwimlaneDragConstants'], ['../../src/directives/MCTSwimlaneDrag', '../../src/directives/SwimlaneDragConstants'],
function (WARPSwimlaneDrag, SwimlaneDragConstants) { function (MCTSwimlaneDrag, SwimlaneDragConstants) {
"use strict"; "use strict";
describe("The warp-swimlane-drag directive", function () { describe("The mct-swimlane-drag directive", function () {
var mockDndService, var mockDndService,
mockScope, mockScope,
mockElement, mockElement,
@ -26,14 +26,14 @@ define(
); );
mockScope = jasmine.createSpyObj('$scope', ['$eval']); mockScope = jasmine.createSpyObj('$scope', ['$eval']);
mockElement = jasmine.createSpyObj('element', ['on']); mockElement = jasmine.createSpyObj('element', ['on']);
testAttrs = { warpSwimlaneDrag: "someTestExpr" }; testAttrs = { mctSwimlaneDrag: "someTestExpr" };
// Simulate evaluation of expressions in scope // Simulate evaluation of expressions in scope
mockScope.$eval.andCallFake(function (expr) { mockScope.$eval.andCallFake(function (expr) {
return scopeExprs[expr]; return scopeExprs[expr];
}); });
directive = new WARPSwimlaneDrag(mockDndService); directive = new MCTSwimlaneDrag(mockDndService);
// Run the link function, then capture the event handlers // Run the link function, then capture the event handlers
// for testing. // for testing.
@ -56,7 +56,7 @@ define(
handlers.dragstart(); handlers.dragstart();
// Should have exposed the swimlane // Should have exposed the swimlane
expect(mockDndService.setData).toHaveBeenCalledWith( expect(mockDndService.setData).toHaveBeenCalledWith(
SwimlaneDragConstants.WARP_SWIMLANE_DRAG_TYPE, SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE,
"some swimlane" "some swimlane"
); );
}); });
@ -68,7 +68,7 @@ define(
handlers.dragend(); handlers.dragend();
// Should have exposed the swimlane // Should have exposed the swimlane
expect(mockDndService.removeData).toHaveBeenCalledWith( expect(mockDndService.removeData).toHaveBeenCalledWith(
SwimlaneDragConstants.WARP_SWIMLANE_DRAG_TYPE SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE
); );
}); });
}); });

View File

@ -1,14 +1,14 @@
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/ /*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define( define(
['../../src/directives/WARPSwimlaneDrop'], ['../../src/directives/MCTSwimlaneDrop'],
function (WARPSwimlaneDrop) { function (MCTSwimlaneDrop) {
"use strict"; "use strict";
var TEST_HEIGHT = 100, var TEST_HEIGHT = 100,
TEST_TOP = 600; TEST_TOP = 600;
describe("The warp-swimlane-drop directive", function () { describe("The mct-swimlane-drop directive", function () {
var mockDndService, var mockDndService,
mockScope, mockScope,
mockElement, mockElement,
@ -36,7 +36,7 @@ define(
); );
mockScope = jasmine.createSpyObj('$scope', ['$eval']); mockScope = jasmine.createSpyObj('$scope', ['$eval']);
mockElement = jasmine.createSpyObj('element', ['on']); mockElement = jasmine.createSpyObj('element', ['on']);
testAttrs = { warpSwimlaneDrop: "mockSwimlane" }; testAttrs = { mctSwimlaneDrop: "mockSwimlane" };
mockSwimlane = jasmine.createSpyObj( mockSwimlane = jasmine.createSpyObj(
"swimlane", "swimlane",
[ "allowDropIn", "allowDropAfter", "drop", "highlight", "highlightBottom" ] [ "allowDropIn", "allowDropAfter", "drop", "highlight", "highlightBottom" ]
@ -72,7 +72,7 @@ define(
testEvent.dataTransfer.getData.andReturn('abc'); testEvent.dataTransfer.getData.andReturn('abc');
mockDndService.getData.andReturn({ domainObject: 'someDomainObject' }); mockDndService.getData.andReturn({ domainObject: 'someDomainObject' });
directive = new WARPSwimlaneDrop(mockDndService); directive = new MCTSwimlaneDrop(mockDndService);
// Run the link function, then capture the event handlers // Run the link function, then capture the event handlers
// for testing. // for testing.

View File

@ -7,7 +7,7 @@ define(
describe("Timeline swimlane drag constants", function () { describe("Timeline swimlane drag constants", function () {
it("define a custom type for swimlane drag-drop", function () { it("define a custom type for swimlane drag-drop", function () {
expect(SwimlaneDragConstants.WARP_SWIMLANE_DRAG_TYPE) expect(SwimlaneDragConstants.TIMELINE_SWIMLANE_DRAG_TYPE)
.toEqual(jasmine.any(String)); .toEqual(jasmine.any(String));
}); });
}); });

View File

@ -21,7 +21,7 @@
"controllers/TimelineTableController", "controllers/TimelineTableController",
"controllers/TimelineTickController", "controllers/TimelineTickController",
"controllers/TimelineZoomController", "controllers/TimelineZoomController",
"controllers/WARPDateTimeController", "controllers/TimelineDateTimeController",
"controllers/drag/TimelineDragHandler", "controllers/drag/TimelineDragHandler",
"controllers/drag/TimelineDragHandleFactory", "controllers/drag/TimelineDragHandleFactory",
@ -43,8 +43,8 @@
"controllers/swimlane/TimelineSwimlanePopulator", "controllers/swimlane/TimelineSwimlanePopulator",
"directives/SwimlaneDragConstants", "directives/SwimlaneDragConstants",
"directives/WARPSwimlaneDrag", "directives/MCTSwimlaneDrag",
"directives/WARPSwimlaneDrop", "directives/MCTSwimlaneDrop",
"services/ObjectLoader" "services/ObjectLoader"
] ]