[Timelines] #677 Applied fix to prevent editing of timelines in browse mode

Fixed failing test
This commit is contained in:
Melanie Lean
2016-02-11 21:34:22 -08:00
parent 42ce2aa7cf
commit 53c60ee64f
3 changed files with 30 additions and 3 deletions

View File

@@ -33,6 +33,8 @@ define(
testRepresentation,
mockDomainObject,
mockPersistence,
mockCapabilities,
mockStatusCapability,
representer;
function mockPromise(value) {
@@ -57,11 +59,20 @@ define(
]);
mockPersistence =
jasmine.createSpyObj("persistence", ["persist"]);
mockStatusCapability =
jasmine.createSpyObj("status", ["get"]);
mockStatusCapability.get.andReturn(false);
mockCapabilities = {
'persistence': mockPersistence,
'status': mockStatusCapability
};
mockDomainObject.getModel.andReturn({});
mockDomainObject.hasCapability.andReturn(true);
mockDomainObject.useCapability.andReturn(true);
mockDomainObject.getCapability.andReturn(mockPersistence);
mockDomainObject.getCapability.andCallFake(function(capability){
return mockCapabilities[capability];
});
representer = new EditRepresenter(mockQ, mockLog, mockScope);
representer.represent(testRepresentation, mockDomainObject);