cdkVirtualFor don't binding the content of my list in unit tests
See original GitHub issueI am using the visrtual scroll strategy in my project, but in my unit tests I use this structure for research all tags <span> on my html list
let elements: DebugElement[] = fixture.debugElement.queryAll(By.css(‘span’)); expect(‘Today’).toBe(elements[0].nativeElement.textContent);
this is my html structure:
<cdk-virtual-scroll-viewport [itemSize]="50" [minBufferPx]="buffer" [maxBufferPx]="buffer * 1.5" cass="fullHeight" > <div #firstChild class="content"> <div *cdkVirtualFor="let demandaAgrupada of demandasAgrupadas; templateCacheSize: 1000" > <span *ngIf="demandaAgrupada.exibeCabecalho">{demandaAgrupada.grupoPeriodo}}/span> <pd-demanda-agrupada [demandaAgrupada]="demandaAgrupada" ></pd-demanda-grupada> </div> </div> </cdk-virtual-scroll-viewport>
When i use *ngFor instead of *cdkVirtualFor, my test works.
But if I use *cdkVirtualFor, all content of my list isen’t binding
and the div of *cdkVirtualFor, isen’t binding too
this is my last element binding
<!--bindings={↵ "ng-reflect-cdk-virtual-for-of": "[object Object],[object Object",↵ "ng-reflect-cdk-virtual-for-template-cache-size": "1000"↵}-->
there is a bug on unit tests with *cdkVirtualFor ?
sorry about my english, is not my first language
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Maybe a bit late, but @acutexyz solution was not working for me i solved this with:
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.