refactor(AppViewListener): prefix listener with on for consistency

Closes #3925
This commit is contained in:
Victor Berchet
2015-08-31 16:47:50 -07:00
parent 608cdc4077
commit 04b4035ecd
4 changed files with 15 additions and 15 deletions
@@ -62,8 +62,8 @@ export function main() {
function wrapView(view: AppView): ViewRef { return new ViewRef_(view); }
function resetSpies() {
viewListener.spy('viewCreated').reset();
viewListener.spy('viewDestroyed').reset();
viewListener.spy('onViewCreated').reset();
viewListener.spy('onViewDestroyed').reset();
renderer.spy('createView').reset();
renderer.spy('destroyView').reset();
renderer.spy('createRootHostView').reset();
@@ -120,7 +120,7 @@ export function main() {
var rootView =
internalView(<ViewRef>manager.createRootHostView(wrapPv(hostProtoView), null, null));
expect(rootView.proto).toBe(hostProtoView);
expect(viewListener.spy('viewCreated')).toHaveBeenCalledWith(rootView);
expect(viewListener.spy('onViewCreated')).toHaveBeenCalledWith(rootView);
});
it('should hydrate the view', () => {
@@ -178,7 +178,7 @@ export function main() {
it('should destroy the render view', () => {
manager.destroyRootHostView(wrapView(hostView));
expect(renderer.spy('destroyView')).toHaveBeenCalledWith(hostRenderViewRef);
expect(viewListener.spy('viewDestroyed')).toHaveBeenCalledWith(hostView);
expect(viewListener.spy('onViewDestroyed')).toHaveBeenCalledWith(hostView);
});
it('should not return the view to the pool', () => {
@@ -223,7 +223,7 @@ export function main() {
internalView(manager.createEmbeddedViewInContainer(vcRef, 0, templateRef));
expect(childView.proto).toBe(childProtoView);
expect(childView).toBe(hostView.views[2]);
expect(viewListener.spy('viewCreated')).not.toHaveBeenCalled();
expect(viewListener.spy('onViewCreated')).not.toHaveBeenCalled();
expect(renderer.spy('createView')).not.toHaveBeenCalled();
});
@@ -264,7 +264,7 @@ export function main() {
internalView(manager.createEmbeddedViewInContainer(vcRef, 1, templateRef));
expect(childView.proto).toBe(childProtoView);
expect(childView).not.toBe(firstChildView);
expect(viewListener.spy('viewCreated')).toHaveBeenCalledWith(childView);
expect(viewListener.spy('onViewCreated')).toHaveBeenCalledWith(childView);
expect(renderer.spy('createView'))
.toHaveBeenCalledWith(childProtoView.render,
childProtoView.mergeInfo.embeddedViewCount + 1);
@@ -309,7 +309,7 @@ export function main() {
internalView(manager.createEmbeddedViewInContainer(vcRef, 0, templateRef));
expect(childView.proto).toBe(childProtoView);
expect(childView).toBe(hostView.views[2]);
expect(viewListener.spy('viewCreated')).not.toHaveBeenCalled();
expect(viewListener.spy('onViewCreated')).not.toHaveBeenCalled();
expect(renderer.spy('createView')).not.toHaveBeenCalled();
});
@@ -329,7 +329,7 @@ export function main() {
<ViewRef>manager.createHostViewInContainer(vcRef, 0, wrapPv(newHostPv), null));
expect(newHostView.proto).toBe(newHostPv);
expect(newHostView).not.toBe(hostView.views[2]);
expect(viewListener.spy('viewCreated')).toHaveBeenCalledWith(newHostView);
expect(viewListener.spy('onViewCreated')).toHaveBeenCalledWith(newHostView);
expect(renderer.spy('createView'))
.toHaveBeenCalledWith(newHostPv.render, newHostPv.mergeInfo.embeddedViewCount + 1);
});