source: trip-planner-front/node_modules/@angular/material/datepicker/testing/datepicker-trigger-harness-base.d.ts@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.3 KB
Line 
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 */
8import { ComponentHarness, LocatorFactory, TestElement } from '@angular/cdk/testing';
9import { CalendarHarnessFilters } from './datepicker-harness-filters';
10import { MatCalendarHarness } from './calendar-harness';
11/** Interface for a test harness that can open and close a calendar. */
12export interface DatepickerTrigger {
13 isCalendarOpen(): Promise<boolean>;
14 openCalendar(): Promise<void>;
15 closeCalendar(): Promise<void>;
16 hasCalendar(): Promise<boolean>;
17 getCalendar(filter?: CalendarHarnessFilters): Promise<MatCalendarHarness>;
18}
19/** Base class for harnesses that can trigger a calendar. */
20export declare abstract class DatepickerTriggerHarnessBase extends ComponentHarness implements DatepickerTrigger {
21 /** Whether the trigger is disabled. */
22 abstract isDisabled(): Promise<boolean>;
23 /** Whether the calendar associated with the trigger is open. */
24 abstract isCalendarOpen(): Promise<boolean>;
25 /** Opens the calendar associated with the trigger. */
26 protected abstract _openCalendar(): Promise<void>;
27 /** Opens the calendar if the trigger is enabled and it has a calendar. */
28 openCalendar(): Promise<void>;
29 /** Closes the calendar if it is open. */
30 closeCalendar(): Promise<void>;
31 /** Gets whether there is a calendar associated with the trigger. */
32 hasCalendar(): Promise<boolean>;
33 /**
34 * Gets the `MatCalendarHarness` that is associated with the trigger.
35 * @param filter Optionally filters which calendar is included.
36 */
37 getCalendar(filter?: CalendarHarnessFilters): Promise<MatCalendarHarness>;
38}
39/** Gets the ID of the calendar that a particular test element can trigger. */
40export declare function getCalendarId(host: Promise<TestElement>): Promise<string | null>;
41/** Closes the calendar with a specific ID. */
42export declare function closeCalendar(calendarId: Promise<string | null>, documentLocator: LocatorFactory): Promise<void>;
43/** Gets the test harness for a calendar associated with a particular host. */
44export declare function getCalendar(filter: CalendarHarnessFilters, host: Promise<TestElement>, documentLocator: LocatorFactory): Promise<MatCalendarHarness>;
Note: See TracBrowser for help on using the repository browser.