File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
material-experimental/mdc-button/testing
tools/public_api_guard/material/button Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,18 @@ export class MatButtonHarness extends ComponentHarness {
37
37
( harness , text ) => HarnessPredicate . stringMatches ( harness . getText ( ) , text ) ) ;
38
38
}
39
39
40
+ /**
41
+ * Clicks the button at the given position relative to its top-left.
42
+ * @param relativeX The relative x position of the click.
43
+ * @param relativeY The relative y position of the click.
44
+ */
45
+ click ( relativeX : number , relativeY : number ) : Promise < void > ;
46
+ /** Clicks the button at its center. */
47
+ click ( location : 'center' ) : Promise < void > ;
40
48
/** Clicks the button. */
41
- async click ( ) : Promise < void > {
42
- return ( await this . host ( ) ) . click ( ) ;
49
+ click ( ) : Promise < void > ;
50
+ async click ( ...args : [ 'center' ] | [ number , number ] ) : Promise < void > {
51
+ return ( await this . host ( ) ) . click ( ...( args as [ any ] ) ) ;
43
52
}
44
53
45
54
/** Gets a boolean promise indicating if the button is disabled. */
Original file line number Diff line number Diff line change @@ -37,9 +37,18 @@ export class MatButtonHarness extends ComponentHarness {
37
37
( harness , text ) => HarnessPredicate . stringMatches ( harness . getText ( ) , text ) ) ;
38
38
}
39
39
40
+ /**
41
+ * Clicks the button at the given position relative to its top-left.
42
+ * @param relativeX The relative x position of the click.
43
+ * @param relativeY The relative y position of the click.
44
+ */
45
+ click ( relativeX : number , relativeY : number ) : Promise < void > ;
46
+ /** Clicks the button at its center. */
47
+ click ( location : 'center' ) : Promise < void > ;
40
48
/** Clicks the button. */
41
- async click ( ) : Promise < void > {
42
- return ( await this . host ( ) ) . click ( ) ;
49
+ click ( ) : Promise < void > ;
50
+ async click ( ...args : [ 'center' ] | [ number , number ] ) : Promise < void > {
51
+ return ( await this . host ( ) ) . click ( ...( args as [ any ] ) ) ;
43
52
}
44
53
45
54
/** Whether the button is disabled. */
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ export interface ButtonHarnessFilters extends BaseHarnessFilters {
4
4
5
5
export declare class MatButtonHarness extends ComponentHarness {
6
6
blur ( ) : Promise < void > ;
7
+ click ( relativeX : number , relativeY : number ) : Promise < void > ;
8
+ click ( location : 'center' ) : Promise < void > ;
7
9
click ( ) : Promise < void > ;
8
10
focus ( ) : Promise < void > ;
9
11
getText ( ) : Promise < string > ;
You can’t perform that action at this time.
0 commit comments