Skip to content

Commit d6addeb

Browse files
committed
remove explicit @return for async void fns (covered by #17751)
1 parent 4147409 commit d6addeb

File tree

11 files changed

+26
-86
lines changed

11 files changed

+26
-86
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export class MatAutocompleteHarness extends ComponentHarness {
5050
return coerceBooleanProperty(await disabled);
5151
}
5252

53-
/** Focuses the input and returns a void promise that indicates when the action is complete. */
53+
/** Focuses the autocomplete input. */
5454
async focus(): Promise<void> {
5555
return (await this.host()).focus();
5656
}
5757

58-
/** Blurs the input and returns a void promise that indicates when the action is complete. */
58+
/** Blurs the autocomplete input. */
5959
async blur(): Promise<void> {
6060
return (await this.host()).blur();
6161
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ export class MatAutocompleteOptionHarness extends ComponentHarness {
4545
(harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
4646
}
4747

48-
/**
49-
* Clicks the option.
50-
* @return A promise that resolves when the action is complete.
51-
*/
48+
/** Clicks the option. */
5249
async select(): Promise<void> {
5350
return (await this.host()).click();
5451
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ export class MatButtonHarness extends ComponentHarness {
5353
return (await this.host()).text();
5454
}
5555

56-
/** Focuses the button and returns a void promise that indicates when the action is complete. */
56+
/** Focuses the button. */
5757
async focus(): Promise<void> {
5858
return (await this.host()).focus();
5959
}
6060

61-
/** Blurs the button and returns a void promise that indicates when the action is complete. */
61+
/** Blurs the button. */
6262
async blur(): Promise<void> {
6363
return (await this.host()).blur();
6464
}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,19 +91,18 @@ export class MatCheckboxHarness extends ComponentHarness {
9191
return (await this._label()).text();
9292
}
9393

94-
/** Focuses the checkbox and returns a void promise that indicates when the action is complete. */
94+
/** Focuses the checkbox. */
9595
async focus(): Promise<void> {
9696
return (await this._input()).focus();
9797
}
9898

99-
/** Blurs the checkbox and returns a void promise that indicates when the action is complete. */
99+
/** Blurs the checkbox. */
100100
async blur(): Promise<void> {
101101
return (await this._input()).blur();
102102
}
103103

104104
/**
105-
* Toggle the checked state of the checkbox and returns a void promise that indicates when the
106-
* action is complete.
105+
* Toggles the checked state of the checkbox.
107106
*
108107
* Note: This attempts to toggle the checkbox as a user would, by clicking it. Therefore if you
109108
* are using `MAT_CHECKBOX_CLICK_ACTION` to change the behavior on click, calling this method
@@ -115,8 +114,7 @@ export class MatCheckboxHarness extends ComponentHarness {
115114

116115
/**
117116
* Puts the checkbox in a checked state by toggling it if it is currently unchecked, or doing
118-
* nothing if it is already checked. Returns a void promise that indicates when the action is
119-
* complete.
117+
* nothing if it is already checked.
120118
*
121119
* Note: This attempts to check the checkbox as a user would, by clicking it. Therefore if you
122120
* are using `MAT_CHECKBOX_CLICK_ACTION` to change the behavior on click, calling this method
@@ -130,8 +128,7 @@ export class MatCheckboxHarness extends ComponentHarness {
130128

131129
/**
132130
* Puts the checkbox in an unchecked state by toggling it if it is currently checked, or doing
133-
* nothing if it is already unchecked. Returns a void promise that indicates when the action is
134-
* complete.
131+
* nothing if it is already unchecked.
135132
*
136133
* Note: This attempts to uncheck the checkbox as a user would, by clicking it. Therefore if you
137134
* are using `MAT_CHECKBOX_CLICK_ACTION` to change the behavior on click, calling this method

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

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,24 @@ export class MatMenuHarness extends ComponentHarness {
4747
return (await this.host()).text();
4848
}
4949

50-
/**
51-
* Focuses the menu
52-
* @return A promise that resolves when the action is complete.
53-
*/
50+
/** Focuses the menu. */
5451
async focus(): Promise<void> {
5552
return (await this.host()).focus();
5653
}
5754

58-
/**
59-
* Blurs the menu.
60-
* @return A promise that resolves when the action is complete.
61-
*/
55+
/** Blurs the menu. */
6256
async blur(): Promise<void> {
6357
return (await this.host()).blur();
6458
}
6559

66-
/**
67-
* Opens the menu.
68-
* @return A promise that resolves when the action is complete.
69-
*/
60+
/** Opens the menu. */
7061
async open(): Promise<void> {
7162
if (!await this.isOpen()) {
7263
return (await this.host()).click();
7364
}
7465
}
7566

76-
/**
77-
* Closes the menu.
78-
* @return A promise that resolves when the action is complete.
79-
*/
67+
/** Closes the menu. */
8068
async close(): Promise<void> {
8169
const panel = await this._getMenuPanel();
8270
if (panel) {
@@ -105,7 +93,6 @@ export class MatMenuHarness extends ComponentHarness {
10593
* @param subItemFilters A list of filters representing the items to click in any subsequent
10694
* sub-menus. The first item in the sub-menu matching the corresponding filter in
10795
* `subItemFilters` will be clicked.
108-
* @return A promise that resolves when the action is complete.
10996
*/
11097
async clickItem(
11198
itemFilter: Omit<MenuItemHarnessFilters, 'ancestor'>,
@@ -171,26 +158,17 @@ export class MatMenuItemHarness extends ComponentHarness {
171158
return (await this.host()).text();
172159
}
173160

174-
/**
175-
* Focuses the menu.
176-
* @return A promise that resolves when the action is complete.
177-
*/
161+
/** Focuses the menu item. */
178162
async focus(): Promise<void> {
179163
return (await this.host()).focus();
180164
}
181165

182-
/**
183-
* Blurs the menu.
184-
* @return A promise that resolves when the action is complete.
185-
*/
166+
/** Blurs the menu item. */
186167
async blur(): Promise<void> {
187168
return (await this.host()).blur();
188169
}
189170

190-
/**
191-
* Clicks the menu item.
192-
* @return A promise that resolves when the action is complete.
193-
*/
171+
/** Clicks the menu item. */
194172
async click(): Promise<void> {
195173
return (await this.host()).click();
196174
}

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export class MatRadioGroupHarness extends ComponentHarness {
8484
* Checks a radio button in this group.
8585
* @param filter An optional filter to apply to the child radio buttons. The first tab matching
8686
* the filter will be selected.
87-
* @return A promise that resolves when the action is complete.
8887
*/
8988
async checkRadioButton(filter: RadioButtonHarnessFilters = {}): Promise<void> {
9089
const radioButtons = await this.getRadioButtons(filter);
@@ -178,7 +177,7 @@ export class MatRadioButtonHarness extends ComponentHarness {
178177
private _clickLabel = this.locatorFor('.mat-radio-label');
179178
private _input = this.locatorFor('input');
180179

181-
/** Whether the radio-button is checked. */
180+
/** Gets a boolean promise indicating whether the radio-button is checked. */
182181
async isChecked(): Promise<boolean> {
183182
const checked = (await this._input()).getProperty('checked');
184183
return coerceBooleanProperty(await checked);
@@ -222,26 +221,19 @@ export class MatRadioButtonHarness extends ComponentHarness {
222221
return (await this._textLabel()).text();
223222
}
224223

225-
/**
226-
* Focuses the radio-button.
227-
* @return A promise that resolves when the action is complete.
228-
*/
224+
/** Focuses the radio-button. */
229225
async focus(): Promise<void> {
230226
return (await this._input()).focus();
231227
}
232228

233-
/**
234-
* Blurs the radio-button.
235-
* @return A promise that resolves when the action is complete.
236-
*/
229+
/** Blurs the radio-button. */
237230
async blur(): Promise<void> {
238231
return (await this._input()).blur();
239232
}
240233

241234
/**
242235
* Puts the radio-button in a checked state by clicking it if it is currently unchecked,
243236
* or doing nothing if it is already checked.
244-
* @return A promise that resolves when the action is complete.
245237
*/
246238
async check(): Promise<void> {
247239
if (!(await this.isChecked())) {

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,24 @@ export class MatSlideToggleHarness extends ComponentHarness {
8080
return (await this._label()).text();
8181
}
8282

83-
/**
84-
* Focuses the slide-toggle.
85-
* @return A promise that resolves when the action is complete.
86-
*/
83+
/** Focuses the slide-toggle. */
8784
async focus(): Promise<void> {
8885
return (await this._input()).focus();
8986
}
9087

91-
/**
92-
* Blurs the slide-toggle and returns a void promise that indicates action completion.
93-
* @return A promise that resolves when the action is complete.
94-
*/
88+
/** Blurs the slide-toggle. */
9589
async blur(): Promise<void> {
9690
return (await this._input()).blur();
9791
}
9892

99-
/**
100-
* Toggle the checked state of the slide-toggle.
101-
* @return A promise that resolves when the action is complete.
102-
*/
93+
/** Toggle the checked state of the slide-toggle. */
10394
async toggle(): Promise<void> {
10495
return (await this._inputContainer()).click();
10596
}
10697

10798
/**
10899
* Puts the slide-toggle in a checked state by toggling it if it is currently unchecked, or doing
109100
* nothing if it is already checked.
110-
* @return A promise that resolves when the action is complete.
111101
*/
112102
async check(): Promise<void> {
113103
if (!(await this.isChecked())) {
@@ -118,7 +108,6 @@ export class MatSlideToggleHarness extends ComponentHarness {
118108
/**
119109
* Puts the slide-toggle in an unchecked state by toggling it if it is currently checked, or doing
120110
* nothing if it is already unchecked.
121-
* @return A promise that resolves when the action is complete.
122111
*/
123112
async uncheck(): Promise<void> {
124113
if (await this.isChecked()) {

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ export class MatSliderHarness extends ComponentHarness {
8787
* can happen if not every value of the slider maps to a single pixel that could be
8888
* clicked using mouse interaction. In such cases consider using the keyboard to
8989
* select the given value or expand the slider's size for a better user experience.
90-
*
91-
* @return A promise that resolves when the action is complete.
9290
*/
9391
async setValue(value: number): Promise<void> {
9492
const [sliderEl, wrapperEl, orientation] =
@@ -111,18 +109,12 @@ export class MatSliderHarness extends ComponentHarness {
111109
await wrapperEl.click(relativeX, relativeY);
112110
}
113111

114-
/**
115-
* Focuses the slider.
116-
* @return A promise that resolves when the action is complete.
117-
*/
112+
/** Focuses the slider. */
118113
async focus(): Promise<void> {
119114
return (await this.host()).focus();
120115
}
121116

122-
/**
123-
* Blurs the slider.
124-
* @return A promise that resolves when the action is complete.
125-
*/
117+
/** Blurs the slider. */
126118
async blur(): Promise<void> {
127119
return (await this.host()).blur();
128120
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export class MatSnackBarHarness extends ComponentHarness {
6161
/**
6262
* Dismisses the snack-bar by clicking the action button. Method cannot
6363
* be used for snack-bar's without action or with custom content.
64-
* @return A promise that resolves when the action is complete.
6564
*/
6665
async dismissWithAction(): Promise<void> {
6766
await this._assertSimpleSnackBarWithAction();

src/material/tabs/testing/tab-group-harness.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export class MatTabGroupHarness extends ComponentHarness {
5353
* Selects a tab in this tab group.
5454
* @param filter An optional filter to apply to the child tabs. The first tab matching the filter
5555
* will be selected.
56-
* @return A promise that resolves when the action is complete.
5756
*/
5857
async selectTab(filter: TabHarnessFilters = {}): Promise<void> {
5958
const tabs = await this.getTabs(filter);

src/material/tabs/testing/tab-harness.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ export class MatTabHarness extends ComponentHarness {
5353
return (await hostEl.getAttribute('aria-disabled')) === 'true';
5454
}
5555

56-
/**
57-
* Selects the given tab by clicking on the label. Tab cannot be selected if disabled.
58-
* @return A promise that resolves when the action is complete.
59-
*/
56+
/** Selects the given tab by clicking on the label. Tab cannot be selected if disabled. */
6057
async select(): Promise<void> {
6158
await (await this.host()).click();
6259
}

0 commit comments

Comments
 (0)