[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { ComponentHarness, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
---|
| 9 | import { TableHarnessFilters, RowHarnessFilters } from './table-harness-filters';
|
---|
| 10 | import { MatRowHarness, MatHeaderRowHarness, MatFooterRowHarness, MatRowHarnessColumnsText } from './row-harness';
|
---|
| 11 | /** Text extracted from a table organized by columns. */
|
---|
| 12 | export interface MatTableHarnessColumnsText {
|
---|
| 13 | [columnName: string]: {
|
---|
| 14 | text: string[];
|
---|
| 15 | headerText: string[];
|
---|
| 16 | footerText: string[];
|
---|
| 17 | };
|
---|
| 18 | }
|
---|
| 19 | interface RowBase extends ComponentHarness {
|
---|
| 20 | getCellTextByColumnName(): Promise<MatRowHarnessColumnsText>;
|
---|
| 21 | getCellTextByIndex(): Promise<string[]>;
|
---|
| 22 | }
|
---|
| 23 | export declare abstract class _MatTableHarnessBase<HeaderRowType extends (ComponentHarnessConstructor<HeaderRow> & {
|
---|
| 24 | with: (options?: RowHarnessFilters) => HarnessPredicate<HeaderRow>;
|
---|
| 25 | }), HeaderRow extends RowBase, RowType extends (ComponentHarnessConstructor<Row> & {
|
---|
| 26 | with: (options?: RowHarnessFilters) => HarnessPredicate<Row>;
|
---|
| 27 | }), Row extends RowBase, FooterRowType extends (ComponentHarnessConstructor<FooterRow> & {
|
---|
| 28 | with: (options?: RowHarnessFilters) => HarnessPredicate<FooterRow>;
|
---|
| 29 | }), FooterRow extends RowBase> extends ContentContainerComponentHarness<string> {
|
---|
| 30 | protected abstract _headerRowHarness: HeaderRowType;
|
---|
| 31 | protected abstract _rowHarness: RowType;
|
---|
| 32 | protected abstract _footerRowHarness: FooterRowType;
|
---|
| 33 | /** Gets all of the header rows in a table. */
|
---|
| 34 | getHeaderRows(filter?: RowHarnessFilters): Promise<HeaderRow[]>;
|
---|
| 35 | /** Gets all of the regular data rows in a table. */
|
---|
| 36 | getRows(filter?: RowHarnessFilters): Promise<Row[]>;
|
---|
| 37 | /** Gets all of the footer rows in a table. */
|
---|
| 38 | getFooterRows(filter?: RowHarnessFilters): Promise<FooterRow[]>;
|
---|
| 39 | /** Gets the text inside the entire table organized by rows. */
|
---|
| 40 | getCellTextByIndex(): Promise<string[][]>;
|
---|
| 41 | /** Gets the text inside the entire table organized by columns. */
|
---|
| 42 | getCellTextByColumnName(): Promise<MatTableHarnessColumnsText>;
|
---|
| 43 | }
|
---|
| 44 | /** Harness for interacting with a standard mat-table in tests. */
|
---|
| 45 | export declare class MatTableHarness extends _MatTableHarnessBase<typeof MatHeaderRowHarness, MatHeaderRowHarness, typeof MatRowHarness, MatRowHarness, typeof MatFooterRowHarness, MatFooterRowHarness> {
|
---|
| 46 | /** The selector for the host element of a `MatTableHarness` instance. */
|
---|
| 47 | static hostSelector: string;
|
---|
| 48 | protected _headerRowHarness: typeof MatHeaderRowHarness;
|
---|
| 49 | protected _rowHarness: typeof MatRowHarness;
|
---|
| 50 | protected _footerRowHarness: typeof MatFooterRowHarness;
|
---|
| 51 | /**
|
---|
| 52 | * Gets a `HarnessPredicate` that can be used to search for a table with specific attributes.
|
---|
| 53 | * @param options Options for narrowing the search
|
---|
| 54 | * @return a `HarnessPredicate` configured with the given options.
|
---|
| 55 | */
|
---|
| 56 | static with(options?: TableHarnessFilters): HarnessPredicate<MatTableHarness>;
|
---|
| 57 | }
|
---|
| 58 | export {};
|
---|