Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit ca7760d

Browse files
author
Brandon Carroll
committed
fix(typescript): correct typings for container argument of queries
closes #30, closes #35
1 parent 00c6139 commit ca7760d

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

typings/queries.d.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
1-
import { ReactTestRenderer } from 'react-test-renderer';
2-
31
import { Matcher, MatcherOptions } from './matches';
42
import { WaitForElementOptions } from './wait-for-element';
53
import { NativeTestInstance, SelectorMatcherOptions } from './query-helpers';
64

75
export type QueryByBoundProp = (
8-
testRenderer: ReactTestRenderer,
6+
container: NativeTestInstance,
97
id: Matcher,
108
options?: MatcherOptions,
119
) => NativeTestInstance | null;
1210

1311
export type AllByBoundProp = (
14-
testRenderer: ReactTestRenderer,
12+
container: NativeTestInstance,
1513
id: Matcher,
1614
options?: MatcherOptions,
1715
) => NativeTestInstance[];
1816

1917
export type FindAllByBoundProp = (
20-
testRenderer: ReactTestRenderer,
18+
container: NativeTestInstance,
2119
id: Matcher,
2220
options?: MatcherOptions,
2321
) => Promise<NativeTestInstance[]>;
2422

2523
export type GetByBoundProp = (
26-
testRenderer: ReactTestRenderer,
24+
container: NativeTestInstance,
2725
id: Matcher,
2826
options?: MatcherOptions,
2927
) => NativeTestInstance;
3028

3129
export type FindByBoundProp = (
32-
testRenderer: ReactTestRenderer,
30+
container: NativeTestInstance,
3331
id: Matcher,
3432
options?: MatcherOptions,
3533
waitForElementOptions?: WaitForElementOptions,
3634
) => Promise<NativeTestInstance>;
3735

3836
export type QueryByText = (
39-
testRenderer: ReactTestRenderer,
37+
container: NativeTestInstance,
4038
id: Matcher,
4139
options?: SelectorMatcherOptions,
4240
) => NativeTestInstance | null;
4341

4442
export type AllByText = (
45-
testRenderer: ReactTestRenderer,
43+
container: NativeTestInstance,
4644
id: Matcher,
4745
options?: SelectorMatcherOptions,
4846
) => NativeTestInstance[];
4947

5048
export type FindAllByText = (
51-
testRenderer: ReactTestRenderer,
49+
container: NativeTestInstance,
5250
id: Matcher,
5351
options?: MatcherOptions,
5452
waitForElementOptions?: WaitForElementOptions,
5553
) => Promise<NativeTestInstance[]>;
5654

5755
export type GetByText = (
58-
testRenderer: ReactTestRenderer,
56+
container: NativeTestInstance,
5957
id: Matcher,
6058
options?: WaitForElementOptions,
6159
) => NativeTestInstance;
6260

6361
export type FindByText = (
64-
testRenderer: ReactTestRenderer,
62+
container: NativeTestInstance,
6563
id: Matcher,
6664
options?: MatcherOptions,
6765
waitForElementOptions?: WaitForElementOptions,

typings/query-helpers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type SelectorMatcherOptions = Omit<MatcherOptions, 'selector'> & {
99
};
1010

1111
type ReactTestInstance = {
12-
getProp: (str: string) => NativeTestInstance;
12+
getProp: (name: string) => NativeTestInstance;
1313
};
1414

1515
export type NativeTestInstance = Omit<

0 commit comments

Comments
 (0)