import {MatDatepickerInputHarness} from '@angular/material/datepicker/testing';
MatDatepickerInputHarness
Harness for interacting with a standard Material datepicker inputs in tests.
Name | Description |
---|---|
|
blur | |
---|---|
Blurs the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
async
closeCalendar
|
|
---|---|
Closes the calendar associated with the input. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
focus | |
---|---|
Focuses the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
async
getCalendar
|
|
---|---|
Gets the |
|
Parameters | |
filter CalendarHarnessFilters = {}
|
|
Returns | |
Promise<MatCalendarHarness>
|
|
getMax | |
---|---|
Gets the formatted maximum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getMin | |
---|---|
Gets the formatted minimum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getPlaceholder | |
---|---|
Gets the placeholder of the input. |
|
Returns | |
Promise<string>
|
|
getValue | |
---|---|
Gets the value of the input. |
|
Returns | |
Promise<string>
|
|
async
hasCalendar
|
|
---|---|
Whether a calendar is associated with the input. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isCalendarOpen
|
|
---|---|
Gets whether the calendar associated with the input is open. |
|
Returns | |
Promise<boolean>
|
|
isDisabled | |
---|---|
Whether the input is disabled. |
|
Returns | |
Promise<boolean>
|
|
isFocused | |
---|---|
Whether the input is focused. |
|
Returns | |
Promise<boolean>
|
|
isRequired | |
---|---|
Whether the input is required. |
|
Returns | |
Promise<boolean>
|
|
async
openCalendar
|
|
---|---|
Opens the calendar associated with the input. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
setValue | |
---|---|
Sets the value of the input. The value will be set by simulating keypresses that correspond to the given value. |
|
Parameters | |
newValue string
|
|
Returns | |
Promise<void>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options DatepickerInputHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatDatepickerInputHarness>
|
a |
MatDatepickerToggleHarness
Harness for interacting with a standard Material datepicker toggle in tests.
Name | Description |
---|---|
|
closeCalendar | |
---|---|
Closes the calendar if it is open. |
|
Returns | |
Promise<void>
|
|
getCalendar | |
---|---|
Gets the |
|
Parameters | |
filter CalendarHarnessFilters = {}
|
|
Returns | |
Promise<MatCalendarHarness>
|
|
hasCalendar | |
---|---|
Gets whether there is a calendar associated with the trigger. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isCalendarOpen
|
|
---|---|
Gets whether the calendar associated with the toggle is open. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Whether the toggle is disabled. |
|
Returns | |
Promise<boolean>
|
|
openCalendar | |
---|---|
Opens the calendar if the trigger is enabled and it has a calendar. |
|
Returns | |
Promise<void>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options DatepickerToggleHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatDatepickerToggleHarness>
|
a |
MatStartDateHarness
Harness for interacting with a standard Material date range start input in tests.
Name | Description |
---|---|
|
blur | |
---|---|
Blurs the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
focus | |
---|---|
Focuses the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
getMax | |
---|---|
Gets the formatted maximum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getMin | |
---|---|
Gets the formatted minimum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getPlaceholder | |
---|---|
Gets the placeholder of the input. |
|
Returns | |
Promise<string>
|
|
getValue | |
---|---|
Gets the value of the input. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Whether the input is disabled. |
|
Returns | |
Promise<boolean>
|
|
isFocused | |
---|---|
Whether the input is focused. |
|
Returns | |
Promise<boolean>
|
|
isRequired | |
---|---|
Whether the input is required. |
|
Returns | |
Promise<boolean>
|
|
setValue | |
---|---|
Sets the value of the input. The value will be set by simulating keypresses that correspond to the given value. |
|
Parameters | |
newValue string
|
|
Returns | |
Promise<void>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options DatepickerInputHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatStartDateHarness>
|
a |
MatEndDateHarness
Harness for interacting with a standard Material date range end input in tests.
Name | Description |
---|---|
|
blur | |
---|---|
Blurs the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
focus | |
---|---|
Focuses the input and returns a promise that indicates when the action is complete. |
|
Returns | |
Promise<void>
|
|
getMax | |
---|---|
Gets the formatted maximum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getMin | |
---|---|
Gets the formatted minimum date for the input's value. |
|
Returns | |
Promise<string | null>
|
|
getPlaceholder | |
---|---|
Gets the placeholder of the input. |
|
Returns | |
Promise<string>
|
|
getValue | |
---|---|
Gets the value of the input. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
isDisabled | |
---|---|
Whether the input is disabled. |
|
Returns | |
Promise<boolean>
|
|
isFocused | |
---|---|
Whether the input is focused. |
|
Returns | |
Promise<boolean>
|
|
isRequired | |
---|---|
Whether the input is required. |
|
Returns | |
Promise<boolean>
|
|
setValue | |
---|---|
Sets the value of the input. The value will be set by simulating keypresses that correspond to the given value. |
|
Parameters | |
newValue string
|
|
Returns | |
Promise<void>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options DatepickerInputHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatEndDateHarness>
|
a |
MatDateRangeInputHarness
Harness for interacting with a standard Material date range input in tests.
Name | Description |
---|---|
|
closeCalendar | |
---|---|
Closes the calendar if it is open. |
|
Returns | |
Promise<void>
|
|
getCalendar | |
---|---|
Gets the |
|
Parameters | |
filter CalendarHarnessFilters = {}
|
|
Returns | |
Promise<MatCalendarHarness>
|
|
async
getEndInput
|
|
---|---|
Gets the inner start date input inside the range input. |
|
Returns | |
Promise<MatEndDateHarness>
|
|
async
getSeparator
|
|
---|---|
Gets the separator text between the values of the two inputs. |
|
Returns | |
Promise<string>
|
|
async
getStartInput
|
|
---|---|
Gets the inner start date input inside the range input. |
|
Returns | |
Promise<MatStartDateHarness>
|
|
async
getValue
|
|
---|---|
Gets the combined value of the start and end inputs, including the separator. |
|
Returns | |
Promise<string>
|
|
hasCalendar | |
---|---|
Gets whether there is a calendar associated with the trigger. |
|
Returns | |
Promise<boolean>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
isCalendarOpen
|
|
---|---|
Opens the calendar associated with the input. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Gets whether the range input is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isRequired
|
|
---|---|
Gets whether the range input is required. |
|
Returns | |
Promise<boolean>
|
|
openCalendar | |
---|---|
Opens the calendar if the trigger is enabled and it has a calendar. |
|
Returns | |
Promise<void>
|
|
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options DateRangeInputHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatDateRangeInputHarness>
|
a |
MatCalendarHarness
extends
ComponentHarness
Harness for interacting with a standard Material calendar in tests.
Name | Description |
---|---|
|
async
changeView
|
|
---|---|
Changes the calendar view by clicking on the view toggle button. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getCells
|
|
---|---|
Gets a list of cells inside the calendar. |
|
Parameters | |
filter CalendarCellHarnessFilters = {}
|
|
Returns | |
Promise<MatCalendarCellHarness[]>
|
|
async
getCurrentView
|
|
---|---|
Gets the current view that is being shown inside the calendar. |
|
Returns | |
Promise<CalendarView>
|
|
async
getCurrentViewLabel
|
|
---|---|
Gets the label of the current calendar view. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
next
|
|
---|---|
Goes to the next page of the current view (e.g. next month when inside the month view). |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
previous
|
|
---|---|
Goes to the previous page of the current view (e.g. previous month when inside the month view). |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
selectCell
|
|
---|---|
Selects a cell in the current calendar view. |
|
Parameters | |
filter CalendarCellHarnessFilters = {}
|
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options CalendarHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatCalendarHarness>
|
a |
MatCalendarCellHarness
extends
ComponentHarness
Harness for interacting with a standard Material calendar cell in tests.
Name | Description |
---|---|
|
async
blur
|
|
---|---|
Removes focus from the calendar cell. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
focus
|
|
---|---|
Focuses the calendar cell. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
getAriaLabel
|
|
---|---|
Gets the aria-label of the calendar cell. |
|
Returns | |
Promise<string>
|
|
async
getText
|
|
---|---|
Gets the text of the calendar cell. |
|
Returns | |
Promise<string>
|
|
async
host
|
|
---|---|
Gets a |
|
Returns | |
Promise<TestElement>
|
|
async
hover
|
|
---|---|
Hovers over the calendar cell. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
isActive
|
|
---|---|
Whether the cell is currently activated using keyboard navigation. |
|
Returns | |
Promise<boolean>
|
|
async
isComparisonRangeEnd
|
|
---|---|
Whether the cell is the end of the comparison range. |
|
Returns | |
Promise<boolean>
|
|
async
isComparisonRangeStart
|
|
---|---|
Whether the cell is the start of the comparison range. |
|
Returns | |
Promise<boolean>
|
|
async
isDisabled
|
|
---|---|
Whether the cell is disabled. |
|
Returns | |
Promise<boolean>
|
|
async
isInComparisonRange
|
|
---|---|
Whether the cell is inside of the comparison range. |
|
Returns | |
Promise<boolean>
|
|
async
isInPreviewRange
|
|
---|---|
Whether the cell is inside of the preview range. |
|
Returns | |
Promise<boolean>
|
|
async
isInRange
|
|
---|---|
Whether the cell is part of the main range. |
|
Returns | |
Promise<boolean>
|
|
async
isPreviewRangeEnd
|
|
---|---|
Whether the cell is the end of the preview range. |
|
Returns | |
Promise<boolean>
|
|
async
isPreviewRangeStart
|
|
---|---|
Whether the cell is the start of the preview range. |
|
Returns | |
Promise<boolean>
|
|
async
isRangeEnd
|
|
---|---|
Whether the cell is the end of the main range. |
|
Returns | |
Promise<boolean>
|
|
async
isRangeStart
|
|
---|---|
Whether the cell is the start of the main range. |
|
Returns | |
Promise<boolean>
|
|
async
isSelected
|
|
---|---|
Whether the cell is selected. |
|
Returns | |
Promise<boolean>
|
|
async
isToday
|
|
---|---|
Whether the cell represents today's date. |
|
Returns | |
Promise<boolean>
|
|
async
mouseAway
|
|
---|---|
Moves the mouse away from the calendar cell. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
async
select
|
|
---|---|
Selects the calendar cell. Won't do anything if the cell is disabled. |
|
Returns | |
Promise<void>
|
Promise that resolves when the action completes. |
static
with
|
|
---|---|
Gets a |
|
Parameters | |
options CalendarCellHarnessFilters = {}
|
|
Returns | |
HarnessPredicate<MatCalendarCellHarness>
|
a |
DatepickerInputHarnessFilters
A set of criteria that can be used to filter a list of datepicker input instances.
Name | Description |
---|---|
|
Filters based on the placeholder text of the input. |
|
Filters based on the value of the input. |
DatepickerToggleHarnessFilters
A set of criteria that can be used to filter a list of datepicker toggle instances.
CalendarHarnessFilters
A set of criteria that can be used to filter a list of calendar instances.
CalendarCellHarnessFilters
A set of criteria that can be used to filter a list of calendar cell instances.
Name | Description |
---|---|
|
Filters based on whether the cell is activated using keyboard navigation |
|
Filters based on whether the cell is disabled. |
|
Filters based on whether the cell is inside of the comparison range. |
|
Filters based on whether the cell is inside of the preview range. |
|
Filters based on whether the cell is inside of the main range. |
|
Filters based on whether the cell is selected. |
|
Filters based on the text of the cell. |
|
Filters based on whether the cell represents today's date. |
DateRangeInputHarnessFilters
A set of criteria that can be used to filter a list of date range input instances.
Name | Description |
---|---|
|
Filters based on the value of the input. |