Skip to content

Commit

Permalink
Merge pull request #54 from grafana/async/element-handle-null
Browse files Browse the repository at this point in the history
Return Promise<string | null> from `elementHandle.textContent()`
  • Loading branch information
allansson authored Jun 18, 2024
2 parents 134104e + a9fede2 commit ec7918a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/k6/experimental/browser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ export interface ElementHandle extends JSHandle {
* Returns the `node.textContent`.
* @returns The text content of the element.
*/
textContent(): Promise<string>;
textContent(): Promise<string | null>;

/**
* Scrolls element into view, focuses element and types text.
Expand Down
2 changes: 1 addition & 1 deletion types/k6/test/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ async function test() {
// $ExpectType Promise<void>
elementHandle.tap({ trial: true });

// $ExpectType Promise<string>
// $ExpectType Promise<string | null>
elementHandle.textContent();

// @ts-expect-error
Expand Down

0 comments on commit ec7918a

Please sign in to comment.