Skip to content

Commit 52ce0d4

Browse files
devversionjelbourn
authored andcommitted
refactor: remove @dynamic tag from harness classes (#17692)
The `@dynamic` should no longer be needed since the harnesses will be built as part of a vanilla TypeScript compilation.
1 parent 03c8bb2 commit 52ce0d4

File tree

34 files changed

+39
-153
lines changed

34 files changed

+39
-153
lines changed

src/cdk/testing/tests/harnesses/sub-component-harness.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export interface SubComponentHarnessFilters extends BaseHarnessFilters {
1414
itemCount?: number;
1515
}
1616

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

src/material-experimental/form-field/testing/form-field-harness.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ import {FormFieldHarnessFilters} from './form-field-harness-filters';
2323
// Also support chip list harness.
2424
/** Possible harnesses of controls which can be bound to a form-field. */
2525
export type FormFieldControlHarness = MatInputHarness|MatSelectHarness;
26-
/**
27-
* Harness for interacting with a standard Material form-field's in tests.
28-
* @dynamic
29-
*/
26+
27+
/** Harness for interacting with a standard Material form-field's in tests. */
3028
export class MatFormFieldHarness extends ComponentHarness {
3129
static hostSelector = '.mat-form-field';
3230

src/material-experimental/input/testing/input-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import {
1212
} from '@angular/material-experimental/form-field/testing/control';
1313
import {InputHarnessFilters} from './input-harness-filters';
1414

15-
/**
16-
* Harness for interacting with a standard Material inputs in tests.
17-
* @dynamic
18-
*/
15+
/** Harness for interacting with a standard Material inputs in tests. */
1916
export class MatInputHarness extends MatFormFieldControlHarness {
2017
static hostSelector = '[matInput]';
2118

src/material-experimental/mdc-button/testing/button-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {ButtonHarnessFilters} from '@angular/material/button/testing';
1212

1313

14-
/**
15-
* Harness for interacting with a MDC-based mat-button in tests.
16-
* @dynamic
17-
*/
14+
/** Harness for interacting with a MDC-based mat-button in tests. */
1815
export class MatButtonHarness extends ComponentHarness {
1916
// TODO(jelbourn) use a single class, like `.mat-button-base`
2017
static hostSelector = [

src/material-experimental/mdc-checkbox/testing/checkbox-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {CheckboxHarnessFilters} from '@angular/material/checkbox/testing';
1212

13-
/**
14-
* Harness for interacting with a MDC-based mat-checkbox in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a MDC-based mat-checkbox in tests. */
1714
export class MatCheckboxHarness extends ComponentHarness {
1815
static hostSelector = 'mat-checkbox';
1916

src/material-experimental/mdc-chips/testing/chip-grid-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {ChipGridHarnessFilters} from './chip-harness-filters';
1111
import {MatChipInputHarness} from './chip-input-harness';
1212
import {MatChipRowHarness} from './chip-row-harness';
1313

14-
/**
15-
* Harness for interacting with a mat-chip-grid in tests.
16-
* @dynamic
17-
*/
14+
/** Harness for interacting with a mat-chip-grid in tests. */
1815
export class MatChipGridHarness extends ComponentHarness {
1916
static hostSelector = 'mat-chip-grid';
2017

src/material-experimental/mdc-chips/testing/chip-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {ChipHarnessFilters} from './chip-harness-filters';
1111

12-
/**
13-
* Harness for interacting with a mat-chip in tests.
14-
* @dynamic
15-
*/
12+
/** Harness for interacting with a mat-chip in tests. */
1613
export class MatChipHarness extends ComponentHarness {
1714
static hostSelector = 'mat-basic-chip, mat-chip';
1815

src/material-experimental/mdc-chips/testing/chip-input-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {ChipInputHarnessFilters} from './chip-harness-filters';
1111

12-
/**
13-
* Harness for interacting with a grid's chip input in tests.
14-
* @dynamic
15-
*/
12+
/** Harness for interacting with a grid's chip input in tests. */
1613
export class MatChipInputHarness extends ComponentHarness {
1714
static hostSelector = '.mat-mdc-chip-input';
1815

src/material-experimental/mdc-chips/testing/chip-listbox-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {ChipListboxHarnessFilters} from './chip-harness-filters';
1111
import {MatChipOptionHarness} from './chip-option-harness';
1212

13-
/**
14-
* Harness for interacting with a mat-chip-listbox in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a mat-chip-listbox in tests. */
1714
export class MatChipListboxHarness extends ComponentHarness {
1815
static hostSelector = 'mat-chip-listbox';
1916

src/material-experimental/mdc-chips/testing/chip-option-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {HarnessPredicate} from '@angular/cdk/testing';
1010
import {MatChipHarness} from './chip-harness';
1111
import {ChipOptionHarnessFilters} from './chip-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a mat-chip-option in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a mat-chip-option in tests. */
1714
export class MatChipOptionHarness extends MatChipHarness {
1815
static hostSelector = 'mat-basic-chip-option, mat-chip-option';
1916

src/material-experimental/mdc-chips/testing/chip-row-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {HarnessPredicate} from '@angular/cdk/testing';
1010
import {ChipRowHarnessFilters} from './chip-harness-filters';
1111
import {MatChipHarness} from './chip-harness';
1212

13-
/**
14-
* Harness for interacting with a mat-chip-row in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a mat-chip-row in tests. */
1714
export class MatChipRowHarness extends MatChipHarness {
1815
static hostSelector = 'mat-chip-row, mat-basic-chip-row';
1916

src/material-experimental/mdc-chips/testing/chip-set-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {MatChipHarness} from './chip-harness';
1111
import {ChipSetHarnessFilters} from './chip-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a mat-chip-set in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a mat-chip-set in tests. */
1714
export class MatChipSetHarness extends ComponentHarness {
1815
static hostSelector = 'mat-chip-set';
1916

src/material-experimental/mdc-menu/testing/menu-harness.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ import {
1313
MenuItemHarnessFilters
1414
} from '@angular/material/menu/testing';
1515

16-
/**
17-
* Harness for interacting with a MDC-based mat-menu in tests.
18-
* @dynamic
19-
*/
16+
/** Harness for interacting with a MDC-based mat-menu in tests. */
2017
export class MatMenuHarness extends ComponentHarness {
2118
static hostSelector = '.mat-menu-trigger';
2219

@@ -79,10 +76,7 @@ export class MatMenuHarness extends ComponentHarness {
7976
}
8077

8178

82-
/**
83-
* Harness for interacting with a standard mat-menu in tests.
84-
* @dynamic
85-
*/
79+
/** Harness for interacting with a standard mat-menu in tests. */
8680
export class MatMenuItemHarness extends ComponentHarness {
8781
static hostSelector = '.mat-menu-item';
8882

src/material-experimental/mdc-progress-bar/testing/progress-bar-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {coerceNumberProperty} from '@angular/cdk/coercion';
1010
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {ProgressBarHarnessFilters} from '@angular/material/progress-bar/testing';
1212

13-
/**
14-
* Harness for interacting with an MDC-based `mat-progress-bar` in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with an MDC-based `mat-progress-bar` in tests. */
1714
export class MatProgressBarHarness extends ComponentHarness {
1815
static hostSelector = 'mat-progress-bar';
1916

src/material-experimental/mdc-slide-toggle/testing/slide-toggle-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {SlideToggleHarnessFilters} from '@angular/material/slide-toggle/testing';
1212

1313

14-
/**
15-
* Harness for interacting with a MDC-based mat-slide-toggle in tests.
16-
* @dynamic
17-
*/
14+
/** Harness for interacting with a MDC-based mat-slide-toggle in tests. */
1815
export class MatSlideToggleHarness extends ComponentHarness {
1916
static hostSelector = 'mat-slide-toggle';
2017

src/material-experimental/mdc-slider/testing/slider-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion
1010
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {SliderHarnessFilters} from '@angular/material/slider/testing';
1212

13-
/**
14-
* Harness for interacting with a MDC mat-slider in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a MDC mat-slider in tests. */
1714
export class MatSliderHarness extends ComponentHarness {
1815
static hostSelector = 'mat-slider';
1916

src/material-experimental/select/testing/option-harness.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export interface OptionGroupHarnessFilters extends BaseHarnessFilters {
1919
labelText?: string;
2020
}
2121

22-
/**
23-
* Harness for interacting with a the `mat-option` for a `mat-select` in tests.
24-
* @dynamic
25-
*/
22+
/** Harness for interacting with a the `mat-option` for a `mat-select` in tests. */
2623
export class MatSelectOptionHarness extends ComponentHarness {
2724
// TODO(crisbeto): things to add here when adding a common option harness:
2825
// - isDisabled
@@ -50,10 +47,7 @@ export class MatSelectOptionHarness extends ComponentHarness {
5047
}
5148
}
5249

53-
/**
54-
* Harness for interacting with a the `mat-optgroup` for a `mat-select` in tests.
55-
* @dynamic
56-
*/
50+
/** Harness for interacting with a the `mat-optgroup` for a `mat-select` in tests. */
5751
export class MatSelectOptionGroupHarness extends ComponentHarness {
5852
private _label = this.locatorFor('.mat-optgroup-label');
5953
static hostSelector = '.mat-select-panel .mat-optgroup';

src/material-experimental/select/testing/select-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ import {MatSelectOptionHarness, MatSelectOptionGroupHarness} from './option-harn
1616
/** Selector for the select panel. */
1717
const PANEL_SELECTOR = '.mat-select-panel';
1818

19-
/**
20-
* Harness for interacting with a standard mat-select in tests.
21-
* @dynamic
22-
*/
19+
/** Harness for interacting with a standard mat-select in tests. */
2320
export class MatSelectHarness extends MatFormFieldControlHarness {
2421
private _documentRootLocator = this.documentRootLocatorFactory();
2522
private _panel = this._documentRootLocator.locatorFor(PANEL_SELECTOR);

src/material/autocomplete/testing/autocomplete-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ import {
1919
/** Selector for the autocomplete panel. */
2020
const PANEL_SELECTOR = '.mat-autocomplete-panel';
2121

22-
/**
23-
* Harness for interacting with a standard mat-autocomplete in tests.
24-
* @dynamic
25-
*/
22+
/** Harness for interacting with a standard mat-autocomplete in tests. */
2623
export class MatAutocompleteHarness extends ComponentHarness {
2724
private _documentRootLocator = this.documentRootLocatorFactory();
2825
private _optionalPanel = this._documentRootLocator.locatorForOptional(PANEL_SELECTOR);

src/material/autocomplete/testing/option-harness.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export interface OptionGroupHarnessFilters extends BaseHarnessFilters {
1919
labelText?: string | RegExp;
2020
}
2121

22-
/**
23-
* Harness for interacting with a the `mat-option` for a `mat-autocomplete` in tests.
24-
* @dynamic
25-
*/
22+
/** Harness for interacting with a the `mat-option` for a `mat-autocomplete` in tests. */
2623
export class MatAutocompleteOptionHarness extends ComponentHarness {
2724
static hostSelector = '.mat-autocomplete-panel .mat-option';
2825

@@ -43,10 +40,7 @@ export class MatAutocompleteOptionHarness extends ComponentHarness {
4340
}
4441
}
4542

46-
/**
47-
* Harness for interacting with a the `mat-optgroup` for a `mat-autocomplete` in tests.
48-
* @dynamic
49-
*/
43+
/** Harness for interacting with a the `mat-optgroup` for a `mat-autocomplete` in tests. */
5044
export class MatAutocompleteOptionGroupHarness extends ComponentHarness {
5145
private _label = this.locatorFor('.mat-optgroup-label');
5246
static hostSelector = '.mat-autocomplete-panel .mat-optgroup';

src/material/button/testing/button-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {ButtonHarnessFilters} from './button-harness-filters';
1212

1313

14-
/**
15-
* Harness for interacting with a standard mat-button in tests.
16-
* @dynamic
17-
*/
14+
/** Harness for interacting with a standard mat-button in tests. */
1815
export class MatButtonHarness extends ComponentHarness {
1916
// TODO(jelbourn) use a single class, like `.mat-button-base`
2017
static hostSelector = [

src/material/checkbox/testing/checkbox-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1010
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {CheckboxHarnessFilters} from './checkbox-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a standard mat-checkbox in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a standard mat-checkbox in tests. */
1714
export class MatCheckboxHarness extends ComponentHarness {
1815
static hostSelector = 'mat-checkbox';
1916

src/material/dialog/testing/dialog-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate, TestKey} from '@angular/cdk/testing'
1010
import {DialogRole} from '@angular/material/dialog';
1111
import {DialogHarnessFilters} from './dialog-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a standard MatDialog in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a standard MatDialog in tests. */
1714
export class MatDialogHarness extends ComponentHarness {
1815
// Developers can provide a custom component or template for the
1916
// dialog. The canonical dialog parent is the "MatDialogContainer".

src/material/menu/testing/menu-harness.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {ComponentHarness, HarnessPredicate, TestElement, TestKey} from '@angular
1010
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1111
import {MenuHarnessFilters, MenuItemHarnessFilters} from './menu-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a standard mat-menu in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a standard mat-menu in tests. */
1714
export class MatMenuHarness extends ComponentHarness {
1815
static hostSelector = '.mat-menu-trigger';
1916

@@ -113,10 +110,7 @@ export class MatMenuHarness extends ComponentHarness {
113110
}
114111

115112

116-
/**
117-
* Harness for interacting with a standard mat-menu-item in tests.
118-
* @dynamic
119-
*/
113+
/** Harness for interacting with a standard mat-menu-item in tests. */
120114
export class MatMenuItemHarness extends ComponentHarness {
121115
static hostSelector = '.mat-menu-item';
122116

src/material/progress-bar/testing/progress-bar-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {coerceNumberProperty} from '@angular/cdk/coercion';
1010
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {ProgressBarHarnessFilters} from './progress-bar-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a standard mat-progress-bar in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a standard mat-progress-bar in tests. */
1714
export class MatProgressBarHarness extends ComponentHarness {
1815
static hostSelector = 'mat-progress-bar';
1916

src/material/progress-spinner/testing/progress-spinner-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {ProgressSpinnerMode} from '@angular/material/progress-spinner';
1212
import {ProgressSpinnerHarnessFilters} from './progress-spinner-harness-filters';
1313

14-
/**
15-
* Harness for interacting with a standard mat-progress-spinner in tests.
16-
* @dynamic
17-
*/
14+
/** Harness for interacting with a standard mat-progress-spinner in tests. */
1815
export class MatProgressSpinnerHarness extends ComponentHarness {
1916
static hostSelector = 'mat-progress-spinner';
2017

src/material/radio/testing/radio-harness.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1010
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1111
import {RadioButtonHarnessFilters, RadioGroupHarnessFilters} from './radio-harness-filters';
1212

13-
/**
14-
* Harness for interacting with a standard mat-radio-group in tests.
15-
* @dynamic
16-
*/
13+
/** Harness for interacting with a standard mat-radio-group in tests. */
1714
export class MatRadioGroupHarness extends ComponentHarness {
1815
static hostSelector = 'mat-radio-group';
1916

@@ -148,10 +145,7 @@ export class MatRadioGroupHarness extends ComponentHarness {
148145
}
149146
}
150147

151-
/**
152-
* Harness for interacting with a standard mat-radio-button in tests.
153-
* @dynamic
154-
*/
148+
/** Harness for interacting with a standard mat-radio-button in tests. */
155149
export class MatRadioButtonHarness extends ComponentHarness {
156150
static hostSelector = 'mat-radio-button';
157151

src/material/sidenav/testing/drawer-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
1010
import {DrawerHarnessFilters} from './drawer-harness-filters';
1111

12-
/**
13-
* Harness for interacting with a standard mat-drawer in tests.
14-
* @dynamic
15-
*/
12+
/** Harness for interacting with a standard mat-drawer in tests. */
1613
export class MatDrawerHarness extends ComponentHarness {
1714
static hostSelector = '.mat-drawer';
1815

0 commit comments

Comments
 (0)