Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

426
Visualizações
Angular Ag-Grid row group empty render when querying DOM elements with angular-testing-library

I have an ag-grid that contains different columns and column groups, as well as row groups.

I am trying to test the DOM elements displayed in the row group using Jest and Angular Testing Library. The problem I am having is that the DOM renderer for the test does not detect any children of that row and only shows it as a self-enclosed DIV tag with no childer. But when I check it on the web browser I can see all the group rows and the nested rows within them.

I initially thought it was due to the row virtualization, but I have set the rowBuffer to 99999 and the cell fails to render anything but an empty DIV still.

What could be the issue? all the other cells and columns are rendering correctly, but the cell that contains a row group fails to render anything.

This is what it shows as when the test renders

Update: I have created a CodeSandBox app here that showcases this issue, you can see how in the browser the nested rows are visible but when rendered by JSDOM no rows are shown and the test fails on assertion. This code can be seen in lines 33-36 of app.component.spec.ts.

I have also created a GitHub issue on the testing-library repo, hoping for some clues.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This is working as expected. The children of groups are not rendered as DOM children inside of the group element, they are rendered on seperate div elements where each div represents a row.

You can verify this in the following example:

If you click on the button "Console log United States Group Element"

You will see the following:

<div comp-id="76" class="ag-cell-value ag-cell ag-cell-not-inline-editing ag-cell-normal-height" aria-expanded="false" aria-colindex="1" tabindex="-1" col-id="ag-Grid-AutoColumn" role="gridcell" style="left: 0px; width: 298px;">
<span class="ag-cell-wrapper ag-cell-expandable ag-row-group ag-row-group-indent-0">
<span class="ag-group-expanded ag-hidden" ref="eExpanded"><span class="ag-icon ag-icon-tree-open" unselectable="on" role="presentation"></span></span>Ï
<span class="ag-group-contracted" ref="eContracted"><span class="ag-icon ag-icon-tree-closed" unselectable="on" role="presentation"></span></span>
<span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
<span class="ag-group-value" ref="eValue">United States</span>
<span class="ag-group-child-count" ref="eChildCount">(1109)</span>
</span>
</div>

Notice how the children for the group element does not contain the children for that group.

If you want to also check for the children of a group, you will have to target all the div elements with the .ag-row class and query the cell you want to look at using the .ag-cell class with the col-id attribute.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda