Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/test-utils/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ interface BaseWrapper {
selector: Selector | void
}

export interface Wrapper<V extends Vue | null> extends BaseWrapper {
export interface Wrapper<V extends Vue | null, el extends Element = Element> extends BaseWrapper {
readonly vm: V
readonly element: HTMLElement
readonly element: el
readonly options: WrapperOptions

get<R extends Vue> (selector: VueClass<R>): Wrapper<R>
get<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
get<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue>
get (selector: string): Wrapper<Vue>
get<el extends Element>(selector: string): Wrapper<Vue, el>
get (selector: RefSelector): Wrapper<Vue>
get (selector: NameSelector): Wrapper<Vue>

Expand All @@ -96,7 +96,7 @@ export interface Wrapper<V extends Vue | null> extends BaseWrapper {
find<R extends Vue> (selector: VueClass<R>): Wrapper<R>
find<R extends Vue> (selector: ComponentOptions<R>): Wrapper<R>
find<Props = DefaultProps, PropDefs = PropsDefinition<Props>>(selector: FunctionalComponentOptions<Props, PropDefs>): Wrapper<Vue>
find (selector: string): Wrapper<Vue>
find<el extends Element>(selector: string): Wrapper<Vue, el>
find (selector: RefSelector): Wrapper<Vue>
find (selector: NameSelector): Wrapper<Vue>

Expand Down
4 changes: 3 additions & 1 deletion packages/test-utils/types/test/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ wrapper.findComponent(ClassComponent)
wrapper.vm.foo
wrapper.vm.$emit('event', 'arg')

let el: HTMLElement = wrapper.element
let el: Element = wrapper.element

let selector: Selector | void

Expand All @@ -68,6 +68,8 @@ selector = found.selector
found = wrapper.find({ name: 'my-button' })
selector = found.selector

wrapper.find<HTMLInputElement>('input').element.value

let array = wrapper.findAll('.bar')
selector = array.selector
array = wrapper.findAll(normalOptions)
Expand Down