[Core] Spec for view provider, capability

Add spec for view provider and capability to complete
test coverage of the transitioned platform/core bundle.
WTD-573.
This commit is contained in:
Victor Woeltjen
2014-11-21 18:30:25 -08:00
parent 84c7f3d71d
commit 2b27c1cabc
2 changed files with 85 additions and 0 deletions

View File

@@ -9,6 +9,30 @@ define(
"use strict";
describe("A view capability", function () {
var mockViewService,
mockDomainObject,
views = [ {key: "someView"} ],
view;
beforeEach(function () {
mockViewService = jasmine.createSpyObj(
"viewService",
[ "getViews" ]
);
mockDomainObject = jasmine.createSpyObj(
"domainObject",
[ "getId", "getModel", "getCapability" ]
);
mockViewService.getViews.andReturn(views);
view = new ViewCapability(mockViewService, mockDomainObject);
});
it("issues invocations to the view service", function () {
expect(view.invoke()).toEqual(views);
expect(mockViewService.getViews).toHaveBeenCalledWith(
mockDomainObject
);
});
});
}