File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
src/material/autocomplete/testing Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export interface OptionHarnessFilters extends BaseHarnessFilters {
1616}
1717
1818export 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-
Original file line number Diff line number Diff 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 ( ) => {
You can’t perform that action at this time.
0 commit comments