forked from vuejs/vue-test-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrapper.flow.js
43 lines (39 loc) · 1.55 KB
/
wrapper.flow.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// @flow
import type Wrapper from '~src/Wrapper'
import type WrapperArray from '~src/WrapperArray'
declare type Selector = any
declare interface BaseWrapper { // eslint-disable-line no-undef
at(index: number): Wrapper | void,
attributes(): { [name: string]: string } | void,
classes(): Array<string> | void,
contains(selector: Selector): boolean | void,
emitted(event?: string): { [name: string]: Array<Array<any>> } | Array<Array<any>> | void,
emittedByOrder(): Array<{ name: string; args: Array<any> }> | void,
exists(): boolean,
filter(predicate: Function): WrapperArray | void,
visible(): boolean | void,
hasAttribute(attribute: string, value: string): boolean | void,
hasClass(className: string): boolean | void,
hasProp(prop: string, value: string): boolean | void,
hasStyle(style: string, value: string): boolean | void,
find(selector: Selector): Wrapper | void,
findAll(selector: Selector): WrapperArray | void,
html(): string | void,
is(selector: Selector): boolean | void,
isEmpty(): boolean | void,
isVisible(): boolean | void,
isVueInstance(): boolean | void,
name(): string | void,
props(): { [name: string]: any } | void,
text(): string | void,
setData(data: Object): void,
setComputed(computed: Object): void,
setMethods(methods: Object): void,
setProps(data: Object): void,
trigger(type: string, options: Object): void,
destroy(): void
}
declare type WrapperOptions = { // eslint-disable-line no-undef
attachedToDocument: boolean,
sync?: boolean
}