UNPKG

3.77 kBTypeScriptView Raw
1import { BaseHarnessFilters } from '@angular/cdk/testing';
2import { ComponentHarness } from '@angular/cdk/testing';
3import { ContentContainerComponentHarness } from '@angular/cdk/testing';
4import { HarnessPredicate } from '@angular/cdk/testing';
5
6/** A set of criteria that can be used to filter a list of `MatGridListHarness` instances. */
7export declare interface GridListHarnessFilters extends BaseHarnessFilters {
8}
9
10/** A set of criteria that can be used to filter a list of `MatTileHarness` instances. */
11export declare interface GridTileHarnessFilters extends BaseHarnessFilters {
12 /** Text the grid-tile header should match. */
13 headerText?: string | RegExp;
14 /** Text the grid-tile footer should match. */
15 footerText?: string | RegExp;
16}
17
18/** Harness for interacting with a standard `MatGridList` in tests. */
19export declare class MatGridListHarness extends ComponentHarness {
20 /** The selector for the host element of a `MatGridList` instance. */
21 static hostSelector: string;
22 /**
23 * Gets a `HarnessPredicate` that can be used to search for a `MatGridListHarness`
24 * that meets certain criteria.
25 * @param options Options for filtering which dialog instances are considered a match.
26 * @return a `HarnessPredicate` configured with the given options.
27 */
28 static with(options?: GridListHarnessFilters): HarnessPredicate<MatGridListHarness>;
29 /**
30 * Tile coordinator that is used by the "MatGridList" for computing
31 * positions of tiles. We leverage the coordinator to provide an API
32 * for retrieving tiles based on visual tile positions.
33 */
34 private _tileCoordinator;
35 /** Gets all tiles of the grid-list. */
36 getTiles(filters?: GridTileHarnessFilters): Promise<MatGridTileHarness[]>;
37 /** Gets the amount of columns of the grid-list. */
38 getColumns(): Promise<number>;
39 /**
40 * Gets a tile of the grid-list that is located at the given location.
41 * @param row Zero-based row index.
42 * @param column Zero-based column index.
43 */
44 getTileAtPosition({ row, column, }: {
45 row: number;
46 column: number;
47 }): Promise<MatGridTileHarness>;
48}
49
50/** Harness for interacting with a standard `MatGridTitle` in tests. */
51export declare class MatGridTileHarness extends ContentContainerComponentHarness<MatGridTileSection> {
52 /** The selector for the host element of a `MatGridTile` instance. */
53 static hostSelector: string;
54 /**
55 * Gets a `HarnessPredicate` that can be used to search for a `MatGridTileHarness`
56 * that meets certain criteria.
57 * @param options Options for filtering which dialog instances are considered a match.
58 * @return a `HarnessPredicate` configured with the given options.
59 */
60 static with(options?: GridTileHarnessFilters): HarnessPredicate<MatGridTileHarness>;
61 private _header;
62 private _footer;
63 private _avatar;
64 /** Gets the amount of rows that the grid-tile takes up. */
65 getRowspan(): Promise<number>;
66 /** Gets the amount of columns that the grid-tile takes up. */
67 getColspan(): Promise<number>;
68 /** Whether the grid-tile has a header. */
69 hasHeader(): Promise<boolean>;
70 /** Whether the grid-tile has a footer. */
71 hasFooter(): Promise<boolean>;
72 /** Whether the grid-tile has an avatar. */
73 hasAvatar(): Promise<boolean>;
74 /** Gets the text of the header if present. */
75 getHeaderText(): Promise<string | null>;
76 /** Gets the text of the footer if present. */
77 getFooterText(): Promise<string | null>;
78}
79
80/** Selectors for the various `mat-grid-tile` sections that may contain user content. */
81export declare const enum MatGridTileSection {
82 HEADER = ".mat-grid-tile-header",
83 FOOTER = ".mat-grid-tile-footer"
84}
85
86export { }