index.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import { BaseHarnessFilters, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
  2. /** A set of criteria that can be used to filter a list of `MatToolbarHarness` instances. */
  3. interface ToolbarHarnessFilters extends BaseHarnessFilters {
  4. /** Only find instances whose text matches the given value. */
  5. text?: string | RegExp;
  6. }
  7. /** Selectors for different sections of the mat-toolbar that contain user content. */
  8. declare enum MatToolbarSection {
  9. ROW = ".mat-toolbar-row"
  10. }
  11. /** Harness for interacting with a standard mat-toolbar in tests. */
  12. declare class MatToolbarHarness extends ContentContainerComponentHarness<MatToolbarSection> {
  13. static hostSelector: string;
  14. private _getRows;
  15. /**
  16. * Gets a `HarnessPredicate` that can be used to search for a `MatToolbarHarness` that meets
  17. * certain criteria.
  18. * @param options Options for filtering which card instances are considered a match.
  19. * @return a `HarnessPredicate` configured with the given options.
  20. */
  21. static with(options?: ToolbarHarnessFilters): HarnessPredicate<MatToolbarHarness>;
  22. /** Whether the toolbar has multiple rows. */
  23. hasMultipleRows(): Promise<boolean>;
  24. /** Gets all of the toolbar's content as text. */
  25. private _getText;
  26. /** Gets the text of each row in the toolbar. */
  27. getRowsAsText(): Promise<string[]>;
  28. }
  29. export { MatToolbarHarness, MatToolbarSection };
  30. export type { ToolbarHarnessFilters };