react-native-timer-picker 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +35 -34
  2. package/dist/commonjs/tests/DurationScroll.test.js +94 -0
  3. package/dist/commonjs/tests/DurationScroll.test.js.map +1 -1
  4. package/dist/commonjs/tests/Modal.test.js +79 -2
  5. package/dist/commonjs/tests/Modal.test.js.map +1 -1
  6. package/dist/commonjs/tests/TimerPicker.test.js +115 -0
  7. package/dist/commonjs/tests/TimerPicker.test.js.map +1 -1
  8. package/dist/commonjs/tests/TimerPickerModal.test.js +120 -0
  9. package/dist/commonjs/tests/TimerPickerModal.test.js.map +1 -1
  10. package/dist/commonjs/tests/colorToRgba.test.js +176 -0
  11. package/dist/commonjs/tests/colorToRgba.test.js.map +1 -0
  12. package/dist/commonjs/tests/generateNumbers.test.js +350 -0
  13. package/dist/commonjs/tests/generateNumbers.test.js.map +1 -0
  14. package/dist/commonjs/tests/getAdjustedLimit.test.js +324 -0
  15. package/dist/commonjs/tests/getAdjustedLimit.test.js.map +1 -0
  16. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js +424 -0
  17. package/dist/commonjs/tests/getDurationAndIndexFromScrollOffset.test.js.map +1 -0
  18. package/dist/commonjs/tests/getInitialScrollIndex.test.js +396 -0
  19. package/dist/commonjs/tests/getInitialScrollIndex.test.js.map +1 -0
  20. package/dist/commonjs/tests/getSafeInitialValue.test.js +497 -0
  21. package/dist/commonjs/tests/getSafeInitialValue.test.js.map +1 -0
  22. package/dist/commonjs/tests/padNumber.test.js +301 -0
  23. package/dist/commonjs/tests/padNumber.test.js.map +1 -0
  24. package/dist/commonjs/utils/colorToRgba.js +5 -0
  25. package/dist/commonjs/utils/colorToRgba.js.map +1 -1
  26. package/dist/commonjs/utils/getAdjustedLimit.js +3 -3
  27. package/dist/commonjs/utils/getAdjustedLimit.js.map +1 -1
  28. package/dist/module/tests/DurationScroll.test.js +94 -0
  29. package/dist/module/tests/DurationScroll.test.js.map +1 -1
  30. package/dist/module/tests/Modal.test.js +80 -3
  31. package/dist/module/tests/Modal.test.js.map +1 -1
  32. package/dist/module/tests/TimerPicker.test.js +115 -0
  33. package/dist/module/tests/TimerPicker.test.js.map +1 -1
  34. package/dist/module/tests/TimerPickerModal.test.js +121 -1
  35. package/dist/module/tests/TimerPickerModal.test.js.map +1 -1
  36. package/dist/module/tests/colorToRgba.test.js +174 -0
  37. package/dist/module/tests/colorToRgba.test.js.map +1 -0
  38. package/dist/module/tests/generateNumbers.test.js +348 -0
  39. package/dist/module/tests/generateNumbers.test.js.map +1 -0
  40. package/dist/module/tests/getAdjustedLimit.test.js +322 -0
  41. package/dist/module/tests/getAdjustedLimit.test.js.map +1 -0
  42. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js +422 -0
  43. package/dist/module/tests/getDurationAndIndexFromScrollOffset.test.js.map +1 -0
  44. package/dist/module/tests/getInitialScrollIndex.test.js +394 -0
  45. package/dist/module/tests/getInitialScrollIndex.test.js.map +1 -0
  46. package/dist/module/tests/getSafeInitialValue.test.js +495 -0
  47. package/dist/module/tests/getSafeInitialValue.test.js.map +1 -0
  48. package/dist/module/tests/padNumber.test.js +299 -0
  49. package/dist/module/tests/padNumber.test.js.map +1 -0
  50. package/dist/module/utils/colorToRgba.js +5 -0
  51. package/dist/module/utils/colorToRgba.js.map +1 -1
  52. package/dist/module/utils/getAdjustedLimit.js +3 -3
  53. package/dist/module/utils/getAdjustedLimit.js.map +1 -1
  54. package/dist/typescript/components/TimerPicker/styles.d.ts +0 -247
  55. package/dist/typescript/components/TimerPickerModal/styles.d.ts +0 -152
  56. package/package.json +3 -4
@@ -0,0 +1,301 @@
1
+ "use strict";
2
+
3
+ var _padNumber = require("../utils/padNumber");
4
+ describe("padNumber", () => {
5
+ describe("padding with zero", () => {
6
+ it("pads single digit with zero", () => {
7
+ expect((0, _padNumber.padNumber)(0, {
8
+ padWithZero: true
9
+ })).toBe("00");
10
+ expect((0, _padNumber.padNumber)(1, {
11
+ padWithZero: true
12
+ })).toBe("01");
13
+ expect((0, _padNumber.padNumber)(5, {
14
+ padWithZero: true
15
+ })).toBe("05");
16
+ expect((0, _padNumber.padNumber)(9, {
17
+ padWithZero: true
18
+ })).toBe("09");
19
+ });
20
+ it("does not pad double digits", () => {
21
+ expect((0, _padNumber.padNumber)(10, {
22
+ padWithZero: true
23
+ })).toBe("10");
24
+ expect((0, _padNumber.padNumber)(15, {
25
+ padWithZero: true
26
+ })).toBe("15");
27
+ expect((0, _padNumber.padNumber)(99, {
28
+ padWithZero: true
29
+ })).toBe("99");
30
+ });
31
+ it("does not pad triple digits", () => {
32
+ expect((0, _padNumber.padNumber)(100, {
33
+ padWithZero: true
34
+ })).toBe("100");
35
+ expect((0, _padNumber.padNumber)(255, {
36
+ padWithZero: true
37
+ })).toBe("255");
38
+ expect((0, _padNumber.padNumber)(999, {
39
+ padWithZero: true
40
+ })).toBe("999");
41
+ });
42
+ it("handles very large numbers", () => {
43
+ expect((0, _padNumber.padNumber)(1000, {
44
+ padWithZero: true
45
+ })).toBe("1000");
46
+ expect((0, _padNumber.padNumber)(99999, {
47
+ padWithZero: true
48
+ })).toBe("99999");
49
+ });
50
+ });
51
+ describe("padding with space", () => {
52
+ it("pads single digit with space", () => {
53
+ expect((0, _padNumber.padNumber)(0, {
54
+ padWithZero: false
55
+ })).toBe(" 0");
56
+ expect((0, _padNumber.padNumber)(1, {
57
+ padWithZero: false
58
+ })).toBe(" 1");
59
+ expect((0, _padNumber.padNumber)(5, {
60
+ padWithZero: false
61
+ })).toBe(" 5");
62
+ expect((0, _padNumber.padNumber)(9, {
63
+ padWithZero: false
64
+ })).toBe(" 9");
65
+ });
66
+ it("does not pad double digits", () => {
67
+ expect((0, _padNumber.padNumber)(10, {
68
+ padWithZero: false
69
+ })).toBe("10");
70
+ expect((0, _padNumber.padNumber)(15, {
71
+ padWithZero: false
72
+ })).toBe("15");
73
+ expect((0, _padNumber.padNumber)(99, {
74
+ padWithZero: false
75
+ })).toBe("99");
76
+ });
77
+ it("does not pad triple digits", () => {
78
+ expect((0, _padNumber.padNumber)(100, {
79
+ padWithZero: false
80
+ })).toBe("100");
81
+ expect((0, _padNumber.padNumber)(255, {
82
+ padWithZero: false
83
+ })).toBe("255");
84
+ expect((0, _padNumber.padNumber)(999, {
85
+ padWithZero: false
86
+ })).toBe("999");
87
+ });
88
+ it("handles very large numbers", () => {
89
+ expect((0, _padNumber.padNumber)(1000, {
90
+ padWithZero: false
91
+ })).toBe("1000");
92
+ expect((0, _padNumber.padNumber)(99999, {
93
+ padWithZero: false
94
+ })).toBe("99999");
95
+ });
96
+ });
97
+ describe("no options provided", () => {
98
+ it("defaults to space padding for single digits", () => {
99
+ expect((0, _padNumber.padNumber)(0)).toBe(" 0");
100
+ expect((0, _padNumber.padNumber)(1)).toBe(" 1");
101
+ expect((0, _padNumber.padNumber)(5)).toBe(" 5");
102
+ expect((0, _padNumber.padNumber)(9)).toBe(" 9");
103
+ });
104
+ it("does not pad double digits", () => {
105
+ expect((0, _padNumber.padNumber)(10)).toBe("10");
106
+ expect((0, _padNumber.padNumber)(15)).toBe("15");
107
+ expect((0, _padNumber.padNumber)(99)).toBe("99");
108
+ });
109
+ it("does not pad triple digits", () => {
110
+ expect((0, _padNumber.padNumber)(100)).toBe("100");
111
+ expect((0, _padNumber.padNumber)(255)).toBe("255");
112
+ expect((0, _padNumber.padNumber)(999)).toBe("999");
113
+ });
114
+ });
115
+ describe("undefined padWithZero option", () => {
116
+ it("defaults to space padding", () => {
117
+ expect((0, _padNumber.padNumber)(0, {})).toBe(" 0");
118
+ expect((0, _padNumber.padNumber)(5, {})).toBe(" 5");
119
+ expect((0, _padNumber.padNumber)(9, {})).toBe(" 9");
120
+ });
121
+ it("does not pad double digits", () => {
122
+ expect((0, _padNumber.padNumber)(10, {})).toBe("10");
123
+ expect((0, _padNumber.padNumber)(50, {})).toBe("50");
124
+ });
125
+ });
126
+ describe("edge cases at boundary", () => {
127
+ it("handles value exactly 9 (last single digit)", () => {
128
+ expect((0, _padNumber.padNumber)(9, {
129
+ padWithZero: true
130
+ })).toBe("09");
131
+ expect((0, _padNumber.padNumber)(9, {
132
+ padWithZero: false
133
+ })).toBe(" 9");
134
+ expect((0, _padNumber.padNumber)(9)).toBe(" 9");
135
+ });
136
+ it("handles value exactly 10 (first double digit)", () => {
137
+ expect((0, _padNumber.padNumber)(10, {
138
+ padWithZero: true
139
+ })).toBe("10");
140
+ expect((0, _padNumber.padNumber)(10, {
141
+ padWithZero: false
142
+ })).toBe("10");
143
+ expect((0, _padNumber.padNumber)(10)).toBe("10");
144
+ });
145
+ it("handles value exactly 0", () => {
146
+ expect((0, _padNumber.padNumber)(0, {
147
+ padWithZero: true
148
+ })).toBe("00");
149
+ expect((0, _padNumber.padNumber)(0, {
150
+ padWithZero: false
151
+ })).toBe(" 0");
152
+ expect((0, _padNumber.padNumber)(0)).toBe(" 0");
153
+ });
154
+ });
155
+ describe("real-world scenarios", () => {
156
+ it("formats hours for 12-hour display", () => {
157
+ expect((0, _padNumber.padNumber)(1, {
158
+ padWithZero: true
159
+ })).toBe("01");
160
+ expect((0, _padNumber.padNumber)(12, {
161
+ padWithZero: true
162
+ })).toBe("12");
163
+ });
164
+ it("formats hours for 24-hour display", () => {
165
+ expect((0, _padNumber.padNumber)(0, {
166
+ padWithZero: true
167
+ })).toBe("00");
168
+ expect((0, _padNumber.padNumber)(9, {
169
+ padWithZero: true
170
+ })).toBe("09");
171
+ expect((0, _padNumber.padNumber)(23, {
172
+ padWithZero: true
173
+ })).toBe("23");
174
+ });
175
+ it("formats minutes", () => {
176
+ expect((0, _padNumber.padNumber)(0, {
177
+ padWithZero: true
178
+ })).toBe("00");
179
+ expect((0, _padNumber.padNumber)(5, {
180
+ padWithZero: true
181
+ })).toBe("05");
182
+ expect((0, _padNumber.padNumber)(30, {
183
+ padWithZero: true
184
+ })).toBe("30");
185
+ expect((0, _padNumber.padNumber)(59, {
186
+ padWithZero: true
187
+ })).toBe("59");
188
+ });
189
+ it("formats seconds", () => {
190
+ expect((0, _padNumber.padNumber)(0, {
191
+ padWithZero: true
192
+ })).toBe("00");
193
+ expect((0, _padNumber.padNumber)(9, {
194
+ padWithZero: true
195
+ })).toBe("09");
196
+ expect((0, _padNumber.padNumber)(45, {
197
+ padWithZero: true
198
+ })).toBe("45");
199
+ expect((0, _padNumber.padNumber)(59, {
200
+ padWithZero: true
201
+ })).toBe("59");
202
+ });
203
+ it("formats days without padding preference", () => {
204
+ expect((0, _padNumber.padNumber)(1, {
205
+ padWithZero: false
206
+ })).toBe(" 1");
207
+ expect((0, _padNumber.padNumber)(7, {
208
+ padWithZero: false
209
+ })).toBe(" 7");
210
+ expect((0, _padNumber.padNumber)(30, {
211
+ padWithZero: false
212
+ })).toBe("30");
213
+ expect((0, _padNumber.padNumber)(365, {
214
+ padWithZero: false
215
+ })).toBe("365");
216
+ });
217
+ });
218
+ describe("all single digits", () => {
219
+ it("correctly pads all single digits 0-9 with zero", () => {
220
+ for (let i = 0; i < 10; i++) {
221
+ const result = (0, _padNumber.padNumber)(i, {
222
+ padWithZero: true
223
+ });
224
+ expect(result).toBe(`0${i}`);
225
+ expect(result).toHaveLength(2);
226
+ }
227
+ });
228
+ it("correctly pads all single digits 0-9 with space", () => {
229
+ for (let i = 0; i < 10; i++) {
230
+ const result = (0, _padNumber.padNumber)(i, {
231
+ padWithZero: false
232
+ });
233
+ expect(result).toBe(` ${i}`);
234
+ expect(result).toHaveLength(2);
235
+ }
236
+ });
237
+ });
238
+ describe("return type", () => {
239
+ it("always returns a string", () => {
240
+ expect(typeof (0, _padNumber.padNumber)(0, {
241
+ padWithZero: true
242
+ })).toBe("string");
243
+ expect(typeof (0, _padNumber.padNumber)(5, {
244
+ padWithZero: true
245
+ })).toBe("string");
246
+ expect(typeof (0, _padNumber.padNumber)(10, {
247
+ padWithZero: true
248
+ })).toBe("string");
249
+ expect(typeof (0, _padNumber.padNumber)(100, {
250
+ padWithZero: true
251
+ })).toBe("string");
252
+ });
253
+ });
254
+ describe("string length", () => {
255
+ it("returns 2-character string for single digits", () => {
256
+ expect((0, _padNumber.padNumber)(0, {
257
+ padWithZero: true
258
+ })).toHaveLength(2);
259
+ expect((0, _padNumber.padNumber)(5, {
260
+ padWithZero: true
261
+ })).toHaveLength(2);
262
+ expect((0, _padNumber.padNumber)(9, {
263
+ padWithZero: true
264
+ })).toHaveLength(2);
265
+ });
266
+ it("returns 2-character string for single digits with space", () => {
267
+ expect((0, _padNumber.padNumber)(0, {
268
+ padWithZero: false
269
+ })).toHaveLength(2);
270
+ expect((0, _padNumber.padNumber)(5, {
271
+ padWithZero: false
272
+ })).toHaveLength(2);
273
+ expect((0, _padNumber.padNumber)(9, {
274
+ padWithZero: false
275
+ })).toHaveLength(2);
276
+ });
277
+ it("returns correct length for double digits", () => {
278
+ expect((0, _padNumber.padNumber)(10, {
279
+ padWithZero: true
280
+ })).toHaveLength(2);
281
+ expect((0, _padNumber.padNumber)(50, {
282
+ padWithZero: true
283
+ })).toHaveLength(2);
284
+ expect((0, _padNumber.padNumber)(99, {
285
+ padWithZero: true
286
+ })).toHaveLength(2);
287
+ });
288
+ it("returns correct length for triple digits", () => {
289
+ expect((0, _padNumber.padNumber)(100, {
290
+ padWithZero: true
291
+ })).toHaveLength(3);
292
+ expect((0, _padNumber.padNumber)(500, {
293
+ padWithZero: true
294
+ })).toHaveLength(3);
295
+ expect((0, _padNumber.padNumber)(999, {
296
+ padWithZero: true
297
+ })).toHaveLength(3);
298
+ });
299
+ });
300
+ });
301
+ //# sourceMappingURL=padNumber.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_padNumber","require","describe","it","expect","padNumber","padWithZero","toBe","i","result","toHaveLength"],"sources":["padNumber.test.ts"],"sourcesContent":["import { padNumber } from \"../utils/padNumber\";\n\ndescribe(\"padNumber\", () => {\n describe(\"padding with zero\", () => {\n it(\"pads single digit with zero\", () => {\n expect(padNumber(0, { padWithZero: true })).toBe(\"00\");\n expect(padNumber(1, { padWithZero: true })).toBe(\"01\");\n expect(padNumber(5, { padWithZero: true })).toBe(\"05\");\n expect(padNumber(9, { padWithZero: true })).toBe(\"09\");\n });\n\n it(\"does not pad double digits\", () => {\n expect(padNumber(10, { padWithZero: true })).toBe(\"10\");\n expect(padNumber(15, { padWithZero: true })).toBe(\"15\");\n expect(padNumber(99, { padWithZero: true })).toBe(\"99\");\n });\n\n it(\"does not pad triple digits\", () => {\n expect(padNumber(100, { padWithZero: true })).toBe(\"100\");\n expect(padNumber(255, { padWithZero: true })).toBe(\"255\");\n expect(padNumber(999, { padWithZero: true })).toBe(\"999\");\n });\n\n it(\"handles very large numbers\", () => {\n expect(padNumber(1000, { padWithZero: true })).toBe(\"1000\");\n expect(padNumber(99999, { padWithZero: true })).toBe(\"99999\");\n });\n });\n\n describe(\"padding with space\", () => {\n it(\"pads single digit with space\", () => {\n expect(padNumber(0, { padWithZero: false })).toBe(\" 0\");\n expect(padNumber(1, { padWithZero: false })).toBe(\" 1\");\n expect(padNumber(5, { padWithZero: false })).toBe(\" 5\");\n expect(padNumber(9, { padWithZero: false })).toBe(\" 9\");\n });\n\n it(\"does not pad double digits\", () => {\n expect(padNumber(10, { padWithZero: false })).toBe(\"10\");\n expect(padNumber(15, { padWithZero: false })).toBe(\"15\");\n expect(padNumber(99, { padWithZero: false })).toBe(\"99\");\n });\n\n it(\"does not pad triple digits\", () => {\n expect(padNumber(100, { padWithZero: false })).toBe(\"100\");\n expect(padNumber(255, { padWithZero: false })).toBe(\"255\");\n expect(padNumber(999, { padWithZero: false })).toBe(\"999\");\n });\n\n it(\"handles very large numbers\", () => {\n expect(padNumber(1000, { padWithZero: false })).toBe(\"1000\");\n expect(padNumber(99999, { padWithZero: false })).toBe(\"99999\");\n });\n });\n\n describe(\"no options provided\", () => {\n it(\"defaults to space padding for single digits\", () => {\n expect(padNumber(0)).toBe(\" 0\");\n expect(padNumber(1)).toBe(\" 1\");\n expect(padNumber(5)).toBe(\" 5\");\n expect(padNumber(9)).toBe(\" 9\");\n });\n\n it(\"does not pad double digits\", () => {\n expect(padNumber(10)).toBe(\"10\");\n expect(padNumber(15)).toBe(\"15\");\n expect(padNumber(99)).toBe(\"99\");\n });\n\n it(\"does not pad triple digits\", () => {\n expect(padNumber(100)).toBe(\"100\");\n expect(padNumber(255)).toBe(\"255\");\n expect(padNumber(999)).toBe(\"999\");\n });\n });\n\n describe(\"undefined padWithZero option\", () => {\n it(\"defaults to space padding\", () => {\n expect(padNumber(0, {})).toBe(\" 0\");\n expect(padNumber(5, {})).toBe(\" 5\");\n expect(padNumber(9, {})).toBe(\" 9\");\n });\n\n it(\"does not pad double digits\", () => {\n expect(padNumber(10, {})).toBe(\"10\");\n expect(padNumber(50, {})).toBe(\"50\");\n });\n });\n\n describe(\"edge cases at boundary\", () => {\n it(\"handles value exactly 9 (last single digit)\", () => {\n expect(padNumber(9, { padWithZero: true })).toBe(\"09\");\n expect(padNumber(9, { padWithZero: false })).toBe(\" 9\");\n expect(padNumber(9)).toBe(\" 9\");\n });\n\n it(\"handles value exactly 10 (first double digit)\", () => {\n expect(padNumber(10, { padWithZero: true })).toBe(\"10\");\n expect(padNumber(10, { padWithZero: false })).toBe(\"10\");\n expect(padNumber(10)).toBe(\"10\");\n });\n\n it(\"handles value exactly 0\", () => {\n expect(padNumber(0, { padWithZero: true })).toBe(\"00\");\n expect(padNumber(0, { padWithZero: false })).toBe(\" 0\");\n expect(padNumber(0)).toBe(\" 0\");\n });\n });\n\n describe(\"real-world scenarios\", () => {\n it(\"formats hours for 12-hour display\", () => {\n expect(padNumber(1, { padWithZero: true })).toBe(\"01\");\n expect(padNumber(12, { padWithZero: true })).toBe(\"12\");\n });\n\n it(\"formats hours for 24-hour display\", () => {\n expect(padNumber(0, { padWithZero: true })).toBe(\"00\");\n expect(padNumber(9, { padWithZero: true })).toBe(\"09\");\n expect(padNumber(23, { padWithZero: true })).toBe(\"23\");\n });\n\n it(\"formats minutes\", () => {\n expect(padNumber(0, { padWithZero: true })).toBe(\"00\");\n expect(padNumber(5, { padWithZero: true })).toBe(\"05\");\n expect(padNumber(30, { padWithZero: true })).toBe(\"30\");\n expect(padNumber(59, { padWithZero: true })).toBe(\"59\");\n });\n\n it(\"formats seconds\", () => {\n expect(padNumber(0, { padWithZero: true })).toBe(\"00\");\n expect(padNumber(9, { padWithZero: true })).toBe(\"09\");\n expect(padNumber(45, { padWithZero: true })).toBe(\"45\");\n expect(padNumber(59, { padWithZero: true })).toBe(\"59\");\n });\n\n it(\"formats days without padding preference\", () => {\n expect(padNumber(1, { padWithZero: false })).toBe(\" 1\");\n expect(padNumber(7, { padWithZero: false })).toBe(\" 7\");\n expect(padNumber(30, { padWithZero: false })).toBe(\"30\");\n expect(padNumber(365, { padWithZero: false })).toBe(\"365\");\n });\n });\n\n describe(\"all single digits\", () => {\n it(\"correctly pads all single digits 0-9 with zero\", () => {\n for (let i = 0; i < 10; i++) {\n const result = padNumber(i, { padWithZero: true });\n expect(result).toBe(`0${i}`);\n expect(result).toHaveLength(2);\n }\n });\n\n it(\"correctly pads all single digits 0-9 with space\", () => {\n for (let i = 0; i < 10; i++) {\n const result = padNumber(i, { padWithZero: false });\n expect(result).toBe(` ${i}`);\n expect(result).toHaveLength(2);\n }\n });\n });\n\n describe(\"return type\", () => {\n it(\"always returns a string\", () => {\n expect(typeof padNumber(0, { padWithZero: true })).toBe(\"string\");\n expect(typeof padNumber(5, { padWithZero: true })).toBe(\"string\");\n expect(typeof padNumber(10, { padWithZero: true })).toBe(\"string\");\n expect(typeof padNumber(100, { padWithZero: true })).toBe(\"string\");\n });\n });\n\n describe(\"string length\", () => {\n it(\"returns 2-character string for single digits\", () => {\n expect(padNumber(0, { padWithZero: true })).toHaveLength(2);\n expect(padNumber(5, { padWithZero: true })).toHaveLength(2);\n expect(padNumber(9, { padWithZero: true })).toHaveLength(2);\n });\n\n it(\"returns 2-character string for single digits with space\", () => {\n expect(padNumber(0, { padWithZero: false })).toHaveLength(2);\n expect(padNumber(5, { padWithZero: false })).toHaveLength(2);\n expect(padNumber(9, { padWithZero: false })).toHaveLength(2);\n });\n\n it(\"returns correct length for double digits\", () => {\n expect(padNumber(10, { padWithZero: true })).toHaveLength(2);\n expect(padNumber(50, { padWithZero: true })).toHaveLength(2);\n expect(padNumber(99, { padWithZero: true })).toHaveLength(2);\n });\n\n it(\"returns correct length for triple digits\", () => {\n expect(padNumber(100, { padWithZero: true })).toHaveLength(3);\n expect(padNumber(500, { padWithZero: true })).toHaveLength(3);\n expect(padNumber(999, { padWithZero: true })).toHaveLength(3);\n });\n });\n});\n"],"mappings":";;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEAC,QAAQ,CAAC,WAAW,EAAE,MAAM;EACxBA,QAAQ,CAAC,mBAAmB,EAAE,MAAM;IAChCC,EAAE,CAAC,6BAA6B,EAAE,MAAM;MACpCC,MAAM,CAAC,IAAAC,oBAAS,EAAC,CAAC,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;MACtDH,MAAM,CAAC,IAAAC,oBAAS,EAAC,CAAC,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;MACtDH,MAAM,CAAC,IAAAC,oBAAS,EAAC,CAAC,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;MACtDH,MAAM,CAAC,IAAAC,oBAAS,EAAC,CAAC,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;IAC1D,CAAC,CAAC;IAEFJ,EAAE,CAAC,4BAA4B,EAAE,MAAM;MACnCC,MAAM,CAAC,IAAAC,oBAAS,EAAC,EAAE,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAA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IAAAC,oBAAS,EAAC,EAAE,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACI,YAAY,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC;IAEFP,EAAE,CAAC,0CAA0C,EAAE,MAAM;MACjDC,MAAM,CAAC,IAAAC,oBAAS,EAAC,GAAG,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACI,YAAY,CAAC,CAAC,CAAC;MAC7DN,MAAM,CAAC,IAAAC,oBAAS,EAAC,GAAG,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACI,YAAY,CAAC,CAAC,CAAC;MAC7DN,MAAM,CAAC,IAAAC,oBAAS,EAAC,GAAG,EAAE;QAAEC,WAAW,EAAE;MAAK,CAAC,CAAC,CAAC,CAACI,YAAY,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -74,6 +74,11 @@ const colorToRgba = variables => {
74
74
  const r = parseInt(hexColor.slice(0, 2), 16);
75
75
  const g = parseInt(hexColor.slice(2, 4), 16);
76
76
  const b = parseInt(hexColor.slice(4, 6), 16);
77
+
78
+ // Validate that all color components are valid numbers
79
+ if (isNaN(r) || isNaN(g) || isNaN(b)) {
80
+ return color; // Return original if malformed
81
+ }
77
82
  return `rgba(${r}, ${g}, ${b}, ${opacity})`;
78
83
  }
79
84
  return color; // Return unchanged if unable to parse
@@ -1 +1 @@
1
- {"version":3,"names":["colorToRgba","variables","color","opacity","namedColors","transparent","black","white","blue","green","gray","red","startsWith","rgbValues","replace","split","map","value","parseInt","trim","r","g","b","hexColor","slice","length","join","exports"],"sources":["colorToRgba.ts"],"sourcesContent":["/**\n * Converts various color formats to RGBA string representation.\n * This function is specifically required for expo-linear-gradient on iOS to handle transparent colors correctly.\n * It supports named colors, RGB, and hex color formats.\n *\n * @param {Object} variables - The input variables object\n * @param {string} variables.color - The color to convert. Can be:\n * - Named color (e.g., 'transparent', 'black', 'white', 'blue', 'green', 'gray', 'red')\n * - RGB format (e.g., 'rgb(255, 0, 0)')\n * - Hex format (e.g., '#FF0000' or '#F00')\n * @param {number} [variables.opacity=1] - The opacity value between 0 and 1\n *\n * @returns {string} The color in RGBA format (e.g., 'rgba(255, 0, 0, 0.5)')\n *\n * @example\n * // Using named color\n * colorToRgba({ color: 'transparent' })\n * // Returns: 'rgba(0, 0, 0, 0)'\n *\n * @example\n * // Using RGB with custom opacity\n * colorToRgba({ color: 'rgb(255, 0, 0)', opacity: 0.5 })\n * // Returns: 'rgba(255, 0, 0, 0.5)'\n *\n * @example\n * // Using hex color\n * colorToRgba({ color: '#FF0000' })\n * // Returns: 'rgba(255, 0, 0, 1)'\n *\n * @example\n * // Using short hex color\n * colorToRgba({ color: '#F00' })\n * // Returns: 'rgba(255, 0, 0, 1)'\n */\nexport const colorToRgba = (variables: {\n color: string;\n opacity?: number;\n}): string => {\n const { color, opacity = 1 } = variables;\n\n // Handle named colors\n const namedColors: { [key: string]: string } = {\n transparent: \"rgba(0, 0, 0, 0)\",\n black: \"rgba(0, 0, 0, 1)\",\n white: \"rgba(255, 255, 255, 1)\",\n blue: \"rgba(0, 0, 255, 1)\",\n green: \"rgba(0, 128, 0, 1)\",\n gray: \"rgba(128, 128, 128, 1)\",\n red: \"rgba(255, 0, 0, 1)\",\n };\n\n if (color in namedColors) {\n return namedColors[color];\n }\n\n // Handle RGB format\n if (color.startsWith(\"rgb(\")) {\n const rgbValues = color\n .replace(\"rgb(\", \"\")\n .replace(\")\", \"\")\n .split(\",\")\n .map((value) => parseInt(value.trim(), 10));\n const [r, g, b] = rgbValues;\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n\n // Handle hex format\n if (color.startsWith(\"#\")) {\n let hexColor = color.slice(1);\n if (hexColor.length === 3) {\n hexColor = hexColor\n .split(\"\")\n .map((value) => value + value)\n .join(\"\");\n }\n const r = parseInt(hexColor.slice(0, 2), 16);\n const g = parseInt(hexColor.slice(2, 4), 16);\n const b = parseInt(hexColor.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n\n return color; // Return unchanged if unable to parse\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAIC,SAG3B,IAAa;EACV,MAAM;IAAEC,KAAK;IAAEC,OAAO,GAAG;EAAE,CAAC,GAAGF,SAAS;;EAExC;EACA,MAAMG,WAAsC,GAAG;IAC3CC,WAAW,EAAE,kBAAkB;IAC/BC,KAAK,EAAE,kBAAkB;IACzBC,KAAK,EAAE,wBAAwB;IAC/BC,IAAI,EAAE,oBAAoB;IAC1BC,KAAK,EAAE,oBAAoB;IAC3BC,IAAI,EAAE,wBAAwB;IAC9BC,GAAG,EAAE;EACT,CAAC;EAED,IAAIT,KAAK,IAAIE,WAAW,EAAE;IACtB,OAAOA,WAAW,CAACF,KAAK,CAAC;EAC7B;;EAEA;EACA,IAAIA,KAAK,CAACU,UAAU,CAAC,MAAM,CAAC,EAAE;IAC1B,MAAMC,SAAS,GAAGX,KAAK,CAClBY,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CACnBA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,GAAG,CAAC,CACVC,GAAG,CAAEC,KAAK,IAAKC,QAAQ,CAACD,KAAK,CAACE,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/C,MAAM,CAACC,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAC,GAAGT,SAAS;IAC3B,OAAO,QAAQO,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKnB,OAAO,GAAG;EAC/C;;EAEA;EACA,IAAID,KAAK,CAACU,UAAU,CAAC,GAAG,CAAC,EAAE;IACvB,IAAIW,QAAQ,GAAGrB,KAAK,CAACsB,KAAK,CAAC,CAAC,CAAC;IAC7B,IAAID,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACvBF,QAAQ,GAAGA,QAAQ,CACdR,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAEC,KAAK,IAAKA,KAAK,GAAGA,KAAK,CAAC,CAC7BS,IAAI,CAAC,EAAE,CAAC;IACjB;IACA,MAAMN,CAAC,GAAGF,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5C,MAAMH,CAAC,GAAGH,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5C,MAAMF,CAAC,GAAGJ,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,QAAQJ,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKnB,OAAO,GAAG;EAC/C;EAEA,OAAOD,KAAK,CAAC,CAAC;AAClB,CAAC;AAACyB,OAAA,CAAA3B,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["colorToRgba","variables","color","opacity","namedColors","transparent","black","white","blue","green","gray","red","startsWith","rgbValues","replace","split","map","value","parseInt","trim","r","g","b","hexColor","slice","length","join","isNaN","exports"],"sources":["colorToRgba.ts"],"sourcesContent":["/**\n * Converts various color formats to RGBA string representation.\n * This function is specifically required for expo-linear-gradient on iOS to handle transparent colors correctly.\n * It supports named colors, RGB, and hex color formats.\n *\n * @param {Object} variables - The input variables object\n * @param {string} variables.color - The color to convert. Can be:\n * - Named color (e.g., 'transparent', 'black', 'white', 'blue', 'green', 'gray', 'red')\n * - RGB format (e.g., 'rgb(255, 0, 0)')\n * - Hex format (e.g., '#FF0000' or '#F00')\n * @param {number} [variables.opacity=1] - The opacity value between 0 and 1\n *\n * @returns {string} The color in RGBA format (e.g., 'rgba(255, 0, 0, 0.5)')\n *\n * @example\n * // Using named color\n * colorToRgba({ color: 'transparent' })\n * // Returns: 'rgba(0, 0, 0, 0)'\n *\n * @example\n * // Using RGB with custom opacity\n * colorToRgba({ color: 'rgb(255, 0, 0)', opacity: 0.5 })\n * // Returns: 'rgba(255, 0, 0, 0.5)'\n *\n * @example\n * // Using hex color\n * colorToRgba({ color: '#FF0000' })\n * // Returns: 'rgba(255, 0, 0, 1)'\n *\n * @example\n * // Using short hex color\n * colorToRgba({ color: '#F00' })\n * // Returns: 'rgba(255, 0, 0, 1)'\n */\nexport const colorToRgba = (variables: {\n color: string;\n opacity?: number;\n}): string => {\n const { color, opacity = 1 } = variables;\n\n // Handle named colors\n const namedColors: { [key: string]: string } = {\n transparent: \"rgba(0, 0, 0, 0)\",\n black: \"rgba(0, 0, 0, 1)\",\n white: \"rgba(255, 255, 255, 1)\",\n blue: \"rgba(0, 0, 255, 1)\",\n green: \"rgba(0, 128, 0, 1)\",\n gray: \"rgba(128, 128, 128, 1)\",\n red: \"rgba(255, 0, 0, 1)\",\n };\n\n if (color in namedColors) {\n return namedColors[color];\n }\n\n // Handle RGB format\n if (color.startsWith(\"rgb(\")) {\n const rgbValues = color\n .replace(\"rgb(\", \"\")\n .replace(\")\", \"\")\n .split(\",\")\n .map((value) => parseInt(value.trim(), 10));\n const [r, g, b] = rgbValues;\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n\n // Handle hex format\n if (color.startsWith(\"#\")) {\n let hexColor = color.slice(1);\n if (hexColor.length === 3) {\n hexColor = hexColor\n .split(\"\")\n .map((value) => value + value)\n .join(\"\");\n }\n const r = parseInt(hexColor.slice(0, 2), 16);\n const g = parseInt(hexColor.slice(2, 4), 16);\n const b = parseInt(hexColor.slice(4, 6), 16);\n\n // Validate that all color components are valid numbers\n if (isNaN(r) || isNaN(g) || isNaN(b)) {\n return color; // Return original if malformed\n }\n\n return `rgba(${r}, ${g}, ${b}, ${opacity})`;\n }\n\n return color; // Return unchanged if unable to parse\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAIC,SAG3B,IAAa;EACV,MAAM;IAAEC,KAAK;IAAEC,OAAO,GAAG;EAAE,CAAC,GAAGF,SAAS;;EAExC;EACA,MAAMG,WAAsC,GAAG;IAC3CC,WAAW,EAAE,kBAAkB;IAC/BC,KAAK,EAAE,kBAAkB;IACzBC,KAAK,EAAE,wBAAwB;IAC/BC,IAAI,EAAE,oBAAoB;IAC1BC,KAAK,EAAE,oBAAoB;IAC3BC,IAAI,EAAE,wBAAwB;IAC9BC,GAAG,EAAE;EACT,CAAC;EAED,IAAIT,KAAK,IAAIE,WAAW,EAAE;IACtB,OAAOA,WAAW,CAACF,KAAK,CAAC;EAC7B;;EAEA;EACA,IAAIA,KAAK,CAACU,UAAU,CAAC,MAAM,CAAC,EAAE;IAC1B,MAAMC,SAAS,GAAGX,KAAK,CAClBY,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CACnBA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAChBC,KAAK,CAAC,GAAG,CAAC,CACVC,GAAG,CAAEC,KAAK,IAAKC,QAAQ,CAACD,KAAK,CAACE,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/C,MAAM,CAACC,CAAC,EAAEC,CAAC,EAAEC,CAAC,CAAC,GAAGT,SAAS;IAC3B,OAAO,QAAQO,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKnB,OAAO,GAAG;EAC/C;;EAEA;EACA,IAAID,KAAK,CAACU,UAAU,CAAC,GAAG,CAAC,EAAE;IACvB,IAAIW,QAAQ,GAAGrB,KAAK,CAACsB,KAAK,CAAC,CAAC,CAAC;IAC7B,IAAID,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACvBF,QAAQ,GAAGA,QAAQ,CACdR,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAAEC,KAAK,IAAKA,KAAK,GAAGA,KAAK,CAAC,CAC7BS,IAAI,CAAC,EAAE,CAAC;IACjB;IACA,MAAMN,CAAC,GAAGF,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5C,MAAMH,CAAC,GAAGH,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5C,MAAMF,CAAC,GAAGJ,QAAQ,CAACK,QAAQ,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;;IAE5C;IACA,IAAIG,KAAK,CAACP,CAAC,CAAC,IAAIO,KAAK,CAACN,CAAC,CAAC,IAAIM,KAAK,CAACL,CAAC,CAAC,EAAE;MAClC,OAAOpB,KAAK,CAAC,CAAC;IAClB;IAEA,OAAO,QAAQkB,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKnB,OAAO,GAAG;EAC/C;EAEA,OAAOD,KAAK,CAAC,CAAC;AAClB,CAAC;AAAC0B,OAAA,CAAA5B,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -31,7 +31,7 @@ exports.getAdjustedLimit = void 0;
31
31
  */
32
32
  const getAdjustedLimit = (limit, numberOfItems, interval) => {
33
33
  const maxValue = (numberOfItems - 1) * interval;
34
- if (!limit || !limit.max && !limit.min) {
34
+ if (!limit || limit.max === undefined && limit.min === undefined) {
35
35
  return {
36
36
  max: maxValue,
37
37
  min: 0
@@ -39,8 +39,8 @@ const getAdjustedLimit = (limit, numberOfItems, interval) => {
39
39
  }
40
40
 
41
41
  // guard against limits that are out of bounds
42
- const adjustedMaxLimit = limit.max ? Math.min(limit.max, maxValue) : maxValue;
43
- const adjustedMinLimit = limit.min ? Math.max(limit.min, 0) : 0;
42
+ const adjustedMaxLimit = limit.max !== undefined ? Math.min(limit.max, maxValue) : maxValue;
43
+ const adjustedMinLimit = limit.min !== undefined ? Math.max(limit.min, 0) : 0;
44
44
 
45
45
  // guard against invalid limits
46
46
  if (adjustedMaxLimit < adjustedMinLimit) {
@@ -1 +1 @@
1
- {"version":3,"names":["getAdjustedLimit","limit","numberOfItems","interval","maxValue","max","min","adjustedMaxLimit","Math","adjustedMinLimit","exports"],"sources":["getAdjustedLimit.ts"],"sourcesContent":["import type { Limit } from \"../components/DurationScroll/types\";\n\n/**\n * Adjusts and validates the min/max limits for a scrollable number picker.\n * Ensures limits are within valid bounds and handles edge cases.\n *\n * @param {Limit | undefined} limit - The input limit object containing optional min and max values\n * @param {number} numberOfItems - Total number of items in the picker\n * @param {number} interval - The interval between consecutive numbers\n *\n * @returns {{ max: number; min: number }} An object containing the adjusted min and max limits\n *\n * @example\n * // With valid limits\n * getAdjustedLimit({ min: 5, max: 15 }, 20, 1)\n * // Returns: { max: 15, min: 5 }\n *\n * @example\n * // With out-of-bounds limits\n * getAdjustedLimit({ min: -5, max: 25 }, 20, 1)\n * // Returns: { max: 19, min: 0 }\n *\n * @example\n * // With invalid limits (max < min)\n * getAdjustedLimit({ min: 15, max: 5 }, 20, 1)\n * // Returns: { max: 19, min: 0 }\n */\nexport const getAdjustedLimit = (\n limit: Limit | undefined,\n numberOfItems: number,\n interval: number\n): {\n max: number;\n min: number;\n} => {\n const maxValue = (numberOfItems - 1) * interval;\n\n if (!limit || (!limit.max && !limit.min)) {\n return {\n max: maxValue,\n min: 0,\n };\n }\n\n // guard against limits that are out of bounds\n const adjustedMaxLimit = limit.max\n ? Math.min(limit.max, maxValue)\n : maxValue;\n const adjustedMinLimit = limit.min ? Math.max(limit.min, 0) : 0;\n\n // guard against invalid limits\n if (adjustedMaxLimit < adjustedMinLimit) {\n return {\n max: maxValue,\n min: 0,\n };\n }\n\n return {\n max: adjustedMaxLimit,\n min: adjustedMinLimit,\n };\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGA,CAC5BC,KAAwB,EACxBC,aAAqB,EACrBC,QAAgB,KAIf;EACD,MAAMC,QAAQ,GAAG,CAACF,aAAa,GAAG,CAAC,IAAIC,QAAQ;EAE/C,IAAI,CAACF,KAAK,IAAK,CAACA,KAAK,CAACI,GAAG,IAAI,CAACJ,KAAK,CAACK,GAAI,EAAE;IACtC,OAAO;MACHD,GAAG,EAAED,QAAQ;MACbE,GAAG,EAAE;IACT,CAAC;EACL;;EAEA;EACA,MAAMC,gBAAgB,GAAGN,KAAK,CAACI,GAAG,GAC5BG,IAAI,CAACF,GAAG,CAACL,KAAK,CAACI,GAAG,EAAED,QAAQ,CAAC,GAC7BA,QAAQ;EACd,MAAMK,gBAAgB,GAAGR,KAAK,CAACK,GAAG,GAAGE,IAAI,CAACH,GAAG,CAACJ,KAAK,CAACK,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;;EAE/D;EACA,IAAIC,gBAAgB,GAAGE,gBAAgB,EAAE;IACrC,OAAO;MACHJ,GAAG,EAAED,QAAQ;MACbE,GAAG,EAAE;IACT,CAAC;EACL;EAEA,OAAO;IACHD,GAAG,EAAEE,gBAAgB;IACrBD,GAAG,EAAEG;EACT,CAAC;AACL,CAAC;AAACC,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["getAdjustedLimit","limit","numberOfItems","interval","maxValue","max","undefined","min","adjustedMaxLimit","Math","adjustedMinLimit","exports"],"sources":["getAdjustedLimit.ts"],"sourcesContent":["import type { Limit } from \"../components/DurationScroll/types\";\n\n/**\n * Adjusts and validates the min/max limits for a scrollable number picker.\n * Ensures limits are within valid bounds and handles edge cases.\n *\n * @param {Limit | undefined} limit - The input limit object containing optional min and max values\n * @param {number} numberOfItems - Total number of items in the picker\n * @param {number} interval - The interval between consecutive numbers\n *\n * @returns {{ max: number; min: number }} An object containing the adjusted min and max limits\n *\n * @example\n * // With valid limits\n * getAdjustedLimit({ min: 5, max: 15 }, 20, 1)\n * // Returns: { max: 15, min: 5 }\n *\n * @example\n * // With out-of-bounds limits\n * getAdjustedLimit({ min: -5, max: 25 }, 20, 1)\n * // Returns: { max: 19, min: 0 }\n *\n * @example\n * // With invalid limits (max < min)\n * getAdjustedLimit({ min: 15, max: 5 }, 20, 1)\n * // Returns: { max: 19, min: 0 }\n */\nexport const getAdjustedLimit = (\n limit: Limit | undefined,\n numberOfItems: number,\n interval: number\n): {\n max: number;\n min: number;\n} => {\n const maxValue = (numberOfItems - 1) * interval;\n\n if (!limit || (limit.max === undefined && limit.min === undefined)) {\n return {\n max: maxValue,\n min: 0,\n };\n }\n\n // guard against limits that are out of bounds\n const adjustedMaxLimit = limit.max !== undefined\n ? Math.min(limit.max, maxValue)\n : maxValue;\n const adjustedMinLimit = limit.min !== undefined ? Math.max(limit.min, 0) : 0;\n\n // guard against invalid limits\n if (adjustedMaxLimit < adjustedMinLimit) {\n return {\n max: maxValue,\n min: 0,\n };\n }\n\n return {\n max: adjustedMaxLimit,\n min: adjustedMinLimit,\n };\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGA,CAC5BC,KAAwB,EACxBC,aAAqB,EACrBC,QAAgB,KAIf;EACD,MAAMC,QAAQ,GAAG,CAACF,aAAa,GAAG,CAAC,IAAIC,QAAQ;EAE/C,IAAI,CAACF,KAAK,IAAKA,KAAK,CAACI,GAAG,KAAKC,SAAS,IAAIL,KAAK,CAACM,GAAG,KAAKD,SAAU,EAAE;IAChE,OAAO;MACHD,GAAG,EAAED,QAAQ;MACbG,GAAG,EAAE;IACT,CAAC;EACL;;EAEA;EACA,MAAMC,gBAAgB,GAAGP,KAAK,CAACI,GAAG,KAAKC,SAAS,GAC1CG,IAAI,CAACF,GAAG,CAACN,KAAK,CAACI,GAAG,EAAED,QAAQ,CAAC,GAC7BA,QAAQ;EACd,MAAMM,gBAAgB,GAAGT,KAAK,CAACM,GAAG,KAAKD,SAAS,GAAGG,IAAI,CAACJ,GAAG,CAACJ,KAAK,CAACM,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC;;EAE7E;EACA,IAAIC,gBAAgB,GAAGE,gBAAgB,EAAE;IACrC,OAAO;MACHL,GAAG,EAAED,QAAQ;MACbG,GAAG,EAAE;IACT,CAAC;EACL;EAEA,OAAO;IACHF,GAAG,EAAEG,gBAAgB;IACrBD,GAAG,EAAEG;EACT,CAAC;AACL,CAAC;AAACC,OAAA,CAAAX,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -62,5 +62,99 @@ describe("DurationScroll", () => {
62
62
  const label = getByText("Duration");
63
63
  expect(label).toBeDefined();
64
64
  });
65
+ it("does not render label when not provided", () => {
66
+ const {
67
+ queryByTestId
68
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
69
+ aggressivelyGetLatestDuration: false,
70
+ interval: 1,
71
+ maximumValue: 59,
72
+ onDurationChange: onDurationChangeMock,
73
+ padWithNItems: 1,
74
+ repeatNumbersNTimesNotExplicitlySet: true,
75
+ styles: emptyStyles
76
+ }));
77
+ const label = queryByTestId("picker-label");
78
+ expect(label).toBeNull();
79
+ });
80
+ it("handles different intervals", () => {
81
+ const {
82
+ getAllByTestId
83
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
84
+ aggressivelyGetLatestDuration: false,
85
+ interval: 5,
86
+ maximumValue: 55,
87
+ onDurationChange: onDurationChangeMock,
88
+ padWithNItems: 1,
89
+ repeatNumbersNTimesNotExplicitlySet: true,
90
+ styles: emptyStyles
91
+ }));
92
+ const items = getAllByTestId("picker-item");
93
+ expect(items).toBeDefined();
94
+ });
95
+ it("renders with zero padWithNItems", () => {
96
+ const {
97
+ getByTestId
98
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
99
+ aggressivelyGetLatestDuration: false,
100
+ interval: 1,
101
+ maximumValue: 59,
102
+ onDurationChange: onDurationChangeMock,
103
+ padWithNItems: 0,
104
+ repeatNumbersNTimesNotExplicitlySet: true,
105
+ styles: emptyStyles,
106
+ testID: "duration-scroll"
107
+ }));
108
+ const component = getByTestId("duration-scroll");
109
+ expect(component).toBeDefined();
110
+ });
111
+ it("handles large maximumValue", () => {
112
+ const {
113
+ getByTestId
114
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
115
+ aggressivelyGetLatestDuration: false,
116
+ interval: 1,
117
+ maximumValue: 999,
118
+ onDurationChange: onDurationChangeMock,
119
+ padWithNItems: 1,
120
+ repeatNumbersNTimesNotExplicitlySet: true,
121
+ styles: emptyStyles,
122
+ testID: "duration-scroll"
123
+ }));
124
+ const component = getByTestId("duration-scroll");
125
+ expect(component).toBeDefined();
126
+ });
127
+ it("handles aggressivelyGetLatestDuration set to true", () => {
128
+ const {
129
+ getByTestId
130
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
131
+ aggressivelyGetLatestDuration: true,
132
+ interval: 1,
133
+ maximumValue: 59,
134
+ onDurationChange: onDurationChangeMock,
135
+ padWithNItems: 1,
136
+ repeatNumbersNTimesNotExplicitlySet: true,
137
+ styles: emptyStyles,
138
+ testID: "duration-scroll"
139
+ }));
140
+ const component = getByTestId("duration-scroll");
141
+ expect(component).toBeDefined();
142
+ });
143
+ it("handles repeatNumbersNTimesNotExplicitlySet set to false", () => {
144
+ const {
145
+ getByTestId
146
+ } = render(/*#__PURE__*/React.createElement(DurationScroll, {
147
+ aggressivelyGetLatestDuration: false,
148
+ interval: 1,
149
+ maximumValue: 59,
150
+ onDurationChange: onDurationChangeMock,
151
+ padWithNItems: 1,
152
+ repeatNumbersNTimesNotExplicitlySet: false,
153
+ styles: emptyStyles,
154
+ testID: "duration-scroll"
155
+ }));
156
+ const component = getByTestId("duration-scroll");
157
+ expect(component).toBeDefined();
158
+ });
65
159
  });
66
160
  //# sourceMappingURL=DurationScroll.test.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","render","DurationScroll","describe","onDurationChangeMock","jest","fn","emptyStyles","pickerContainer","pickerLabelContainer","pickerLabel","pickerItemContainer","pickerItem","pickerAmPmContainer","pickerAmPmLabel","disabledPickerContainer","disabledPickerItem","pickerGradientOverlay","it","getByTestId","createElement","aggressivelyGetLatestDuration","interval","maximumValue","onDurationChange","padWithNItems","repeatNumbersNTimesNotExplicitlySet","styles","testID","component","expect","toBeDefined","getAllByTestId","items","toHaveLength","getByText","label"],"sources":["DurationScroll.test.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { render } from \"@testing-library/react-native\";\n\nimport DurationScroll from \"../components/DurationScroll\";\nimport type { generateStyles } from \"../components/TimerPicker/styles\";\n\ndescribe(\"DurationScroll\", () => {\n const onDurationChangeMock = jest.fn();\n const emptyStyles = {\n pickerContainer: {},\n pickerLabelContainer: {},\n pickerLabel: {},\n pickerItemContainer: {},\n pickerItem: {},\n pickerAmPmContainer: {},\n pickerAmPmLabel: {},\n disabledPickerContainer: {},\n disabledPickerItem: {},\n pickerGradientOverlay: {},\n } as ReturnType<typeof generateStyles>;\n\n it(\"renders without crashing\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={1}\n onDurationChange={onDurationChangeMock}\n padWithNItems={0}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n\n it(\"renders the correct number of items\", () => {\n const { getAllByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={23}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const items = getAllByTestId(\"picker-item\");\n expect(items).toHaveLength(10);\n });\n\n it(\"renders the label if provided\", () => {\n const { getByText } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n label=\"Duration\"\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const label = getByText(\"Duration\");\n expect(label).toBeDefined();\n });\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,QAAQ,+BAA+B;AAEtD,OAAOC,cAAc,MAAM,8BAA8B;AAGzDC,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC7B,MAAMC,oBAAoB,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;EACtC,MAAMC,WAAW,GAAG;IAChBC,eAAe,EAAE,CAAC,CAAC;IACnBC,oBAAoB,EAAE,CAAC,CAAC;IACxBC,WAAW,EAAE,CAAC,CAAC;IACfC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,UAAU,EAAE,CAAC,CAAC;IACdC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,eAAe,EAAE,CAAC,CAAC;IACnBC,uBAAuB,EAAE,CAAC,CAAC;IAC3BC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,qBAAqB,EAAE,CAAC;EAC5B,CAAsC;EAEtCC,EAAE,CAAC,0BAA0B,EAAE,MAAM;IACjC,MAAM;MAAEC;IAAY,CAAC,GAAGlB,MAAM,cAC1BD,KAAA,CAAAoB,aAAA,CAAClB,cAAc;MACXmB,6BAA6B,EAAE,KAAM;MACrCC,QAAQ,EAAE,CAAE;MACZC,YAAY,EAAE,CAAE;MAChBC,gBAAgB,EAAEpB,oBAAqB;MACvCqB,aAAa,EAAE,CAAE;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["React","render","DurationScroll","describe","onDurationChangeMock","jest","fn","emptyStyles","pickerContainer","pickerLabelContainer","pickerLabel","pickerItemContainer","pickerItem","pickerAmPmContainer","pickerAmPmLabel","disabledPickerContainer","disabledPickerItem","pickerGradientOverlay","it","getByTestId","createElement","aggressivelyGetLatestDuration","interval","maximumValue","onDurationChange","padWithNItems","repeatNumbersNTimesNotExplicitlySet","styles","testID","component","expect","toBeDefined","getAllByTestId","items","toHaveLength","getByText","label","queryByTestId","toBeNull"],"sources":["DurationScroll.test.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { render } from \"@testing-library/react-native\";\n\nimport DurationScroll from \"../components/DurationScroll\";\nimport type { generateStyles } from \"../components/TimerPicker/styles\";\n\ndescribe(\"DurationScroll\", () => {\n const onDurationChangeMock = jest.fn();\n const emptyStyles = {\n pickerContainer: {},\n pickerLabelContainer: {},\n pickerLabel: {},\n pickerItemContainer: {},\n pickerItem: {},\n pickerAmPmContainer: {},\n pickerAmPmLabel: {},\n disabledPickerContainer: {},\n disabledPickerItem: {},\n pickerGradientOverlay: {},\n } as ReturnType<typeof generateStyles>;\n\n it(\"renders without crashing\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={1}\n onDurationChange={onDurationChangeMock}\n padWithNItems={0}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n\n it(\"renders the correct number of items\", () => {\n const { getAllByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={23}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const items = getAllByTestId(\"picker-item\");\n expect(items).toHaveLength(10);\n });\n\n it(\"renders the label if provided\", () => {\n const { getByText } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n label=\"Duration\"\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const label = getByText(\"Duration\");\n expect(label).toBeDefined();\n });\n\n it(\"does not render label when not provided\", () => {\n const { queryByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const label = queryByTestId(\"picker-label\");\n expect(label).toBeNull();\n });\n\n it(\"handles different intervals\", () => {\n const { getAllByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={5}\n maximumValue={55}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n />\n );\n const items = getAllByTestId(\"picker-item\");\n expect(items).toBeDefined();\n });\n\n it(\"renders with zero padWithNItems\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={0}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n\n it(\"handles large maximumValue\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={999}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n\n it(\"handles aggressivelyGetLatestDuration set to true\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={true}\n interval={1}\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={true}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n\n it(\"handles repeatNumbersNTimesNotExplicitlySet set to false\", () => {\n const { getByTestId } = render(\n <DurationScroll\n aggressivelyGetLatestDuration={false}\n interval={1}\n maximumValue={59}\n onDurationChange={onDurationChangeMock}\n padWithNItems={1}\n repeatNumbersNTimesNotExplicitlySet={false}\n styles={emptyStyles}\n testID=\"duration-scroll\"\n />\n );\n const component = getByTestId(\"duration-scroll\");\n expect(component).toBeDefined();\n });\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,MAAM,QAAQ,+BAA+B;AAEtD,OAAOC,cAAc,MAAM,8BAA8B;AAGzDC,QAAQ,CAAC,gBAAgB,EAAE,MAAM;EAC7B,MAAMC,oBAAoB,GAAGC,IAAI,CAACC,EAAE,CAAC,CAAC;EACtC,MAAMC,WAAW,GAAG;IAChBC,eAAe,EAAE,CAAC,CAAC;IACnBC,oBAAoB,EAAE,CAAC,CAAC;IACxBC,WAAW,EAAE,CAAC,CAAC;IACfC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,UAAU,EAAE,CAAC,CAAC;IACdC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,eAAe,EAAE,CAAC,CAAC;IACnBC,uBAAuB,EAAE,CAAC,CAAC;IAC3BC,kBAAkB,EAAE,CAAC,CAAC;IACtBC,qBAAqB,EAAE,CAAC;EAC5B,CAAsC;EAEtCC,EAAE,CAAC,0BAA0B,EAAE,MAAM;IACjC,MAAM;MAAEC;IAAY,CAAC,GAAGlB,MAAM,cAC1BD,KAAA,CAAAoB,aAAA,CAAClB,cAAc;MACXmB,6BAA6B,EAAE,KAAM;MACrCC,QAAQ,EAAE,CAAE;MACZC,YAAY,EAAE,CAAE;MAChBC,gBAAgB,EAAEpB,oBAAqB;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AAGlB,MAAM,cAC1BD,KAAA,CAAAoB,aAAA,CAAClB,cAAc;MACXmB,6BAA6B,EAAE,KAAM;MACrCC,QAAQ,EAAE,CAAE;MACZC,YAAY,EAAE,EAAG;MACjBC,gBAAgB,EAAEpB,oBAAqB;MACvCqB,aAAa,EAAE,CAAE;MACjBC,mCAAmC,EAAE,KAAM;MAC3CC,MAAM,EAAEpB,WAAY;MACpBqB,MAAM,EAAC;IAAiB,CAC3B,CACL,CAAC;IACD,MAAMC,SAAS,GAAGV,WAAW,CAAC,iBAAiB,CAAC;IAChDW,MAAM,CAACD,SAAS,CAAC,CAACE,WAAW,CAAC,CAAC;EACnC,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
@@ -1,8 +1,16 @@
1
1
  import React from "react";
2
- import { render, fireEvent } from "@testing-library/react-native";
2
+ import { render, fireEvent, cleanup } from "@testing-library/react-native";
3
3
  import { Text } from "react-native";
4
4
  import Modal from "../components/Modal";
5
5
  describe("Modal", () => {
6
+ beforeEach(() => {
7
+ jest.useFakeTimers();
8
+ });
9
+ afterEach(() => {
10
+ jest.runOnlyPendingTimers();
11
+ jest.useRealTimers();
12
+ cleanup();
13
+ });
6
14
  it("renders without crashing", () => {
7
15
  const {
8
16
  getByTestId
@@ -33,7 +41,76 @@ describe("Modal", () => {
33
41
  fireEvent.press(overlay);
34
42
  expect(onOverlayPressMock).toHaveBeenCalled();
35
43
  });
36
-
37
- // Add more test cases to cover different interactions, scenarios, and edge cases
44
+ it("renders but is not visible when isVisible is false", () => {
45
+ const {
46
+ getByTestId
47
+ } = render(/*#__PURE__*/React.createElement(Modal, {
48
+ isVisible: false
49
+ }));
50
+ const modal = getByTestId("modal");
51
+ expect(modal).toBeDefined();
52
+ expect(modal.props.visible).toBe(false);
53
+ });
54
+ it("does not call onOverlayPress when onOverlayPress is not provided", () => {
55
+ const {
56
+ getByTestId
57
+ } = render(/*#__PURE__*/React.createElement(Modal, {
58
+ isVisible: true
59
+ }));
60
+ const overlay = getByTestId("modal-backdrop");
61
+ expect(() => fireEvent.press(overlay)).not.toThrow();
62
+ });
63
+ it("renders multiple children", () => {
64
+ const {
65
+ getByText
66
+ } = render(/*#__PURE__*/React.createElement(Modal, {
67
+ isVisible: true
68
+ }, /*#__PURE__*/React.createElement(Text, null, "First Child"), /*#__PURE__*/React.createElement(Text, null, "Second Child")));
69
+ const firstChild = getByText("First Child");
70
+ const secondChild = getByText("Second Child");
71
+ expect(firstChild).toBeDefined();
72
+ expect(secondChild).toBeDefined();
73
+ });
74
+ it("handles rapid visibility changes", () => {
75
+ const {
76
+ rerender,
77
+ getByTestId
78
+ } = render(/*#__PURE__*/React.createElement(Modal, {
79
+ isVisible: true
80
+ }));
81
+ expect(getByTestId("modal")).toBeDefined();
82
+ expect(getByTestId("modal").props.visible).toBe(true);
83
+ rerender(/*#__PURE__*/React.createElement(Modal, {
84
+ isVisible: false
85
+ }));
86
+ expect(getByTestId("modal")).toBeDefined();
87
+ expect(getByTestId("modal").props.visible).toBe(false);
88
+ rerender(/*#__PURE__*/React.createElement(Modal, {
89
+ isVisible: true
90
+ }));
91
+ expect(getByTestId("modal")).toBeDefined();
92
+ expect(getByTestId("modal").props.visible).toBe(true);
93
+ });
94
+ it("calls onOverlayPress exactly once per press", () => {
95
+ const onOverlayPressMock = jest.fn();
96
+ const {
97
+ getByTestId
98
+ } = render(/*#__PURE__*/React.createElement(Modal, {
99
+ isVisible: true,
100
+ onOverlayPress: onOverlayPressMock
101
+ }));
102
+ const overlay = getByTestId("modal-backdrop");
103
+ fireEvent.press(overlay);
104
+ expect(onOverlayPressMock).toHaveBeenCalledTimes(1);
105
+ });
106
+ it("renders children with complex structure", () => {
107
+ const {
108
+ getByText
109
+ } = render(/*#__PURE__*/React.createElement(Modal, {
110
+ isVisible: true
111
+ }, /*#__PURE__*/React.createElement(Text, null, "Parent"), /*#__PURE__*/React.createElement(Text, null, "Child")));
112
+ expect(getByText("Parent")).toBeDefined();
113
+ expect(getByText("Child")).toBeDefined();
114
+ });
38
115
  });
39
116
  //# sourceMappingURL=Modal.test.js.map