Skip to content

Commit c63f552

Browse files
authored
docs(cdk/testing): expand JsDoc for sendKeys with limitations (#23902)
This change is in response to feedback that it's not obvious that `TestElement.sendKeys` may behave differently in different environments. To help a tiny bit, we expand the JsDoc for `sendKeys` to mentions that it cannot reproduce native keyboard shortcuts in all environments.
1 parent edc2aa3 commit c63f552

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/cdk/testing/test-element.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ export interface TestElement {
117117

118118
/**
119119
* Sends the given string to the input as a series of key presses. Also fires input events
120-
* and attempts to add the string to the Element's value.
120+
* and attempts to add the string to the Element's value. Note that some environments cannot
121+
* reproduce native browser behavior for keyboard shortcuts such as Tab, Ctrl + A, etc.
121122
*/
122123
sendKeys(...keys: (string | TestKey)[]): Promise<void>;
123124

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export class UnitTestElement implements TestElement {
148148

149149
/**
150150
* Sends the given string to the input as a series of key presses. Also fires input events
151-
* and attempts to add the string to the Element's value.
151+
* and attempts to add the string to the Element's value. Note that this cannot
152+
* reproduce native browser behavior for keyboard shortcuts such as Tab, Ctrl + A, etc.
152153
*/
153154
async sendKeys(...keys: (string | TestKey)[]): Promise<void>;
154155
/**

0 commit comments

Comments
 (0)