From f36353f1347dee8d5782b52c16a2c73a8ccad713 Mon Sep 17 00:00:00 2001 From: Younes Jaaidi Date: Fri, 20 Nov 2020 19:07:10 +0100 Subject: [PATCH] docs(cdk/testing): document TestElement methods Add missing documentation for freshly added methods: `setInputValue`, `selectOptions` & `dispatchEvent`. --- src/cdk/testing/test-harnesses.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cdk/testing/test-harnesses.md b/src/cdk/testing/test-harnesses.md index 848ca91923b4..049d71862fc8 100644 --- a/src/cdk/testing/test-harnesses.md +++ b/src/cdk/testing/test-harnesses.md @@ -299,6 +299,9 @@ The functions created with the locator methods described above all return `TestE | `getDimensions(): Promise` | Gets the dimensions of the element. | | `getProperty(name: string): Promise` | Gets the value of the given JS property for the element. | | `matchesSelector(selector: string): Promise` | Checks whether the element matches the given CSS selector. | +| `setInputValue(value: string): Promise;` | Sets the value of a property of an input. | +| `selectOptions(...optionIndexes: number[]): Promise;` | Selects the options at the specified indexes inside of a native `select` element. | +| `dispatchEvent(name: string, data?: Record): Promise;` | Dispatches an event with a particular name. | `TestElement` is an abstraction designed to work across different test environments (Karma, Protractor, etc). When using harnesses, you should perform all DOM interaction via this interface. @@ -599,6 +602,9 @@ result of the operation. | `getDimensions(): Promise` | Gets the dimensions of the element. | | `getProperty(name: string): Promise` | Gets the value of the given property for the element. | | `matchesSelector(selector: string): Promise` | Checks whether the given selector matches the element. | +| `setInputValue(value: string): Promise;` | Sets the value of a property of an input. | +| `selectOptions(...optionIndexes: number[]): Promise;` | Selects the options at the specified indexes inside of a native `select` element. | +| `dispatchEvent(name: string, data?: Record): Promise;` | Dispatches an event with a particular name. | The `TestElement` interface consists largely of methods that resemble methods available on `HTMLElement`; similar methods exist in most test environments, which makes