fix(view_manager): allow to create host views even if there is an embedded view at the same place.

This commit is contained in:
Tobias Bosch
2015-07-16 15:17:52 -07:00
parent b785503543
commit 116b64de25
2 changed files with 18 additions and 1 deletions

View File

@ -300,6 +300,22 @@ export function main() {
});
describe('create a host view', () => {
it('should always create a new view and not use the embedded view', () => {
var newHostPv = createHostPv([createNestedElBinder(createComponentPv())]);
var newHostView =
internalView(manager.createViewInContainer(vcRef, 0, wrapPv(newHostPv), null));
expect(newHostView.proto).toBe(newHostPv);
expect(newHostView).not.toBe(hostView.views[2]);
expect(viewListener.spy('viewCreated')).toHaveBeenCalledWith(newHostView);
expect(renderer.spy('createView'))
.toHaveBeenCalledWith(newHostPv.mergeMapping.renderProtoViewRef,
newHostPv.mergeMapping.renderFragmentCount);
});
});
});
});