[Windowing] urlService

Added the urlService to the unit
tests for the cancel and save buttons
also removed unused services. WTD 23.
This commit is contained in:
Shivam Dave
2015-06-25 14:07:02 -07:00
parent 6d28add055
commit 3a371483ab
5 changed files with 27 additions and 11 deletions

View File

@ -30,6 +30,7 @@ define(
var mockLocation,
mockDomainObject,
mockEditorCapability,
mockUrlService,
actionContext,
action;
@ -54,7 +55,10 @@ define(
"editor",
[ "save", "cancel" ]
);
mockUrlService = jasmine.createSpyObj(
"urlService",
["urlForLocation"]
);
actionContext = {
domainObject: mockDomainObject
@ -64,7 +68,7 @@ define(
mockDomainObject.getCapability.andReturn(mockEditorCapability);
mockEditorCapability.cancel.andReturn(mockPromise(true));
action = new CancelAction(mockLocation, actionContext);
action = new CancelAction(mockLocation, mockUrlService, actionContext);
});
@ -91,7 +95,9 @@ define(
it("returns to browse when performed", function () {
action.perform();
expect(mockLocation.path).toHaveBeenCalledWith("/browse");
expect(mockLocation.path).toHaveBeenCalledWith(
mockUrlService.urlForLocation("browse", mockDomainObject)
);
});
});
}