@@ -34,14 +34,12 @@ function MyApp() {
34
34
< UserProvider >
35
35
< Text > Foo!</ Text >
36
36
< Addition />
37
- < AdditionWithTypes />
38
37
</ UserProvider >
39
38
</ View >
40
39
) : null ;
41
40
}
42
41
43
42
let higherScopedSum : number ;
44
- let typedHigherScopedSum : number ;
45
43
// :remove-end:
46
44
47
45
function Addition ( ) {
@@ -70,27 +68,6 @@ function Addition() {
70
68
// :remove-end:
71
69
}
72
70
// :snippet-end:
73
- // :snippet-start: addition-with-types
74
- type FunctionTypes = {
75
- sum : ( a : number , b : number ) => number ;
76
- } & Realm . DefaultFunctionsFactory ;
77
-
78
- function AdditionWithTypes ( ) {
79
- const user = useUser < FunctionTypes , SimpleObject , Realm . DefaultUserProfileData > ( ) ;
80
- async function addNumbers ( numA : number , numB : number ) {
81
- const sum = await user ?. functions . sum ( numA , numB ) ;
82
- // :remove-start:
83
- expect ( sum ) . toBe ( 3 ) ;
84
- typedHigherScopedSum = sum as number ;
85
- // :remove-end:
86
- return sum ;
87
- }
88
- // ...
89
- // :remove-start:
90
- return < Button onPress = { ( ) => addNumbers ( 1 , 2 ) } testID = 'test-typed-function-call' title = 'Test Me!' /> ;
91
- // :remove-end:
92
- }
93
- // :snippet-end:
94
71
95
72
afterEach ( async ( ) => await App . getApp ( APP_ID ) . currentUser ?. logOut ( ) ) ;
96
73
@@ -101,10 +78,3 @@ test('Call Atlas Function', async () => {
101
78
fireEvent . press ( button ) ;
102
79
await waitFor ( ( ) => expect ( higherScopedSum ) . toBe ( 3 ) ) ;
103
80
} ) ;
104
- test ( 'Call Typed Atlas Function' , async ( ) => {
105
- const { getByTestId} = render ( < AppWrapper /> ) ;
106
-
107
- const button = await waitFor ( ( ) => getByTestId ( 'test-typed-function-call' ) ) ;
108
- fireEvent . press ( button ) ;
109
- await waitFor ( ( ) => expect ( higherScopedSum ) . toBe ( 3 ) ) ;
110
- } ) ;
0 commit comments