Skip to content

Commit

Permalink
fix: added missing find overrides (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
nandi95 authored Feb 21, 2022
1 parent aa84fed commit 17d5984
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/domWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ export class DOMWrapper<NodeType extends Node> extends BaseWrapper<NodeType> {
return this.element.__vueParentComponent
}

find(selector: string | RefSelector): DOMWrapper<any> {
find<K extends keyof HTMLElementTagNameMap>(
selector: K
): DOMWrapper<HTMLElementTagNameMap[K]>
find<K extends keyof SVGElementTagNameMap>(
selector: K
): DOMWrapper<SVGElementTagNameMap[K]>
find<T extends Element = Element>(selector: string): DOMWrapper<T>
find<T extends Node = Node>(selector: string | RefSelector): DOMWrapper<T>
find(selector: string | RefSelector): DOMWrapper<Node> {
const result = super.find(selector)
if (result.exists() && isRefSelector(selector)) {
return this.element.contains(result.element)
Expand Down

0 comments on commit 17d5984

Please sign in to comment.