/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { HarnessPredicate, ComponentHarness } from '@angular/cdk/testing'; /** Harness for interacting with a standard Material calendar cell in tests. */ export class MatCalendarCellHarness extends ComponentHarness { constructor() { super(...arguments); /** Reference to the inner content element inside the cell. */ this._content = this.locatorFor('.mat-calendar-body-cell-content'); } static { this.hostSelector = '.mat-calendar-body-cell'; } /** * Gets a `HarnessPredicate` that can be used to search for a `MatCalendarCellHarness` * that meets certain criteria. * @param options Options for filtering which cell instances are considered a match. * @return a `HarnessPredicate` configured with the given options. */ static with(options = {}) { return new HarnessPredicate(MatCalendarCellHarness, options) .addOption('text', options.text, (harness, text) => { return HarnessPredicate.stringMatches(harness.getText(), text); }) .addOption('selected', options.selected, async (harness, selected) => { return (await harness.isSelected()) === selected; }) .addOption('active', options.active, async (harness, active) => { return (await harness.isActive()) === active; }) .addOption('disabled', options.disabled, async (harness, disabled) => { return (await harness.isDisabled()) === disabled; }) .addOption('today', options.today, async (harness, today) => { return (await harness.isToday()) === today; }) .addOption('inRange', options.inRange, async (harness, inRange) => { return (await harness.isInRange()) === inRange; }) .addOption('inComparisonRange', options.inComparisonRange, async (harness, inComparisonRange) => { return (await harness.isInComparisonRange()) === inComparisonRange; }) .addOption('inPreviewRange', options.inPreviewRange, async (harness, inPreviewRange) => { return (await harness.isInPreviewRange()) === inPreviewRange; }); } /** Gets the text of the calendar cell. */ async getText() { return (await this._content()).text(); } /** Gets the aria-label of the calendar cell. */ async getAriaLabel() { // We're guaranteed for the `aria-label` to be defined // since this is a private element that we control. return (await this.host()).getAttribute('aria-label'); } /** Whether the cell is selected. */ async isSelected() { const host = await this.host(); return (await host.getAttribute('aria-pressed')) === 'true'; } /** Whether the cell is disabled. */ async isDisabled() { return this._hasState('disabled'); } /** Whether the cell is currently activated using keyboard navigation. */ async isActive() { return this._hasState('active'); } /** Whether the cell represents today's date. */ async isToday() { return (await this._content()).hasClass('mat-calendar-body-today'); } /** Selects the calendar cell. Won't do anything if the cell is disabled. */ async select() { return (await this.host()).click(); } /** Hovers over the calendar cell. */ async hover() { return (await this.host()).hover(); } /** Moves the mouse away from the calendar cell. */ async mouseAway() { return (await this.host()).mouseAway(); } /** Focuses the calendar cell. */ async focus() { return (await this.host()).focus(); } /** Removes focus from the calendar cell. */ async blur() { return (await this.host()).blur(); } /** Whether the cell is the start of the main range. */ async isRangeStart() { return this._hasState('range-start'); } /** Whether the cell is the end of the main range. */ async isRangeEnd() { return this._hasState('range-end'); } /** Whether the cell is part of the main range. */ async isInRange() { return this._hasState('in-range'); } /** Whether the cell is the start of the comparison range. */ async isComparisonRangeStart() { return this._hasState('comparison-start'); } /** Whether the cell is the end of the comparison range. */ async isComparisonRangeEnd() { return this._hasState('comparison-end'); } /** Whether the cell is inside of the comparison range. */ async isInComparisonRange() { return this._hasState('in-comparison-range'); } /** Whether the cell is the start of the preview range. */ async isPreviewRangeStart() { return this._hasState('preview-start'); } /** Whether the cell is the end of the preview range. */ async isPreviewRangeEnd() { return this._hasState('preview-end'); } /** Whether the cell is inside of the preview range. */ async isInPreviewRange() { return this._hasState('in-preview'); } /** Returns whether the cell has a particular CSS class-based state. */ async _hasState(name) { return (await this.host()).hasClass(`mat-calendar-body-${name}`); } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXItY2VsbC1oYXJuZXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2RhdGVwaWNrZXIvdGVzdGluZy9jYWxlbmRhci1jZWxsLWhhcm5lc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGdCQUFnQixFQUFFLGdCQUFnQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFHeEUsK0VBQStFO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