test(ivy): add root cause analysis for the remaining projection test (#28152)
Initial thinking was that the bug is in the content projection logic but it turned out to be a wrong assumption - hence adding a test to illustrate that basic content projection of view containers works correctly. What fails in the marked test is the logic quering debug nodes - content peojection is fine but we never create the 'B' text node since we call show() method on the "wrong" directive instance. PR Close #28152
This commit is contained in:
parent
808898d015
commit
1a85de302d
@ -543,7 +543,33 @@ describe('projection', () => {
|
|||||||
expect(main.nativeElement).toHaveText('B(A)');
|
expect(main.nativeElement).toHaveText('B(A)');
|
||||||
});
|
});
|
||||||
|
|
||||||
fixmeIvy('unknown').it('should project filled view containers into a view container', () => {
|
it('should project view containers', () => {
|
||||||
|
TestBed.configureTestingModule(
|
||||||
|
{declarations: [SingleContentTagComponent, ManualViewportDirective]});
|
||||||
|
TestBed.overrideComponent(MainComp, {
|
||||||
|
set: {
|
||||||
|
template: '<single-content-tag>' +
|
||||||
|
'<div class="target">A</div>' +
|
||||||
|
'<ng-template manual class="target">B</ng-template>' +
|
||||||
|
'<div class="target">C</div>' +
|
||||||
|
'</single-content-tag>'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const main = TestBed.createComponent(MainComp);
|
||||||
|
const manualDirective =
|
||||||
|
main.debugElement.queryAllNodes(By.directive(ManualViewportDirective))[0].injector.get(
|
||||||
|
ManualViewportDirective);
|
||||||
|
|
||||||
|
expect(main.nativeElement).toHaveText('AC');
|
||||||
|
|
||||||
|
manualDirective.show();
|
||||||
|
main.detectChanges();
|
||||||
|
expect(main.nativeElement).toHaveText('ABC');
|
||||||
|
});
|
||||||
|
|
||||||
|
fixmeIvy('FW-869: debugElement.queryAllNodes returns nodes in the wrong order')
|
||||||
|
.it('should project filled view containers into a view container', () => {
|
||||||
TestBed.configureTestingModule(
|
TestBed.configureTestingModule(
|
||||||
{declarations: [ConditionalContentComponent, ManualViewportDirective]});
|
{declarations: [ConditionalContentComponent, ManualViewportDirective]});
|
||||||
TestBed.overrideComponent(MainComp, {
|
TestBed.overrideComponent(MainComp, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user