[Plugins] Bring over timeline, clock plugins

WTD-1239
This commit is contained in:
Victor Woeltjen
2015-09-14 16:45:38 -07:00
parent 8c1b70f085
commit c932e953bc
119 changed files with 10485 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
/*global define,describe,it,expect,beforeEach,waitsFor,jasmine,window,afterEach*/
define(
['../../../src/controllers/drag/TimelineDragHandleFactory'],
function (TimelineDragHandleFactory) {
'use strict';
describe("A Timeline drag handle factory", function () {
var mockDragHandler,
mockSnapHandler,
mockDomainObject,
mockType,
testType,
factory;
beforeEach(function () {
mockDragHandler = jasmine.createSpyObj(
'dragHandler',
[ 'start' ]
);
mockSnapHandler = jasmine.createSpyObj(
'snapHandler',
[ 'snap' ]
);
mockDomainObject = jasmine.createSpyObj(
'domainObject',
[ 'getCapability', 'getId' ]
);
mockType = jasmine.createSpyObj(
'type',
[ 'instanceOf' ]
);
mockDomainObject.getId.andReturn('test-id');
mockDomainObject.getCapability.andReturn(mockType);
mockType.instanceOf.andCallFake(function (t) {
return t === testType;
});
factory = new TimelineDragHandleFactory(
mockDragHandler,
mockSnapHandler
);
});
it("inspects an object's type capability", function () {
factory.handles(mockDomainObject);
expect(mockDomainObject.getCapability)
.toHaveBeenCalledWith('type');
});
it("provides three handles for activities", function () {
testType = "warp.activity";
expect(factory.handles(mockDomainObject).length)
.toEqual(3);
});
it("provides two handles for timelines", function () {
testType = "warp.timeline";
expect(factory.handles(mockDomainObject).length)
.toEqual(2);
});
});
}
);