test(ivy): re-enable passing upgrade tests (#28030)

PR Close #28030
This commit is contained in:
Kara Erickson 2019-01-09 15:29:08 -08:00 committed by Andrew Kushnir
parent 11325bad4a
commit 8934b736c8
2 changed files with 98 additions and 106 deletions

View File

@ -513,11 +513,11 @@ function getRenderParent(tNode: TNode, currentView: LView): RElement|null {
// We've got a parent which is an element in the current view. We just need to verify if the
// parent element is not a component. Component's content nodes are not inserted immediately
// because they will be projected, and so doing insert at this point would be wasteful.
// Since the projection would than move it to its final destination.
if (!(parent.flags & TNodeFlags.isComponent)) {
return getNativeByTNode(parent, currentView) as RElement;
} else {
// Since the projection would then move it to its final destination.
if (parent.flags & TNodeFlags.isComponent) {
return null;
} else {
return getNativeByTNode(parent, currentView) as RElement;
}
}
}

View File

@ -2576,8 +2576,7 @@ withEachNg1Version(() => {
});
describe('transclusion', () => {
fixmeIvy('FW-714: ng1 projected content is not being rendered')
.it('should support single-slot transclusion', async(() => {
it('should support single-slot transclusion', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
let ng2ComponentAInstance: Ng2ComponentA;
let ng2ComponentBInstance: Ng2ComponentB;
@ -2606,16 +2605,14 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module =
angular.module('ng1Module', [])
const ng1Module = angular.module('ng1Module', [])
.component('ng1', ng1Component)
.directive('ng2A', adapter.downgradeNg2Component(Ng2ComponentA));
// Define `Ng2Module`
@NgModule({
imports: [BrowserModule],
declarations:
[adapter.upgradeNg1Component('ng1'), Ng2ComponentA, Ng2ComponentB]
declarations: [adapter.upgradeNg1Component('ng1'), Ng2ComponentA, Ng2ComponentB]
})
class Ng2Module {
}
@ -2943,8 +2940,7 @@ withEachNg1Version(() => {
});
}));
fixmeIvy('FW-714: ng1 projected content is not being rendered')
.it('should support structural directives in transcluded content', async(() => {
it('should support structural directives in transcluded content', async(() => {
const adapter: UpgradeAdapter = new UpgradeAdapter(forwardRef(() => Ng2Module));
let ng2ComponentInstance: Ng2Component;
@ -2976,8 +2972,7 @@ withEachNg1Version(() => {
}
// Define `ng1Module`
const ng1Module =
angular.module('ng1Module', [])
const ng1Module = angular.module('ng1Module', [])
.component('ng1', ng1Component)
.directive('ng2', adapter.downgradeNg2Component(Ng2Component));
@ -2994,22 +2989,19 @@ withEachNg1Version(() => {
const element = html(`<ng2></ng2>`);
adapter.bootstrap(element, ['ng1Module']).ready(ref => {
expect(multiTrim(element.textContent, true))
.toBe('ng2(ng1(x(foo1)|default(bar2)))');
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(foo1)|default(bar2)))');
ng2ComponentInstance.x = 'baz';
ng2ComponentInstance.y = 'qux';
ng2ComponentInstance.show = false;
$digest(ref);
expect(multiTrim(element.textContent, true))
.toBe('ng2(ng1(x(baz2)|default(qux1)))');
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(baz2)|default(qux1)))');
ng2ComponentInstance.show = true;
$digest(ref);
expect(multiTrim(element.textContent, true))
.toBe('ng2(ng1(x(baz1)|default(qux2)))');
expect(multiTrim(element.textContent, true)).toBe('ng2(ng1(x(baz1)|default(qux2)))');
});
}));
});