Skip to content

Commit dafd8f6

Browse files
committed
fix type of click args
1 parent 4ee107d commit dafd8f6

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/cdk/testing/protractor/protractor-element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class ProtractorElement implements TestElement {
8080
return this.element.clear();
8181
}
8282

83-
async click(...args: ['center'] | [number, number]): Promise<void> {
83+
async click(...args: [] | ['center'] | [number, number]): Promise<void> {
8484
// Omitting the offset argument to mouseMove results in clicking the center.
8585
// This is the default behavior we want, so we use an empty array of offsetArgs if no args are
8686
// passed to this method.

src/cdk/testing/testbed/unit-test-element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class UnitTestElement implements TestElement {
7878
await this._stabilize();
7979
}
8080

81-
async click(...args: ['center'] | [number, number]): Promise<void> {
81+
async click(...args: [] | ['center'] | [number, number]): Promise<void> {
8282
let clientX: number | undefined = undefined;
8383
let clientY: number | undefined = undefined;
8484
if (args.length) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export class MatButtonHarness extends ComponentHarness {
4747
click(location: 'center'): Promise<void>;
4848
/** Clicks the button. */
4949
click(): Promise<void>;
50-
async click(...args: ['center'] | [number, number]): Promise<void> {
51-
return (await this.host()).click(...(args as [any]));
50+
async click(...args: [] | ['center'] | [number, number]): Promise<void> {
51+
return (await this.host()).click(...(args as []));
5252
}
5353

5454
/** Gets a boolean promise indicating if the button is disabled. */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export class MatButtonHarness extends ComponentHarness {
4747
click(location: 'center'): Promise<void>;
4848
/** Clicks the button. */
4949
click(): Promise<void>;
50-
async click(...args: ['center'] | [number, number]): Promise<void> {
51-
return (await this.host()).click(...(args as [any]));
50+
async click(...args: [] | ['center'] | [number, number]): Promise<void> {
51+
return (await this.host()).click(...(args as []));
5252
}
5353

5454
/** Whether the button is disabled. */

tools/public_api_guard/cdk/testing/protractor.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export declare class ProtractorElement implements TestElement {
33
constructor(element: ElementFinder);
44
blur(): Promise<void>;
55
clear(): Promise<void>;
6-
click(...args: ['center'] | [number, number]): Promise<void>;
6+
click(...args: [] | ['center'] | [number, number]): Promise<void>;
77
focus(): Promise<void>;
88
getAttribute(name: string): Promise<string | null>;
99
getCssValue(property: string): Promise<string>;

tools/public_api_guard/cdk/testing/testbed.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export declare class UnitTestElement implements TestElement {
2020
constructor(element: Element, _stabilize: () => Promise<void>);
2121
blur(): Promise<void>;
2222
clear(): Promise<void>;
23-
click(...args: ['center'] | [number, number]): Promise<void>;
23+
click(...args: [] | ['center'] | [number, number]): Promise<void>;
2424
focus(): Promise<void>;
2525
getAttribute(name: string): Promise<string | null>;
2626
getCssValue(property: string): Promise<string>;

0 commit comments

Comments
 (0)