Код: Выделить всё
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatTableHarness } from '@angular/material/table/testing';
import { HarnessLoader, parallel } from '@angular/cdk/testing';
import { TableHarnessExample } from './table-harness-example';
describe('TableHarnessExample', () => {
let fixture: ComponentFixture;
let loader: HarnessLoader;
beforeEach(() => {
fixture = TestBed.createComponent(TableHarnessExample);
fixture.detectChanges();
loader = TestbedHarnessEnvironment.loader(fixture);
});
fit('should show link in weight column', async () => {
const table = await loader.getHarness(MatTableHarness);
const firstRow = (await table.getRows())[0];
const cells = await firstRow.getCells({ columnName: 'weight' });
expect(await (await cells[0].host()).getProperty('a')).toBeDefined();
});
});
Подробнее здесь: https://stackoverflow.com/questions/796 ... table-cell