Skip to content

refactor: remove @dynamic tag from harness classes #17692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/cdk/testing/tests/harnesses/sub-component-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface SubComponentHarnessFilters extends BaseHarnessFilters {
itemCount?: number;
}

/** @dynamic */
export class SubComponentHarness extends ComponentHarness {
static readonly hostSelector = 'test-sub';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ import {FormFieldHarnessFilters} from './form-field-harness-filters';
// Also support chip list harness.
/** Possible harnesses of controls which can be bound to a form-field. */
export type FormFieldControlHarness = MatInputHarness|MatSelectHarness;
/**
* Harness for interacting with a standard Material form-field's in tests.
* @dynamic
*/

/** Harness for interacting with a standard Material form-field's in tests. */
export class MatFormFieldHarness extends ComponentHarness {
static hostSelector = '.mat-form-field';

Expand Down
5 changes: 1 addition & 4 deletions src/material-experimental/input/testing/input-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import {
} from '@angular/material-experimental/form-field/testing/control';
import {InputHarnessFilters} from './input-harness-filters';

/**
* Harness for interacting with a standard Material inputs in tests.
* @dynamic
*/
/** Harness for interacting with a standard Material inputs in tests. */
export class MatInputHarness extends MatFormFieldControlHarness {
static hostSelector = '[matInput]';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {ButtonHarnessFilters} from '@angular/material/button/testing';


/**
* Harness for interacting with a MDC-based mat-button in tests.
* @dynamic
*/
/** Harness for interacting with a MDC-based mat-button in tests. */
export class MatButtonHarness extends ComponentHarness {
// TODO(jelbourn) use a single class, like `.mat-button-base`
static hostSelector = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {CheckboxHarnessFilters} from '@angular/material/checkbox/testing';

/**
* Harness for interacting with a MDC-based mat-checkbox in tests.
* @dynamic
*/
/** Harness for interacting with a MDC-based mat-checkbox in tests. */
export class MatCheckboxHarness extends ComponentHarness {
static hostSelector = 'mat-checkbox';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {ChipGridHarnessFilters} from './chip-harness-filters';
import {MatChipInputHarness} from './chip-input-harness';
import {MatChipRowHarness} from './chip-row-harness';

/**
* Harness for interacting with a mat-chip-grid in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip-grid in tests. */
export class MatChipGridHarness extends ComponentHarness {
static hostSelector = 'mat-chip-grid';

Expand Down
5 changes: 1 addition & 4 deletions src/material-experimental/mdc-chips/testing/chip-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ChipHarnessFilters} from './chip-harness-filters';

/**
* Harness for interacting with a mat-chip in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip in tests. */
export class MatChipHarness extends ComponentHarness {
static hostSelector = 'mat-basic-chip, mat-chip';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ChipInputHarnessFilters} from './chip-harness-filters';

/**
* Harness for interacting with a grid's chip input in tests.
* @dynamic
*/
/** Harness for interacting with a grid's chip input in tests. */
export class MatChipInputHarness extends ComponentHarness {
static hostSelector = '.mat-mdc-chip-input';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ChipListboxHarnessFilters} from './chip-harness-filters';
import {MatChipOptionHarness} from './chip-option-harness';

/**
* Harness for interacting with a mat-chip-listbox in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip-listbox in tests. */
export class MatChipListboxHarness extends ComponentHarness {
static hostSelector = 'mat-chip-listbox';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {HarnessPredicate} from '@angular/cdk/testing';
import {MatChipHarness} from './chip-harness';
import {ChipOptionHarnessFilters} from './chip-harness-filters';

/**
* Harness for interacting with a mat-chip-option in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip-option in tests. */
export class MatChipOptionHarness extends MatChipHarness {
static hostSelector = 'mat-basic-chip-option, mat-chip-option';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {HarnessPredicate} from '@angular/cdk/testing';
import {ChipRowHarnessFilters} from './chip-harness-filters';
import {MatChipHarness} from './chip-harness';

/**
* Harness for interacting with a mat-chip-row in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip-row in tests. */
export class MatChipRowHarness extends MatChipHarness {
static hostSelector = 'mat-chip-row, mat-basic-chip-row';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {MatChipHarness} from './chip-harness';
import {ChipSetHarnessFilters} from './chip-harness-filters';

/**
* Harness for interacting with a mat-chip-set in tests.
* @dynamic
*/
/** Harness for interacting with a mat-chip-set in tests. */
export class MatChipSetHarness extends ComponentHarness {
static hostSelector = 'mat-chip-set';

Expand Down
10 changes: 2 additions & 8 deletions src/material-experimental/mdc-menu/testing/menu-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import {
MenuItemHarnessFilters
} from '@angular/material/menu/testing';

/**
* Harness for interacting with a MDC-based mat-menu in tests.
* @dynamic
*/
/** Harness for interacting with a MDC-based mat-menu in tests. */
export class MatMenuHarness extends ComponentHarness {
static hostSelector = '.mat-menu-trigger';

Expand Down Expand Up @@ -79,10 +76,7 @@ export class MatMenuHarness extends ComponentHarness {
}


/**
* Harness for interacting with a standard mat-menu in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-menu in tests. */
export class MatMenuItemHarness extends ComponentHarness {
static hostSelector = '.mat-menu-item';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {coerceNumberProperty} from '@angular/cdk/coercion';
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ProgressBarHarnessFilters} from '@angular/material/progress-bar/testing';

/**
* Harness for interacting with an MDC-based `mat-progress-bar` in tests.
* @dynamic
*/
/** Harness for interacting with an MDC-based `mat-progress-bar` in tests. */
export class MatProgressBarHarness extends ComponentHarness {
static hostSelector = 'mat-progress-bar';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {SlideToggleHarnessFilters} from '@angular/material/slide-toggle/testing';


/**
* Harness for interacting with a MDC-based mat-slide-toggle in tests.
* @dynamic
*/
/** Harness for interacting with a MDC-based mat-slide-toggle in tests. */
export class MatSlideToggleHarness extends ComponentHarness {
static hostSelector = 'mat-slide-toggle';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {SliderHarnessFilters} from '@angular/material/slider/testing';

/**
* Harness for interacting with a MDC mat-slider in tests.
* @dynamic
*/
/** Harness for interacting with a MDC mat-slider in tests. */
export class MatSliderHarness extends ComponentHarness {
static hostSelector = 'mat-slider';

Expand Down
10 changes: 2 additions & 8 deletions src/material-experimental/select/testing/option-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export interface OptionGroupHarnessFilters extends BaseHarnessFilters {
labelText?: string;
}

/**
* Harness for interacting with a the `mat-option` for a `mat-select` in tests.
* @dynamic
*/
/** Harness for interacting with a the `mat-option` for a `mat-select` in tests. */
export class MatSelectOptionHarness extends ComponentHarness {
// TODO(crisbeto): things to add here when adding a common option harness:
// - isDisabled
Expand Down Expand Up @@ -50,10 +47,7 @@ export class MatSelectOptionHarness extends ComponentHarness {
}
}

/**
* Harness for interacting with a the `mat-optgroup` for a `mat-select` in tests.
* @dynamic
*/
/** Harness for interacting with a the `mat-optgroup` for a `mat-select` in tests. */
export class MatSelectOptionGroupHarness extends ComponentHarness {
private _label = this.locatorFor('.mat-optgroup-label');
static hostSelector = '.mat-select-panel .mat-optgroup';
Expand Down
5 changes: 1 addition & 4 deletions src/material-experimental/select/testing/select-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import {MatSelectOptionHarness, MatSelectOptionGroupHarness} from './option-harn
/** Selector for the select panel. */
const PANEL_SELECTOR = '.mat-select-panel';

/**
* Harness for interacting with a standard mat-select in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-select in tests. */
export class MatSelectHarness extends MatFormFieldControlHarness {
private _documentRootLocator = this.documentRootLocatorFactory();
private _panel = this._documentRootLocator.locatorFor(PANEL_SELECTOR);
Expand Down
5 changes: 1 addition & 4 deletions src/material/autocomplete/testing/autocomplete-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import {
/** Selector for the autocomplete panel. */
const PANEL_SELECTOR = '.mat-autocomplete-panel';

/**
* Harness for interacting with a standard mat-autocomplete in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-autocomplete in tests. */
export class MatAutocompleteHarness extends ComponentHarness {
private _documentRootLocator = this.documentRootLocatorFactory();
private _optionalPanel = this._documentRootLocator.locatorForOptional(PANEL_SELECTOR);
Expand Down
10 changes: 2 additions & 8 deletions src/material/autocomplete/testing/option-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export interface OptionGroupHarnessFilters extends BaseHarnessFilters {
labelText?: string | RegExp;
}

/**
* Harness for interacting with a the `mat-option` for a `mat-autocomplete` in tests.
* @dynamic
*/
/** Harness for interacting with a the `mat-option` for a `mat-autocomplete` in tests. */
export class MatAutocompleteOptionHarness extends ComponentHarness {
static hostSelector = '.mat-autocomplete-panel .mat-option';

Expand All @@ -43,10 +40,7 @@ export class MatAutocompleteOptionHarness extends ComponentHarness {
}
}

/**
* Harness for interacting with a the `mat-optgroup` for a `mat-autocomplete` in tests.
* @dynamic
*/
/** Harness for interacting with a the `mat-optgroup` for a `mat-autocomplete` in tests. */
export class MatAutocompleteOptionGroupHarness extends ComponentHarness {
private _label = this.locatorFor('.mat-optgroup-label');
static hostSelector = '.mat-autocomplete-panel .mat-optgroup';
Expand Down
5 changes: 1 addition & 4 deletions src/material/button/testing/button-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {ButtonHarnessFilters} from './button-harness-filters';


/**
* Harness for interacting with a standard mat-button in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-button in tests. */
export class MatButtonHarness extends ComponentHarness {
// TODO(jelbourn) use a single class, like `.mat-button-base`
static hostSelector = [
Expand Down
5 changes: 1 addition & 4 deletions src/material/checkbox/testing/checkbox-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {CheckboxHarnessFilters} from './checkbox-harness-filters';

/**
* Harness for interacting with a standard mat-checkbox in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-checkbox in tests. */
export class MatCheckboxHarness extends ComponentHarness {
static hostSelector = 'mat-checkbox';

Expand Down
5 changes: 1 addition & 4 deletions src/material/dialog/testing/dialog-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate, TestKey} from '@angular/cdk/testing'
import {DialogRole} from '@angular/material/dialog';
import {DialogHarnessFilters} from './dialog-harness-filters';

/**
* Harness for interacting with a standard MatDialog in tests.
* @dynamic
*/
/** Harness for interacting with a standard MatDialog in tests. */
export class MatDialogHarness extends ComponentHarness {
// Developers can provide a custom component or template for the
// dialog. The canonical dialog parent is the "MatDialogContainer".
Expand Down
10 changes: 2 additions & 8 deletions src/material/menu/testing/menu-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate, TestElement, TestKey} from '@angular
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';

/**
* Harness for interacting with a standard mat-menu in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-menu in tests. */
export class MatMenuHarness extends ComponentHarness {
static hostSelector = '.mat-menu-trigger';

Expand Down Expand Up @@ -113,10 +110,7 @@ export class MatMenuHarness extends ComponentHarness {
}


/**
* Harness for interacting with a standard mat-menu-item in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-menu-item in tests. */
export class MatMenuItemHarness extends ComponentHarness {
static hostSelector = '.mat-menu-item';

Expand Down
5 changes: 1 addition & 4 deletions src/material/progress-bar/testing/progress-bar-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {coerceNumberProperty} from '@angular/cdk/coercion';
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ProgressBarHarnessFilters} from './progress-bar-harness-filters';

/**
* Harness for interacting with a standard mat-progress-bar in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-progress-bar in tests. */
export class MatProgressBarHarness extends ComponentHarness {
static hostSelector = 'mat-progress-bar';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {ProgressSpinnerMode} from '@angular/material/progress-spinner';
import {ProgressSpinnerHarnessFilters} from './progress-spinner-harness-filters';

/**
* Harness for interacting with a standard mat-progress-spinner in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-progress-spinner in tests. */
export class MatProgressSpinnerHarness extends ComponentHarness {
static hostSelector = 'mat-progress-spinner';

Expand Down
10 changes: 2 additions & 8 deletions src/material/radio/testing/radio-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {RadioButtonHarnessFilters, RadioGroupHarnessFilters} from './radio-harness-filters';

/**
* Harness for interacting with a standard mat-radio-group in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-radio-group in tests. */
export class MatRadioGroupHarness extends ComponentHarness {
static hostSelector = 'mat-radio-group';

Expand Down Expand Up @@ -148,10 +145,7 @@ export class MatRadioGroupHarness extends ComponentHarness {
}
}

/**
* Harness for interacting with a standard mat-radio-button in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-radio-button in tests. */
export class MatRadioButtonHarness extends ComponentHarness {
static hostSelector = 'mat-radio-button';

Expand Down
5 changes: 1 addition & 4 deletions src/material/sidenav/testing/drawer-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {DrawerHarnessFilters} from './drawer-harness-filters';

/**
* Harness for interacting with a standard mat-drawer in tests.
* @dynamic
*/
/** Harness for interacting with a standard mat-drawer in tests. */
export class MatDrawerHarness extends ComponentHarness {
static hostSelector = '.mat-drawer';

Expand Down
Loading