MCPcopy Create free account
hub / github.com/angular/components / getActualTableContent

Function getActualTableContent

src/cdk/table/table.spec.ts:3578–3594  ·  view source on GitHub ↗
(tableElement: Element)

Source from the content-addressed store, hash-verified

3576}
3577
3578function getActualTableContent(tableElement: Element): string[][] {
3579 let actualTableContent: Element[][] = [];
3580 getHeaderRows(tableElement).forEach(row => {
3581 actualTableContent.push(getHeaderCells(row));
3582 });
3583
3584 // Check data row cells
3585 const rows = getRows(tableElement).map(row => getCells(row));
3586 actualTableContent = actualTableContent.concat(rows);
3587
3588 getFooterRows(tableElement).forEach(row => {
3589 actualTableContent.push(getFooterCells(row));
3590 });
3591
3592 // Convert the nodes into their text content;
3593 return actualTableContent.map(row => row.map(cell => cell.textContent!.trim()));
3594}
3595
3596export function expectTableToMatchContent(tableElement: Element, expected: any[]) {
3597 const missedExpectations: string[] = [];

Callers 1

Calls 7

getHeaderRowsFunction · 0.70
getHeaderCellsFunction · 0.70
getRowsFunction · 0.70
getCellsFunction · 0.70
getFooterRowsFunction · 0.70
getFooterCellsFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected