Skip to content

Commit e296281

Browse files
committed
update async method descriptions per team discussion
1 parent d6addeb commit e296281

File tree

16 files changed

+92
-97
lines changed

16 files changed

+92
-97
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ export class MatAutocompleteHarness extends ComponentHarness {
3939
(harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
4040
}
4141

42-
/** Gets a promise for the value of the autocomplete input. */
42+
/** Gets the value of the autocomplete input. */
4343
async getValue(): Promise<string> {
4444
return (await this.host()).getProperty('value');
4545
}
4646

47-
/** Gets a boolean promise indicating if the autocomplete input is disabled. */
47+
/** Whether the autocomplete input is disabled. */
4848
async isDisabled(): Promise<boolean> {
4949
const disabled = (await this.host()).getAttribute('disabled');
5050
return coerceBooleanProperty(await disabled);
@@ -65,12 +65,12 @@ export class MatAutocompleteHarness extends ComponentHarness {
6565
return (await this.host()).sendKeys(value);
6666
}
6767

68-
/** Gets a promise for the options inside the autocomplete panel. */
68+
/** Gets the options inside the autocomplete panel. */
6969
async getOptions(filters: OptionHarnessFilters = {}): Promise<MatAutocompleteOptionHarness[]> {
7070
return this._documentRootLocator.locatorForAll(MatAutocompleteOptionHarness.with(filters))();
7171
}
7272

73-
/** Gets a promise for the option groups inside the panel. */
73+
/** Gets the option groups inside the autocomplete panel. */
7474
async getOptionGroups(filters: OptionGroupHarnessFilters = {}):
7575
Promise<MatAutocompleteOptionGroupHarness[]> {
7676
return this._documentRootLocator.locatorForAll(
@@ -87,7 +87,7 @@ export class MatAutocompleteHarness extends ComponentHarness {
8787
await options[0].select();
8888
}
8989

90-
/** Gets a boolean promise indicating whether the autocomplete is open. */
90+
/** Whether the autocomplete is open. */
9191
async isOpen(): Promise<boolean> {
9292
const panel = await this._optionalPanel();
9393
return !!panel && await panel.hasClass('mat-autocomplete-visible');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class MatAutocompleteOptionHarness extends ComponentHarness {
5050
return (await this.host()).click();
5151
}
5252

53-
/** Gets a promise for the option's label text. */
53+
/** Gets the option's label text. */
5454
async getText(): Promise<string> {
5555
return (await this.host()).text();
5656
}
@@ -75,7 +75,7 @@ export class MatAutocompleteOptionGroupHarness extends ComponentHarness {
7575
(harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label));
7676
}
7777

78-
/** Gets a promise for the option group's label text. */
78+
/** Gets the option group's label text. */
7979
async getLabelText(): Promise<string> {
8080
return (await this._label()).text();
8181
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ export class MatButtonHarness extends ComponentHarness {
4242
return (await this.host()).click();
4343
}
4444

45-
/** Gets a boolean promise indicating if the button is disabled. */
45+
/** Whether the button is disabled. */
4646
async isDisabled(): Promise<boolean> {
4747
const disabled = (await this.host()).getAttribute('disabled');
4848
return coerceBooleanProperty(await disabled);
4949
}
5050

51-
/** Gets a promise for the button's label text. */
51+
/** Gets the button's label text. */
5252
async getText(): Promise<string> {
5353
return (await this.host()).text();
5454
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,57 +36,57 @@ export class MatCheckboxHarness extends ComponentHarness {
3636
private _input = this.locatorFor('input');
3737
private _inputContainer = this.locatorFor('.mat-checkbox-inner-container');
3838

39-
/** Gets a boolean promise indicating if the checkbox is checked. */
39+
/** Whether the checkbox is checked. */
4040
async isChecked(): Promise<boolean> {
4141
const checked = (await this._input()).getProperty('checked');
4242
return coerceBooleanProperty(await checked);
4343
}
4444

45-
/** Gets a boolean promise indicating if the checkbox is in an indeterminate state. */
45+
/** Whether the checkbox is in an indeterminate state. */
4646
async isIndeterminate(): Promise<boolean> {
4747
const indeterminate = (await this._input()).getProperty('indeterminate');
4848
return coerceBooleanProperty(await indeterminate);
4949
}
5050

51-
/** Gets a boolean promise indicating if the checkbox is disabled. */
51+
/** Whether the checkbox is disabled. */
5252
async isDisabled(): Promise<boolean> {
5353
const disabled = (await this._input()).getAttribute('disabled');
5454
return coerceBooleanProperty(await disabled);
5555
}
5656

57-
/** Gets a boolean promise indicating if the checkbox is required. */
57+
/** Whether the checkbox is required. */
5858
async isRequired(): Promise<boolean> {
5959
const required = (await this._input()).getProperty('required');
6060
return coerceBooleanProperty(await required);
6161
}
6262

63-
/** Gets a boolean promise indicating if the checkbox is valid. */
63+
/** Whether the checkbox is valid. */
6464
async isValid(): Promise<boolean> {
6565
const invalid = (await this.host()).hasClass('ng-invalid');
6666
return !(await invalid);
6767
}
6868

69-
/** Gets a promise for the checkbox's name. */
69+
/** Gets the checkbox's name. */
7070
async getName(): Promise<string|null> {
7171
return (await this._input()).getAttribute('name');
7272
}
7373

74-
/** Gets a promise for the checkbox's value. */
74+
/** Gets the checkbox's value. */
7575
async getValue(): Promise<string|null> {
7676
return (await this._input()).getProperty('value');
7777
}
7878

79-
/** Gets a promise for the checkbox's aria-label. */
79+
/** Gets the checkbox's aria-label. */
8080
async getAriaLabel(): Promise<string|null> {
8181
return (await this._input()).getAttribute('aria-label');
8282
}
8383

84-
/** Gets a promise for the checkbox's aria-labelledby. */
84+
/** Gets the checkbox's aria-labelledby. */
8585
async getAriaLabelledby(): Promise<string|null> {
8686
return (await this._input()).getAttribute('aria-labelledby');
8787
}
8888

89-
/** Gets a promise for the checkbox's label text. */
89+
/** Gets the checkbox's label text. */
9090
async getLabelText(): Promise<string> {
9191
return (await this._label()).text();
9292
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ export class MatDialogHarness extends ComponentHarness {
2727
return new HarnessPredicate(MatDialogHarness, options);
2828
}
2929

30-
/** Gets a promise for the id of the dialog. */
30+
/** Gets the id of the dialog. */
3131
async getId(): Promise<string|null> {
3232
const id = await (await this.host()).getAttribute('id');
3333
// In case no id has been specified, the "id" property always returns
3434
// an empty string. To make this method more explicit, we return null.
3535
return id !== '' ? id : null;
3636
}
3737

38-
/** Gets a promise for the role of the dialog. */
38+
/** Gets the role of the dialog. */
3939
async getRole(): Promise<DialogRole|null> {
4040
return (await this.host()).getAttribute('role') as Promise<DialogRole|null>;
4141
}
4242

43-
/** Gets a promise for the value of the dialog's "aria-label" attribute. */
43+
/** Gets the value of the dialog's "aria-label" attribute. */
4444
async getAriaLabel(): Promise<string|null> {
4545
return (await this.host()).getAttribute('aria-label');
4646
}
4747

48-
/** Gets a promise for the value of the dialog's "aria-labelledby" attribute. */
48+
/** Gets the value of the dialog's "aria-labelledby" attribute. */
4949
async getAriaLabelledby(): Promise<string|null> {
5050
return (await this.host()).getAttribute('aria-labelledby');
5151
}
5252

53-
/** Gets a promise for the value of the dialog's "aria-describedby" attribute. */
53+
/** Gets the value of the dialog's "aria-describedby" attribute. */
5454
async getAriaDescribedby(): Promise<string|null> {
5555
return (await this.host()).getAttribute('aria-describedby');
5656
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ export class MatMenuHarness extends ComponentHarness {
3131
(harness, text) => HarnessPredicate.stringMatches(harness.getTriggerText(), text));
3232
}
3333

34-
/** Gets a boolean promise indicating if the menu is disabled. */
34+
/** Whether the menu is disabled. */
3535
async isDisabled(): Promise<boolean> {
3636
const disabled = (await this.host()).getAttribute('disabled');
3737
return coerceBooleanProperty(await disabled);
3838
}
3939

40-
/** Gets a boolean promise indicating whether the menu is open. */
40+
/** Whether the menu is open. */
4141
async isOpen(): Promise<boolean> {
4242
return !!(await this._getMenuPanel());
4343
}
4444

45-
/** Gets a promise for the text of the menu's trigger element. */
45+
/** Gets the text of the menu's trigger element. */
4646
async getTriggerText(): Promise<string> {
4747
return (await this.host()).text();
4848
}
@@ -73,7 +73,7 @@ export class MatMenuHarness extends ComponentHarness {
7373
}
7474

7575
/**
76-
* Gets a promise for a list of `MatMenuItemHarness` representing the items in the menu.
76+
* Gets a list of `MatMenuItemHarness` representing the items in the menu.
7777
* @param filters Optionally filters which menu items are included.
7878
*/
7979
async getItems(filters: Omit<MenuItemHarnessFilters, 'ancestor'> = {}):
@@ -114,13 +114,13 @@ export class MatMenuHarness extends ComponentHarness {
114114
return menu.clickItem(...subItemFilters as [Omit<MenuItemHarnessFilters, 'ancestor'>]);
115115
}
116116

117-
/** Gets a promise for the menu panel associated with this menu. */
117+
/** Gets the menu panel associated with this menu. */
118118
private async _getMenuPanel(): Promise<TestElement | null> {
119119
const panelId = await this._getPanelId();
120120
return panelId ? this._documentRootLocator.locatorForOptional(`#${panelId}`)() : null;
121121
}
122122

123-
/** Gets a promise for the id of the menu panel associated with this menu. */
123+
/** Gets the id of the menu panel associated with this menu. */
124124
private async _getPanelId(): Promise<string | null> {
125125
const panelId = await (await this.host()).getAttribute('aria-controls');
126126
return panelId || null;
@@ -147,13 +147,13 @@ export class MatMenuItemHarness extends ComponentHarness {
147147
async (harness, hasSubmenu) => (await harness.hasSubmenu()) === hasSubmenu);
148148
}
149149

150-
/** Gets a boolean promise indicating if the menu is disabled. */
150+
/** Whether the menu is disabled. */
151151
async isDisabled(): Promise<boolean> {
152152
const disabled = (await this.host()).getAttribute('disabled');
153153
return coerceBooleanProperty(await disabled);
154154
}
155155

156-
/** Gets a promise for the text of the menu item. */
156+
/** Gets the text of the menu item. */
157157
async getText(): Promise<string> {
158158
return (await this.host()).text();
159159
}
@@ -173,12 +173,12 @@ export class MatMenuItemHarness extends ComponentHarness {
173173
return (await this.host()).click();
174174
}
175175

176-
/** Gets a boolean promise indicating whether this item has a submenu. */
176+
/** Whether this item has a submenu. */
177177
async hasSubmenu(): Promise<boolean> {
178178
return (await this.host()).matchesSelector(MatMenuHarness.hostSelector);
179179
}
180180

181-
/** Gets a promise for the submenu associated with this menu item, or null if none. */
181+
/** Gets the submenu associated with this menu item, or null if none. */
182182
async getSubmenu(): Promise<MatMenuHarness | null> {
183183
if (await this.hasSubmenu()) {
184184
return new MatMenuHarness(this.locatorFactory);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export class MatProgressBarHarness extends ComponentHarness {
2525
return new HarnessPredicate(MatProgressBarHarness, options);
2626
}
2727

28-
/** Gets a promise for the progress bar's value. */
28+
/** Gets the progress bar's value. */
2929
async getValue(): Promise<number|null> {
3030
const host = await this.host();
3131
const ariaValue = await host.getAttribute('aria-valuenow');
3232
return ariaValue ? coerceNumberProperty(ariaValue) : null;
3333
}
3434

35-
/** Gets a promise for the progress bar's mode. */
35+
/** Gets the progress bar's mode. */
3636
async getMode(): Promise<string|null> {
3737
return (await this.host()).getAttribute('mode');
3838
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export class MatProgressSpinnerHarness extends ComponentHarness {
2727
return new HarnessPredicate(MatProgressSpinnerHarness, options);
2828
}
2929

30-
/** Gets a promise for the progress spinner's value. */
30+
/** Gets the progress spinner's value. */
3131
async getValue(): Promise<number|null> {
3232
const host = await this.host();
3333
const ariaValue = await host.getAttribute('aria-valuenow');
3434
return ariaValue ? coerceNumberProperty(ariaValue) : null;
3535
}
3636

37-
/** Gets a promise for the progress spinner's mode. */
37+
/** Gets the progress spinner's mode. */
3838
async getMode(): Promise<ProgressSpinnerMode> {
3939
const modeAttr = (await this.host()).getAttribute('mode');
4040
return await modeAttr as ProgressSpinnerMode;

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

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class MatRadioGroupHarness extends ComponentHarness {
2626
.addOption('name', options.name, this._checkRadioGroupName);
2727
}
2828

29-
/** Gets a promise for the name of the radio-group. */
29+
/** Gets the name of the radio-group. */
3030
async getName(): Promise<string|null> {
3131
const hostName = await this._getGroupNameFromHost();
3232
// It's not possible to always determine the "name" of a radio-group by reading
@@ -48,12 +48,12 @@ export class MatRadioGroupHarness extends ComponentHarness {
4848
return radioNames[0]!;
4949
}
5050

51-
/** Gets a promise for the id of the radio-group. */
51+
/** Gets the id of the radio-group. */
5252
async getId(): Promise<string|null> {
5353
return (await this.host()).getProperty('id');
5454
}
5555

56-
/** Gets a promise for the checked radio-button in a radio-group. */
56+
/** Gets the checked radio-button in a radio-group. */
5757
async getCheckedRadioButton(): Promise<MatRadioButtonHarness|null> {
5858
for (let radioButton of await this.getRadioButtons()) {
5959
if (await radioButton.isChecked()) {
@@ -63,7 +63,7 @@ export class MatRadioGroupHarness extends ComponentHarness {
6363
return null;
6464
}
6565

66-
/** Gets a promise for the checked value of the radio-group. */
66+
/** Gets the checked value of the radio-group. */
6767
async getCheckedValue(): Promise<string|null> {
6868
const checkedRadio = await this.getCheckedRadioButton();
6969
if (!checkedRadio) {
@@ -73,7 +73,7 @@ export class MatRadioGroupHarness extends ComponentHarness {
7373
}
7474

7575
/**
76-
* Gets a promise for a list of radio buttons which are part of the radio-group.
76+
* Gets a list of radio buttons which are part of the radio-group.
7777
* @param filter Optionally filters which radio buttons are included.
7878
*/
7979
async getRadioButtons(filter: RadioButtonHarnessFilters = {}): Promise<MatRadioButtonHarness[]> {
@@ -93,12 +93,12 @@ export class MatRadioGroupHarness extends ComponentHarness {
9393
return radioButtons[0].check();
9494
}
9595

96-
/** Gets a promise for the name attribute of the host element. */
96+
/** Gets the name attribute of the host element. */
9797
private async _getGroupNameFromHost() {
9898
return (await this.host()).getAttribute('name');
9999
}
100100

101-
/** Gets a promise for list of the name attributes of all child radio buttons. */
101+
/** Gets a list of the name attributes of all child radio buttons. */
102102
private async _getNamesFromRadioButtons(): Promise<string[]> {
103103
const groupNames: string[] = [];
104104
for (let radio of await this.getRadioButtons()) {
@@ -177,37 +177,36 @@ export class MatRadioButtonHarness extends ComponentHarness {
177177
private _clickLabel = this.locatorFor('.mat-radio-label');
178178
private _input = this.locatorFor('input');
179179

180-
/** Gets a boolean promise indicating whether the radio-button is checked. */
180+
/** Whether the radio-button is checked. */
181181
async isChecked(): Promise<boolean> {
182182
const checked = (await this._input()).getProperty('checked');
183183
return coerceBooleanProperty(await checked);
184184
}
185185

186-
/** Gets a boolean promise indicating whether the radio-button is disabled. */
186+
/** Whether the radio-button is disabled. */
187187
async isDisabled(): Promise<boolean> {
188188
const disabled = (await this._input()).getAttribute('disabled');
189189
return coerceBooleanProperty(await disabled);
190190
}
191191

192-
/** Gets a boolean promise indicating whether the radio-button is required. */
192+
/** Whether the radio-button is required. */
193193
async isRequired(): Promise<boolean> {
194194
const required = (await this._input()).getAttribute('required');
195195
return coerceBooleanProperty(await required);
196196
}
197197

198-
/** Gets a promise for the radio-button's name. */
198+
/** Gets the radio-button's name. */
199199
async getName(): Promise<string|null> {
200200
return (await this._input()).getAttribute('name');
201201
}
202202

203-
/** Gets a promise for the radio-button's id. */
203+
/** Gets the radio-button's id. */
204204
async getId(): Promise<string|null> {
205205
return (await this.host()).getProperty('id');
206206
}
207207

208208
/**
209-
* Gets a promise for the value of the radio-button. The radio-button value will be
210-
* converted to a string.
209+
* Gets the value of the radio-button. The radio-button value will be converted to a string.
211210
*
212211
* Note: This means that for radio-button's with an object as a value `[object Object]` is
213212
* intentionally returned.
@@ -216,7 +215,7 @@ export class MatRadioButtonHarness extends ComponentHarness {
216215
return (await this._input()).getProperty('value');
217216
}
218217

219-
/** Gets a promise for the radio-button's label text. */
218+
/** Gets the radio-button's label text. */
220219
async getLabelText(): Promise<string> {
221220
return (await this._textLabel()).text();
222221
}

0 commit comments

Comments
 (0)