option-harness.d-IqsW95GR.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { BaseHarnessFilters, ContentContainerComponentHarness, ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
  2. interface OptionHarnessFilters extends BaseHarnessFilters {
  3. text?: string | RegExp;
  4. isSelected?: boolean;
  5. }
  6. /** Harness for interacting with a `mat-option` in tests. */
  7. declare class MatOptionHarness extends ContentContainerComponentHarness {
  8. /** Selector used to locate option instances. */
  9. static hostSelector: string;
  10. /** Element containing the option's text. */
  11. private _text;
  12. /**
  13. * Gets a `HarnessPredicate` that can be used to search for an option with specific attributes.
  14. * @param options Options for filtering which option instances are considered a match.
  15. * @return a `HarnessPredicate` configured with the given options.
  16. */
  17. static with<T extends MatOptionHarness>(this: ComponentHarnessConstructor<T>, options?: OptionHarnessFilters): HarnessPredicate<T>;
  18. /** Clicks the option. */
  19. click(): Promise<void>;
  20. /** Gets the option's label text. */
  21. getText(): Promise<string>;
  22. /** Gets whether the option is disabled. */
  23. isDisabled(): Promise<boolean>;
  24. /** Gets whether the option is selected. */
  25. isSelected(): Promise<boolean>;
  26. /** Gets whether the option is active. */
  27. isActive(): Promise<boolean>;
  28. /** Gets whether the option is in multiple selection mode. */
  29. isMultiple(): Promise<boolean>;
  30. }
  31. export { MatOptionHarness as M };
  32. export type { OptionHarnessFilters as O };