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 { HarnessPredicate, ComponentHarness } from '@angular/cdk/testing';
|
---|
9 | import { CalendarHarnessFilters, CalendarCellHarnessFilters } from './datepicker-harness-filters';
|
---|
10 | import { MatCalendarCellHarness } from './calendar-cell-harness';
|
---|
11 | /** Possible views of a `MatCalendarHarness`. */
|
---|
12 | export declare const enum CalendarView {
|
---|
13 | MONTH = 0,
|
---|
14 | YEAR = 1,
|
---|
15 | MULTI_YEAR = 2
|
---|
16 | }
|
---|
17 | /** Harness for interacting with a standard Material calendar in tests. */
|
---|
18 | export declare class MatCalendarHarness extends ComponentHarness {
|
---|
19 | static hostSelector: string;
|
---|
20 | /** Queries for the calendar's period toggle button. */
|
---|
21 | private _periodButton;
|
---|
22 | /**
|
---|
23 | * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarHarness`
|
---|
24 | * that meets certain criteria.
|
---|
25 | * @param options Options for filtering which calendar instances are considered a match.
|
---|
26 | * @return a `HarnessPredicate` configured with the given options.
|
---|
27 | */
|
---|
28 | static with(options?: CalendarHarnessFilters): HarnessPredicate<MatCalendarHarness>;
|
---|
29 | /**
|
---|
30 | * Gets a list of cells inside the calendar.
|
---|
31 | * @param filter Optionally filters which cells are included.
|
---|
32 | */
|
---|
33 | getCells(filter?: CalendarCellHarnessFilters): Promise<MatCalendarCellHarness[]>;
|
---|
34 | /** Gets the current view that is being shown inside the calendar. */
|
---|
35 | getCurrentView(): Promise<CalendarView>;
|
---|
36 | /** Gets the label of the current calendar view. */
|
---|
37 | getCurrentViewLabel(): Promise<string>;
|
---|
38 | /** Changes the calendar view by clicking on the view toggle button. */
|
---|
39 | changeView(): Promise<void>;
|
---|
40 | /** Goes to the next page of the current view (e.g. next month when inside the month view). */
|
---|
41 | next(): Promise<void>;
|
---|
42 | /**
|
---|
43 | * Goes to the previous page of the current view
|
---|
44 | * (e.g. previous month when inside the month view).
|
---|
45 | */
|
---|
46 | previous(): Promise<void>;
|
---|
47 | /**
|
---|
48 | * Selects a cell in the current calendar view.
|
---|
49 | * @param filter An optional filter to apply to the cells. The first cell matching the filter
|
---|
50 | * will be selected.
|
---|
51 | */
|
---|
52 | selectCell(filter?: CalendarCellHarnessFilters): Promise<void>;
|
---|
53 | }
|
---|