mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Cavy/add focus types (#41474)
* add focus function type * add tests * change version number
This commit is contained in:
parent
7f55f31f78
commit
d1c81ed0e1
@ -54,7 +54,7 @@ class SampleComponent extends React.Component<Props> {
|
||||
|
||||
<Text>{foo}</Text>
|
||||
|
||||
<TextInput ref={generateTestHook('Input', this.setTextInputRef)} />
|
||||
<TextInput ref={generateTestHook('Input', this.setTextInputRef)} onFocus={() => {}}/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@ -78,6 +78,7 @@ function sampleSpec(spec: TestScope) {
|
||||
spec.findComponent('View'); // $ExpectType Promise<Component<{}, {}, any>>
|
||||
spec.press('View'); // $ExpectType Promise<void>
|
||||
spec.fillIn('Input', 'hello world'); // $ExpectType Promise<void>
|
||||
spec.focus('Input'); // $ExpectType Promise<void>
|
||||
spec.pause(1000); // $ExpectType Promise<void>
|
||||
spec.exists('View'); // $ExpectType Promise<true>
|
||||
spec.notExists('View.MissingSample'); // $ExpectType Promise<true>
|
||||
|
||||
3
types/cavy/index.d.ts
vendored
3
types/cavy/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for cavy 3.1
|
||||
// Type definitions for cavy 3.2
|
||||
// Project: https://github.com/pixielabs/cavy
|
||||
// Definitions by: Tyler Hoffman <https://github.com/tyler-hoffman>
|
||||
// Abigail McPhillips <https://github.com/AbigailMcP>
|
||||
@ -53,6 +53,7 @@ export class TestScope {
|
||||
beforeEach(fn: () => void): void;
|
||||
press(identifier: string): Promise<void>;
|
||||
fillIn(identifier: string, str: string): Promise<void>;
|
||||
focus(identifier: string): Promise<void>;
|
||||
pause(time: number): Promise<void>;
|
||||
exists(identifier: string): Promise<true>;
|
||||
notExists(identifier: string): Promise<true>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user