Skip to content

Commit ae3ee7c

Browse files
Merge pull request #140 from skyflowapi/SK-2869-Dependency-upgrades-skyflow-react-native
SK-2869 Dependency upgrades for outdated pkgs
2 parents 11d934f + be8de28 commit ae3ee7c

22 files changed

Lines changed: 2270 additions & 2771 deletions

File tree

‎.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
min-release-age=14
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
Copyright (c) 2022 Skyflow, Inc.
3+
*/
4+
import React from 'react';
5+
import { render } from '@testing-library/react-native';
6+
import { Text } from 'react-native';
7+
import ComposableContainer from '../../src/components/ComposableContainer';
8+
import CoreComposableContainer from '../../src/core/ComposableContainer';
9+
import Skyflow from '../../src/core/Skyflow';
10+
11+
const testSkyflowClient = new Skyflow({
12+
vaultID: '1234',
13+
vaultURL: 'https://url.com',
14+
getBearerToken: () => Promise.resolve('valid_token'),
15+
});
16+
17+
const makeContainer = (layout) =>
18+
new CoreComposableContainer(testSkyflowClient, {
19+
layout,
20+
styles: {},
21+
errorTextStyles: {},
22+
});
23+
24+
describe('ComposableContainer - children prop (React 19 compat)', () => {
25+
it('renders children matching layout', () => {
26+
const { getByText } = render(
27+
<ComposableContainer container={makeContainer([2])}>
28+
<Text>Child One</Text>
29+
<Text>Child Two</Text>
30+
</ComposableContainer>
31+
);
32+
expect(getByText('Child One')).toBeTruthy();
33+
expect(getByText('Child Two')).toBeTruthy();
34+
});
35+
36+
it('renders children across multiple rows', () => {
37+
const { getByText } = render(
38+
<ComposableContainer container={makeContainer([1, 2])}>
39+
<Text>Row 1 Child</Text>
40+
<Text>Row 2 Child A</Text>
41+
<Text>Row 2 Child B</Text>
42+
</ComposableContainer>
43+
);
44+
expect(getByText('Row 1 Child')).toBeTruthy();
45+
expect(getByText('Row 2 Child A')).toBeTruthy();
46+
expect(getByText('Row 2 Child B')).toBeTruthy();
47+
});
48+
49+
it('throws when child count does not match layout sum', () => {
50+
expect(() =>
51+
render(
52+
<ComposableContainer container={makeContainer([2])}>
53+
<Text>Only Child</Text>
54+
</ComposableContainer>
55+
)
56+
).toThrow();
57+
});
58+
});

‎__tests__/components/Dropdown.test.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ describe('Verify dropdown component', () => {
1313
listData={[{ label: 'test', value: 'test' }]}
1414
/>
1515
);
16-
const cardIcon = dropdown.getByTestId('dropdown-icon')
17-
fireEvent.press(cardIcon)
16+
const cardIcon = dropdown.getByTestId('dropdown-icon');
17+
fireEvent.press(cardIcon);
1818
const listItem = dropdown.getByTestId('list-item');
1919
fireEvent.press(listItem);
2020
});
@@ -26,11 +26,11 @@ describe('Verify dropdown component', () => {
2626
listData={[{ label: 'test', value: 'test' }]}
2727
/>
2828
);
29-
const cardIcon = dropdown.getByTestId('dropdown-icon')
30-
fireEvent.press(cardIcon)
29+
const cardIcon = dropdown.getByTestId('dropdown-icon');
30+
fireEvent.press(cardIcon);
31+
const modal = dropdown.getByTestId('modal');
3132
const modalClose = dropdown.getByTestId('modal-close');
3233
fireEvent.press(modalClose);
33-
const modal = dropdown.getByTestId('modal');
3434
fireEvent.press(modal);
3535
});
36-
});
36+
});

‎__tests__/components/__snapshots__/components.test.js.snap‎

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
exports[`test Collect Elements Components test CardHolderNameElement component 1`] = `
44
<View>
55
<Text
6-
style={Object {}}
6+
style={{}}
77
>
88
CardHolderName
99
<Text
1010
style={
11-
Object {
11+
{
1212
"color": "red",
1313
}
1414
}
@@ -21,11 +21,11 @@ exports[`test Collect Elements Components test CardHolderNameElement component 1
2121
onChangeText={[Function]}
2222
onFocus={[Function]}
2323
placeholder="CardHolder Name"
24-
style={Object {}}
24+
style={{}}
2525
value=""
2626
/>
2727
<Text
28-
style={Object {}}
28+
style={{}}
2929
testID="name-error"
3030
/>
3131
</View>
@@ -34,12 +34,12 @@ exports[`test Collect Elements Components test CardHolderNameElement component 1
3434
exports[`test Collect Elements Components test CardNumberElement component 1`] = `
3535
<View>
3636
<Text
37-
style={Object {}}
37+
style={{}}
3838
>
3939
CardNumber
4040
<Text
4141
style={
42-
Object {
42+
{
4343
"color": "red",
4444
}
4545
}
@@ -49,7 +49,7 @@ exports[`test Collect Elements Components test CardNumberElement component 1`] =
4949
</Text>
5050
<View
5151
style={
52-
Object {
52+
{
5353
"borderColor": "#eae8ee",
5454
"borderRadius": 4,
5555
"borderWidth": 2,
@@ -62,12 +62,12 @@ exports[`test Collect Elements Components test CardNumberElement component 1`] =
6262
<Image
6363
resizeMode="contain"
6464
source={
65-
Object {
65+
{
6666
"testUri": "../../../assets/visa.png",
6767
}
6868
}
6969
style={
70-
Object {
70+
{
7171
"height": 50,
7272
"width": 50,
7373
}
@@ -81,15 +81,15 @@ exports[`test Collect Elements Components test CardNumberElement component 1`] =
8181
onFocus={[Function]}
8282
placeholder="card number"
8383
style={
84-
Object {
84+
{
8585
"flex": 1,
8686
}
8787
}
8888
value=""
8989
/>
9090
</View>
9191
<Text
92-
style={Object {}}
92+
style={{}}
9393
testID="cardnumber-error"
9494
/>
9595
</View>
@@ -98,12 +98,12 @@ exports[`test Collect Elements Components test CardNumberElement component 1`] =
9898
exports[`test Collect Elements Components test CvvElement component 1`] = `
9999
<View>
100100
<Text
101-
style={Object {}}
101+
style={{}}
102102
>
103103
Cvv
104104
<Text
105105
style={
106-
Object {
106+
{
107107
"color": "red",
108108
}
109109
}
@@ -118,11 +118,11 @@ exports[`test Collect Elements Components test CvvElement component 1`] = `
118118
onChangeText={[Function]}
119119
onFocus={[Function]}
120120
placeholder="cvv"
121-
style={Object {}}
121+
style={{}}
122122
value=""
123123
/>
124124
<Text
125-
style={Object {}}
125+
style={{}}
126126
testID="cvv-error"
127127
/>
128128
</View>
@@ -131,12 +131,12 @@ exports[`test Collect Elements Components test CvvElement component 1`] = `
131131
exports[`test Collect Elements Components test ExpirationDateElement component 1`] = `
132132
<View>
133133
<Text
134-
style={Object {}}
134+
style={{}}
135135
>
136136
Expiration Date
137137
<Text
138138
style={
139-
Object {
139+
{
140140
"color": "red",
141141
}
142142
}
@@ -151,11 +151,11 @@ exports[`test Collect Elements Components test ExpirationDateElement component 1
151151
onChangeText={[Function]}
152152
onFocus={[Function]}
153153
placeholder="expiration date"
154-
style={Object {}}
154+
style={{}}
155155
value=""
156156
/>
157157
<Text
158-
style={Object {}}
158+
style={{}}
159159
testID="date-error"
160160
/>
161161
</View>
@@ -164,12 +164,12 @@ exports[`test Collect Elements Components test ExpirationDateElement component 1
164164
exports[`test Collect Elements Components test ExpirationMonthElement component 1`] = `
165165
<View>
166166
<Text
167-
style={Object {}}
167+
style={{}}
168168
>
169169
Expiration Month
170170
<Text
171171
style={
172-
Object {
172+
{
173173
"color": "red",
174174
}
175175
}
@@ -184,11 +184,11 @@ exports[`test Collect Elements Components test ExpirationMonthElement component
184184
onChangeText={[Function]}
185185
onFocus={[Function]}
186186
placeholder="expiration month"
187-
style={Object {}}
187+
style={{}}
188188
value=""
189189
/>
190190
<Text
191-
style={Object {}}
191+
style={{}}
192192
testID="month-error"
193193
/>
194194
</View>
@@ -197,12 +197,12 @@ exports[`test Collect Elements Components test ExpirationMonthElement component
197197
exports[`test Collect Elements Components test ExpirationYearElement component 1`] = `
198198
<View>
199199
<Text
200-
style={Object {}}
200+
style={{}}
201201
>
202202
Expiration Year
203203
<Text
204204
style={
205-
Object {
205+
{
206206
"color": "red",
207207
}
208208
}
@@ -217,11 +217,11 @@ exports[`test Collect Elements Components test ExpirationYearElement component 1
217217
onChangeText={[Function]}
218218
onFocus={[Function]}
219219
placeholder="expiration year"
220-
style={Object {}}
220+
style={{}}
221221
value=""
222222
/>
223223
<Text
224-
style={Object {}}
224+
style={{}}
225225
testID="year-error"
226226
/>
227227
</View>
@@ -230,12 +230,12 @@ exports[`test Collect Elements Components test ExpirationYearElement component 1
230230
exports[`test Collect Elements Components test InputFieldElement component 1`] = `
231231
<View>
232232
<Text
233-
style={Object {}}
233+
style={{}}
234234
>
235235
First Name
236236
<Text
237237
style={
238-
Object {
238+
{
239239
"color": "red",
240240
}
241241
}
@@ -248,11 +248,11 @@ exports[`test Collect Elements Components test InputFieldElement component 1`] =
248248
onChangeText={[Function]}
249249
onFocus={[Function]}
250250
placeholder="first name"
251-
style={Object {}}
251+
style={{}}
252252
value=""
253253
/>
254254
<Text
255-
style={Object {}}
255+
style={{}}
256256
testID="inputfield-error"
257257
/>
258258
</View>
@@ -261,12 +261,12 @@ exports[`test Collect Elements Components test InputFieldElement component 1`] =
261261
exports[`test Collect Elements Components test PinElement component 1`] = `
262262
<View>
263263
<Text
264-
style={Object {}}
264+
style={{}}
265265
>
266266
Pin
267267
<Text
268268
style={
269-
Object {
269+
{
270270
"color": "red",
271271
}
272272
}
@@ -281,51 +281,51 @@ exports[`test Collect Elements Components test PinElement component 1`] = `
281281
onChangeText={[Function]}
282282
onFocus={[Function]}
283283
placeholder="pin"
284-
style={Object {}}
284+
style={{}}
285285
value=""
286286
/>
287287
<Text
288-
style={Object {}}
288+
style={{}}
289289
testID="pin-error"
290290
/>
291291
</View>
292292
`;
293293

294294
exports[`test Collect Elements Components test Reveal Elements Components renders correctly with the handler & snapshot 1`] = `
295-
Array [
295+
[
296296
<Text
297-
style={Object {}}
297+
style={{}}
298298
>
299299
Card Number
300300
</Text>,
301301
<Text
302302
selectable={true}
303-
style={Object {}}
303+
style={{}}
304304
>
305305
XXXX XXXX XXXX XXXX
306306
</Text>,
307307
<Text
308-
style={Object {}}
308+
style={{}}
309309
testID="Card Number-error"
310310
/>,
311311
]
312312
`;
313313

314314
exports[`test Collect Elements Components test RevealElement component rendering 1`] = `
315-
Array [
315+
[
316316
<Text
317-
style={Object {}}
317+
style={{}}
318318
>
319319
Card Number
320320
</Text>,
321321
<Text
322322
selectable={true}
323-
style={Object {}}
323+
style={{}}
324324
>
325325
XXXX XXXX XXXX XXXX
326326
</Text>,
327327
<Text
328-
style={Object {}}
328+
style={{}}
329329
testID="Card Number-error"
330330
/>,
331331
]

0 commit comments

Comments
 (0)