Skip to content

Commit 0e50b9c

Browse files
committed
address comments
1 parent 473e75e commit 0e50b9c

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export class MatAutocompleteHarness extends ComponentHarness {
8080
MatAutocompleteOptionGroupHarness.with(filters))();
8181
}
8282

83-
/** Selects the first options matching the given filters. */
84-
async selectOption(filters: OptionHarnessFilters = {}): Promise<void> {
83+
/** Selects the first option matching the given filters. */
84+
async selectOption(filters: OptionHarnessFilters): Promise<void> {
8585
await this.focus(); // Focus the input to make sure the autocomplete panel is shown.
8686
const options = await this.getOptions(filters);
8787
if (!options.length) {

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface OptionHarnessFilters extends BaseHarnessFilters {
1616
}
1717

1818
export interface OptionGroupHarnessFilters extends BaseHarnessFilters {
19-
text?: string | RegExp;
19+
labelText?: string | RegExp;
2020
}
2121

2222
/**
@@ -53,13 +53,12 @@ export class MatAutocompleteOptionGroupHarness extends ComponentHarness {
5353

5454
static with(options: OptionGroupHarnessFilters = {}) {
5555
return new HarnessPredicate(MatAutocompleteOptionGroupHarness, options)
56-
.addOption('text', options.text,
57-
(harness, title) => HarnessPredicate.stringMatches(harness.getText(), title));
56+
.addOption('labelText', options.labelText,
57+
(harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label));
5858
}
5959

6060
/** Gets a promise for the option group's label text. */
61-
async getText(): Promise<string> {
61+
async getLabelText(): Promise<string> {
6262
return (await this._label()).text();
6363
}
6464
}
65-

src/material/autocomplete/testing/shared.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ export function runHarnessTests(
108108
it('should be able to get filtered panel groups', async () => {
109109
const input = await loader.getHarness(autocompleteHarness.with({selector: '#grouped'}));
110110
await input.focus();
111-
const groups = await input.getOptionGroups({text: 'Two'});
111+
const groups = await input.getOptionGroups({labelText: 'Two'});
112112

113113
expect(groups.length).toBe(1);
114-
expect(await groups[0].getText()).toBe('Two');
114+
expect(await groups[0].getLabelText()).toBe('Two');
115115
});
116116

117117
it('should be able to get whether the autocomplete is open', async () => {

0 commit comments

Comments
 (0)