@terreno/ui 57.19.2 → 57.21.0

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 (379) hide show
  1. package/.ai/guidelines/core.md +1 -1
  2. package/CHANGELOG.md +443 -0
  3. package/dist/Accordion.d.ts.map +1 -1
  4. package/dist/Accordion.js +3 -3
  5. package/dist/Accordion.js.map +1 -1
  6. package/dist/Avatar.d.ts.map +1 -1
  7. package/dist/Avatar.js +3 -1
  8. package/dist/Avatar.js.map +1 -1
  9. package/dist/Box.d.ts.map +1 -1
  10. package/dist/Box.js +38 -2
  11. package/dist/Box.js.map +1 -1
  12. package/dist/Card.js +2 -2
  13. package/dist/Card.js.map +1 -1
  14. package/dist/Common.d.ts +175 -34
  15. package/dist/Common.d.ts.map +1 -1
  16. package/dist/Common.js.map +1 -1
  17. package/dist/ConsentFormScreen.d.ts +1 -1
  18. package/dist/ConsentFormScreen.d.ts.map +1 -1
  19. package/dist/ConsentFormScreen.js +13 -4
  20. package/dist/ConsentFormScreen.js.map +1 -1
  21. package/dist/DateTimeField.d.ts.map +1 -1
  22. package/dist/DateTimeField.js +11 -9
  23. package/dist/DateTimeField.js.map +1 -1
  24. package/dist/Field.d.ts.map +1 -1
  25. package/dist/Field.js +2 -0
  26. package/dist/Field.js.map +1 -1
  27. package/dist/FormContainer.d.ts +68 -0
  28. package/dist/FormContainer.d.ts.map +1 -0
  29. package/dist/FormContainer.js +79 -0
  30. package/dist/FormContainer.js.map +1 -0
  31. package/dist/GPTChat.d.ts.map +1 -1
  32. package/dist/GPTChat.js +2 -1
  33. package/dist/GPTChat.js.map +1 -1
  34. package/dist/Heading.d.ts +1 -1
  35. package/dist/Heading.d.ts.map +1 -1
  36. package/dist/Heading.js +5 -2
  37. package/dist/Heading.js.map +1 -1
  38. package/dist/HeightField.js +8 -8
  39. package/dist/HeightField.js.map +1 -1
  40. package/dist/Icon.d.ts +4 -0
  41. package/dist/Icon.d.ts.map +1 -1
  42. package/dist/Icon.js +43 -2
  43. package/dist/Icon.js.map +1 -1
  44. package/dist/LabeledCheckBox.d.ts +22 -0
  45. package/dist/LabeledCheckBox.d.ts.map +1 -0
  46. package/dist/LabeledCheckBox.js +30 -0
  47. package/dist/LabeledCheckBox.js.map +1 -0
  48. package/dist/ListDetailLayout.d.ts +36 -0
  49. package/dist/ListDetailLayout.d.ts.map +1 -0
  50. package/dist/ListDetailLayout.js +153 -0
  51. package/dist/ListDetailLayout.js.map +1 -0
  52. package/dist/MarkdownEditor.d.ts.map +1 -1
  53. package/dist/MarkdownEditor.js +2 -1
  54. package/dist/MarkdownEditor.js.map +1 -1
  55. package/dist/MediaQuery.d.ts +1 -1
  56. package/dist/MediaQuery.d.ts.map +1 -1
  57. package/dist/MediaQuery.js +1 -1
  58. package/dist/MediaQuery.js.map +1 -1
  59. package/dist/OtpField.d.ts +60 -0
  60. package/dist/OtpField.d.ts.map +1 -0
  61. package/dist/OtpField.js +154 -0
  62. package/dist/OtpField.js.map +1 -0
  63. package/dist/PickerSelect.js +9 -9
  64. package/dist/PickerSelect.js.map +1 -1
  65. package/dist/ProvisionalConsentSigner.d.ts +21 -0
  66. package/dist/ProvisionalConsentSigner.d.ts.map +1 -0
  67. package/dist/ProvisionalConsentSigner.js +199 -0
  68. package/dist/ProvisionalConsentSigner.js.map +1 -0
  69. package/dist/ResponsiveBreakpoint.d.ts +5 -0
  70. package/dist/ResponsiveBreakpoint.d.ts.map +1 -1
  71. package/dist/ResponsiveBreakpoint.js +7 -0
  72. package/dist/ResponsiveBreakpoint.js.map +1 -1
  73. package/dist/SocialLoginButton.d.ts +10 -0
  74. package/dist/SocialLoginButton.d.ts.map +1 -1
  75. package/dist/SocialLoginButton.js +26 -8
  76. package/dist/SocialLoginButton.js.map +1 -1
  77. package/dist/SplitPage.d.ts +11 -0
  78. package/dist/SplitPage.d.ts.map +1 -1
  79. package/dist/SplitPage.js +11 -5
  80. package/dist/SplitPage.js.map +1 -1
  81. package/dist/SplitPage.native.d.ts.map +1 -1
  82. package/dist/SplitPage.native.js +3 -1
  83. package/dist/SplitPage.native.js.map +1 -1
  84. package/dist/SyncStatusBanner.d.ts +7 -1
  85. package/dist/SyncStatusBanner.d.ts.map +1 -1
  86. package/dist/SyncStatusBanner.js +20 -4
  87. package/dist/SyncStatusBanner.js.map +1 -1
  88. package/dist/TapToEdit.d.ts +1 -1
  89. package/dist/TapToEdit.d.ts.map +1 -1
  90. package/dist/TapToEdit.js.map +1 -1
  91. package/dist/TextField.d.ts.map +1 -1
  92. package/dist/TextField.js +48 -14
  93. package/dist/TextField.js.map +1 -1
  94. package/dist/Theme.d.ts.map +1 -1
  95. package/dist/Theme.js +16 -0
  96. package/dist/Theme.js.map +1 -1
  97. package/dist/fieldElements/FieldError.d.ts.map +1 -1
  98. package/dist/fieldElements/FieldError.js +1 -1
  99. package/dist/fieldElements/FieldError.js.map +1 -1
  100. package/dist/index.d.ts +19 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +14 -1
  103. package/dist/index.js.map +1 -1
  104. package/dist/lazyBoundaries/heavyOptionalExports.d.ts +3 -0
  105. package/dist/lazyBoundaries/heavyOptionalExports.d.ts.map +1 -1
  106. package/dist/lazyBoundaries/heavyOptionalExports.js +2 -0
  107. package/dist/lazyBoundaries/heavyOptionalExports.js.map +1 -1
  108. package/dist/login/LastUsedBadge.d.ts +14 -0
  109. package/dist/login/LastUsedBadge.d.ts.map +1 -0
  110. package/dist/login/LastUsedBadge.js +23 -0
  111. package/dist/login/LastUsedBadge.js.map +1 -0
  112. package/dist/login/LoginAccountCard.d.ts +38 -0
  113. package/dist/login/LoginAccountCard.d.ts.map +1 -0
  114. package/dist/login/LoginAccountCard.js +72 -0
  115. package/dist/login/LoginAccountCard.js.map +1 -0
  116. package/dist/login/LoginAccountList.d.ts +33 -0
  117. package/dist/login/LoginAccountList.d.ts.map +1 -0
  118. package/dist/login/LoginAccountList.js +30 -0
  119. package/dist/login/LoginAccountList.js.map +1 -0
  120. package/dist/login/LoginScreen.d.ts +4 -4
  121. package/dist/login/LoginScreen.d.ts.map +1 -1
  122. package/dist/login/LoginScreen.js +294 -13
  123. package/dist/login/LoginScreen.js.map +1 -1
  124. package/dist/login/OutlinePill.d.ts +28 -0
  125. package/dist/login/OutlinePill.d.ts.map +1 -0
  126. package/dist/login/OutlinePill.js +48 -0
  127. package/dist/login/OutlinePill.js.map +1 -0
  128. package/dist/login/TwoFactorChallengeScreen.d.ts +26 -0
  129. package/dist/login/TwoFactorChallengeScreen.d.ts.map +1 -0
  130. package/dist/login/TwoFactorChallengeScreen.js +139 -0
  131. package/dist/login/TwoFactorChallengeScreen.js.map +1 -0
  132. package/dist/login/loginMethods.d.ts +27 -0
  133. package/dist/login/loginMethods.d.ts.map +1 -0
  134. package/dist/login/loginMethods.js +37 -0
  135. package/dist/login/loginMethods.js.map +1 -0
  136. package/dist/login/loginTypes.d.ts +202 -5
  137. package/dist/login/loginTypes.d.ts.map +1 -1
  138. package/dist/pdfHtmlTemplate.d.ts +17 -0
  139. package/dist/pdfHtmlTemplate.d.ts.map +1 -1
  140. package/dist/pdfHtmlTemplate.js +78 -0
  141. package/dist/pdfHtmlTemplate.js.map +1 -1
  142. package/dist/security/AccountSecurityScreen.d.ts +10 -0
  143. package/dist/security/AccountSecurityScreen.d.ts.map +1 -0
  144. package/dist/security/AccountSecurityScreen.js +50 -0
  145. package/dist/security/AccountSecurityScreen.js.map +1 -0
  146. package/dist/security/LinkedAccountsCard.d.ts +32 -0
  147. package/dist/security/LinkedAccountsCard.d.ts.map +1 -0
  148. package/dist/security/LinkedAccountsCard.js +145 -0
  149. package/dist/security/LinkedAccountsCard.js.map +1 -0
  150. package/dist/security/PasskeysCard.d.ts +39 -0
  151. package/dist/security/PasskeysCard.d.ts.map +1 -0
  152. package/dist/security/PasskeysCard.js +168 -0
  153. package/dist/security/PasskeysCard.js.map +1 -0
  154. package/dist/security/PasswordCard.d.ts +32 -0
  155. package/dist/security/PasswordCard.d.ts.map +1 -0
  156. package/dist/security/PasswordCard.js +198 -0
  157. package/dist/security/PasswordCard.js.map +1 -0
  158. package/dist/security/SessionsCard.d.ts +39 -0
  159. package/dist/security/SessionsCard.d.ts.map +1 -0
  160. package/dist/security/SessionsCard.js +168 -0
  161. package/dist/security/SessionsCard.js.map +1 -0
  162. package/dist/security/TwoFactorSettingsCard.d.ts +55 -0
  163. package/dist/security/TwoFactorSettingsCard.d.ts.map +1 -0
  164. package/dist/security/TwoFactorSettingsCard.js +458 -0
  165. package/dist/security/TwoFactorSettingsCard.js.map +1 -0
  166. package/dist/security/securityMethods.d.ts +40 -0
  167. package/dist/security/securityMethods.d.ts.map +1 -0
  168. package/dist/security/securityMethods.js +66 -0
  169. package/dist/security/securityMethods.js.map +1 -0
  170. package/dist/security/securityTypes.d.ts +467 -0
  171. package/dist/security/securityTypes.d.ts.map +1 -0
  172. package/dist/security/securityTypes.js +2 -0
  173. package/dist/security/securityTypes.js.map +1 -0
  174. package/dist/security/userAgent.d.ts +26 -0
  175. package/dist/security/userAgent.d.ts.map +1 -0
  176. package/dist/security/userAgent.js +80 -0
  177. package/dist/security/userAgent.js.map +1 -0
  178. package/dist/signUp/OAuthButtons.d.ts +28 -5
  179. package/dist/signUp/OAuthButtons.d.ts.map +1 -1
  180. package/dist/signUp/OAuthButtons.js +44 -5
  181. package/dist/signUp/OAuthButtons.js.map +1 -1
  182. package/dist/signUp/SignUpScreen.d.ts.map +1 -1
  183. package/dist/signUp/SignUpScreen.js +50 -5
  184. package/dist/signUp/SignUpScreen.js.map +1 -1
  185. package/dist/signUp/signUpTypes.d.ts +21 -1
  186. package/dist/signUp/signUpTypes.d.ts.map +1 -1
  187. package/dist/useConsentForms.d.ts +9 -0
  188. package/dist/useConsentForms.d.ts.map +1 -1
  189. package/dist/useConsentForms.js +18 -0
  190. package/dist/useConsentForms.js.map +1 -1
  191. package/dist/useProvisionalConsent.d.ts +124 -0
  192. package/dist/useProvisionalConsent.d.ts.map +1 -0
  193. package/dist/useProvisionalConsent.js +79 -0
  194. package/dist/useProvisionalConsent.js.map +1 -0
  195. package/package.json +5 -2
  196. package/src/Accordion.test.tsx +5 -0
  197. package/src/Accordion.tsx +3 -8
  198. package/src/ActionSheet.test.tsx +13 -13
  199. package/src/AddressField.test.tsx +9 -3
  200. package/src/AnnouncementNavigator.test.tsx +4 -4
  201. package/src/AreaChart.test.tsx +15 -0
  202. package/src/Avatar.test.tsx +8 -0
  203. package/src/Avatar.tsx +2 -0
  204. package/src/Badge.test.tsx +1 -1
  205. package/src/Banner.test.tsx +0 -1
  206. package/src/BarChart.test.tsx +15 -0
  207. package/src/Box.test.tsx +143 -75
  208. package/src/Box.tsx +44 -2
  209. package/src/Button.test.tsx +11 -6
  210. package/src/Card.test.tsx +2 -2
  211. package/src/Card.tsx +2 -2
  212. package/src/Common.ts +194 -36
  213. package/src/ConflictSheet.test.tsx +5 -5
  214. package/src/ConsentFormScreen.test.tsx +87 -1
  215. package/src/ConsentFormScreen.tsx +28 -4
  216. package/src/ConsentNavigator.test.tsx +1 -2
  217. package/src/CustomSelectField.test.tsx +16 -4
  218. package/src/DataTable.test.tsx +4 -4
  219. package/src/DataTableVirtualizationRegression.test.tsx +1 -0
  220. package/src/DateTimeActionSheet.test.tsx +2 -0
  221. package/src/DateTimeField.test.tsx +3 -12
  222. package/src/DateTimeField.tsx +11 -9
  223. package/src/DismissButton.test.tsx +22 -4
  224. package/src/DonutChart.test.tsx +15 -0
  225. package/src/EmailField.test.tsx +13 -22
  226. package/src/EmojiSelector.test.tsx +2 -2
  227. package/src/ErrorBoundary.test.tsx +5 -3
  228. package/src/Field.test.tsx +20 -44
  229. package/src/Field.tsx +2 -0
  230. package/src/FilePickerButton.test.tsx +35 -0
  231. package/src/FormContainer.test.tsx +242 -0
  232. package/src/FormContainer.tsx +177 -0
  233. package/src/GPTChat.test.tsx +40 -16
  234. package/src/GPTChat.tsx +8 -2
  235. package/src/Heading.test.tsx +15 -1
  236. package/src/Heading.tsx +6 -1
  237. package/src/HeightField.tsx +8 -8
  238. package/src/Icon.test.tsx +54 -3
  239. package/src/Icon.tsx +92 -3
  240. package/src/IconButton.test.tsx +85 -0
  241. package/src/Image.test.tsx +1 -1
  242. package/src/LabeledCheckBox.test.tsx +45 -0
  243. package/src/LabeledCheckBox.tsx +89 -0
  244. package/src/Link.test.tsx +11 -4
  245. package/src/ListDetailLayout.tsx +247 -0
  246. package/src/MarkdownEditor.tsx +2 -1
  247. package/src/MarkdownView.test.tsx +1 -1
  248. package/src/MediaQuery.ts +1 -0
  249. package/src/MobileAddressAutoComplete.test.tsx +2 -1
  250. package/src/Modal.test.tsx +7 -2
  251. package/src/ModalSheet.test.tsx +5 -4
  252. package/src/MultiselectField.test.tsx +17 -3
  253. package/src/NumberField.test.tsx +14 -14
  254. package/src/NumberPickerActionSheet.test.tsx +1 -1
  255. package/src/OpenAPIContext.test.tsx +4 -4
  256. package/src/OpenAPIRenderRegression.test.tsx +1 -1
  257. package/src/OtpField.test.tsx +280 -0
  258. package/src/OtpField.tsx +307 -0
  259. package/src/P0RenderRegression.test.tsx +7 -1
  260. package/src/P1RenderRegression.test.tsx +1 -0
  261. package/src/P2ButtonRenderRegression.test.tsx +1 -0
  262. package/src/Page.test.tsx +1 -1
  263. package/src/PhoneNumberField.test.tsx +14 -38
  264. package/src/PickerSelect.tsx +9 -9
  265. package/src/Popover.test.tsx +2 -2
  266. package/src/ProvisionalConsentSigner.test.tsx +625 -0
  267. package/src/ProvisionalConsentSigner.tsx +423 -0
  268. package/src/RadioField.test.tsx +7 -2
  269. package/src/ResponsiveBreakpoint.test.tsx +7 -0
  270. package/src/ResponsiveBreakpoint.tsx +14 -0
  271. package/src/RootImportRegression.test.tsx +3 -0
  272. package/src/SegmentedControl.test.tsx +21 -12
  273. package/src/SidebarNavigation.test.tsx +18 -6
  274. package/src/Signature.test.tsx +20 -23
  275. package/src/Slider.test.tsx +1 -1
  276. package/src/SocialLoginButton.test.tsx +14 -0
  277. package/src/SocialLoginButton.tsx +51 -7
  278. package/src/SplitPage.native.tsx +3 -1
  279. package/src/SplitPage.test.tsx +15 -5
  280. package/src/SplitPage.tsx +11 -5
  281. package/src/SyncStatusBanner.test.tsx +61 -4
  282. package/src/SyncStatusBanner.tsx +29 -3
  283. package/src/TapToEdit.test.tsx +38 -15
  284. package/src/TapToEdit.tsx +1 -1
  285. package/src/TerrenoFontProvider.test.tsx +1 -1
  286. package/src/Text.test.tsx +4 -4
  287. package/src/TextField.test.tsx +232 -9
  288. package/src/TextField.tsx +70 -12
  289. package/src/Theme.test.tsx +49 -0
  290. package/src/Theme.tsx +16 -0
  291. package/src/Toast.test.tsx +5 -5
  292. package/src/ToastNotifications.test.tsx +73 -70
  293. package/src/ToastNotifications.webModal.test.tsx +2 -2
  294. package/src/Tooltip.test.tsx +3 -3
  295. package/src/UnifiedAddressAutoComplete.test.tsx +1 -1
  296. package/src/UserInactivity.test.tsx +4 -2
  297. package/src/WebAddressAutocomplete.test.tsx +12 -12
  298. package/src/WebDropdownMenu.test.tsx +16 -15
  299. package/src/__snapshots__/AddressField.test.tsx.snap +12 -0
  300. package/src/__snapshots__/AiSuggestionBox.test.tsx.snap +15 -0
  301. package/src/__snapshots__/Avatar.test.tsx.snap +1 -0
  302. package/src/__snapshots__/Card.test.tsx.snap +1 -1
  303. package/src/__snapshots__/CustomSelectField.test.tsx.snap +3 -0
  304. package/src/__snapshots__/DismissButton.test.tsx.snap +3 -3
  305. package/src/__snapshots__/EmailField.test.tsx.snap +6 -0
  306. package/src/__snapshots__/Field.test.tsx.snap +41 -2
  307. package/src/__snapshots__/Heading.test.tsx.snap +1 -1
  308. package/src/__snapshots__/HeightField.test.tsx.snap +2 -0
  309. package/src/__snapshots__/Image.test.tsx.snap +1 -1
  310. package/src/__snapshots__/MobileAddressAutoComplete.test.tsx.snap +3 -0
  311. package/src/__snapshots__/NumberField.test.tsx.snap +3 -0
  312. package/src/__snapshots__/Page.test.tsx.snap +2 -2
  313. package/src/__snapshots__/PhoneNumberField.test.tsx.snap +12 -0
  314. package/src/__snapshots__/Slider.test.tsx.snap +1 -0
  315. package/src/__snapshots__/SocialLoginButton.test.tsx.snap +43 -22
  316. package/src/__snapshots__/TapToEdit.test.tsx.snap +3 -0
  317. package/src/__snapshots__/Text.test.tsx.snap +1 -1
  318. package/src/__snapshots__/TextArea.test.tsx.snap +17 -1
  319. package/src/__snapshots__/TextField.test.tsx.snap +19 -2
  320. package/src/__snapshots__/TypedSignatureField.test.tsx.snap +3 -0
  321. package/src/__snapshots__/UnifiedAddressAutoComplete.test.tsx.snap +18 -0
  322. package/src/__snapshots__/WebAddressAutocomplete.test.tsx.snap +12 -0
  323. package/src/asks/AskCard.test.tsx +16 -13
  324. package/src/asks/AskFiles.test.tsx +5 -1
  325. package/src/asks/askFileRefs.test.ts +1 -1
  326. package/src/asks/askSummary.test.ts +2 -2
  327. package/src/benchmarks/importTiming.ts +1 -1
  328. package/src/blocks/BlocksView.test.tsx +20 -11
  329. package/src/bunSetup.ts +14 -2
  330. package/src/dataTableFilters.test.tsx +1 -1
  331. package/src/fieldElements/FieldError.tsx +1 -0
  332. package/src/fieldElements/__snapshots__/FieldError.test.tsx.snap +2 -0
  333. package/src/index.tsx +42 -1
  334. package/src/isolated/ListDetailLayout.isolated.tsx +632 -0
  335. package/src/lazyBoundaries/heavyOptionalExports.tsx +7 -0
  336. package/src/login/LastUsedBadge.tsx +40 -0
  337. package/src/login/LoginAccountCard.tsx +205 -0
  338. package/src/login/LoginAccountList.tsx +115 -0
  339. package/src/login/LoginScreen.test.tsx +839 -3
  340. package/src/login/LoginScreen.tsx +674 -91
  341. package/src/login/OutlinePill.tsx +110 -0
  342. package/src/login/TwoFactorChallengeScreen.test.tsx +376 -0
  343. package/src/login/TwoFactorChallengeScreen.tsx +307 -0
  344. package/src/login/__snapshots__/LoginScreen.test.tsx.snap +1454 -334
  345. package/src/login/loginMethods.test.ts +53 -0
  346. package/src/login/loginMethods.ts +60 -0
  347. package/src/login/loginTypes.ts +208 -5
  348. package/src/pdfHtmlTemplate.test.ts +243 -4
  349. package/src/pdfHtmlTemplate.ts +93 -0
  350. package/src/security/AccountSecurityScreen.test.tsx +262 -0
  351. package/src/security/AccountSecurityScreen.tsx +156 -0
  352. package/src/security/LinkedAccountsCard.test.tsx +371 -0
  353. package/src/security/LinkedAccountsCard.tsx +297 -0
  354. package/src/security/PasskeysCard.test.tsx +378 -0
  355. package/src/security/PasskeysCard.tsx +371 -0
  356. package/src/security/PasswordCard.test.tsx +445 -0
  357. package/src/security/PasswordCard.tsx +342 -0
  358. package/src/security/SessionsCard.test.tsx +349 -0
  359. package/src/security/SessionsCard.tsx +362 -0
  360. package/src/security/TwoFactorSettingsCard.test.tsx +700 -0
  361. package/src/security/TwoFactorSettingsCard.tsx +872 -0
  362. package/src/security/securityMethods.test.ts +101 -0
  363. package/src/security/securityMethods.ts +104 -0
  364. package/src/security/securityTypes.ts +480 -0
  365. package/src/security/userAgent.test.ts +119 -0
  366. package/src/security/userAgent.ts +102 -0
  367. package/src/signUp/OAuthButtons.test.tsx +27 -0
  368. package/src/signUp/OAuthButtons.tsx +153 -19
  369. package/src/signUp/SignUpScreen.test.tsx +171 -2
  370. package/src/signUp/SignUpScreen.tsx +87 -25
  371. package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +22 -11
  372. package/src/signUp/signUpTypes.ts +23 -1
  373. package/src/table/tableContext.test.tsx +5 -5
  374. package/src/test-utils.tsx +56 -1
  375. package/src/testing/reactDomServer.d.ts +7 -0
  376. package/src/useConsentForms.test.ts +38 -2
  377. package/src/useConsentForms.ts +25 -0
  378. package/src/useProvisionalConsent.test.ts +256 -0
  379. package/src/useProvisionalConsent.ts +218 -0
@@ -1,6 +1,7 @@
1
1
  import {afterEach, describe, expect, it, mock} from "bun:test";
2
2
  import {act, fireEvent, render, waitFor} from "@testing-library/react-native";
3
3
  import {assert} from "chai";
4
+ import {DateTime} from "luxon";
4
5
  import {Platform} from "react-native";
5
6
 
6
7
  import {ConsentFormScreen} from "./ConsentFormScreen";
@@ -35,6 +36,89 @@ const waitForConsentMarkdown = async (getByText: (text: string) => unknown): Pro
35
36
  };
36
37
 
37
38
  describe("ConsentFormScreen", () => {
39
+ describe("provisional signature notice", () => {
40
+ const signedAt = "2026-10-20T15:30:00.000Z";
41
+
42
+ it("shows who signed on the user's behalf and when", () => {
43
+ const {getByTestId} = renderWithTheme(
44
+ <ConsentFormScreen
45
+ form={{...baseForm, provisionalSignature: {signedAt, signedByName: "Dana Rivera"}}}
46
+ locale="en"
47
+ onAgree={() => {}}
48
+ />
49
+ );
50
+ const expectedDate = DateTime.fromISO(signedAt)
51
+ .setLocale("en")
52
+ .toLocaleString(DateTime.DATETIME_MED);
53
+ const notice = getByTestId("consent-form-provisional-notice");
54
+ expect(notice).toBeTruthy();
55
+ expect(getByTestId("consent-form-provisional-notice-text").props.children).toBe(
56
+ `Signed on your behalf by Dana Rivera on ${expectedDate}`
57
+ );
58
+ });
59
+
60
+ it("leaves the date off when the signing date cannot be parsed", () => {
61
+ const {getByTestId} = renderWithTheme(
62
+ <ConsentFormScreen
63
+ form={{...baseForm, provisionalSignature: {signedAt: "bad", signedByName: "Dana Rivera"}}}
64
+ locale="en"
65
+ onAgree={() => {}}
66
+ />
67
+ );
68
+ expect(getByTestId("consent-form-provisional-notice-text").props.children).toBe(
69
+ "Signed on your behalf by Dana Rivera"
70
+ );
71
+ });
72
+
73
+ it("shows no notice when the form has no provisional signature", () => {
74
+ const {queryByTestId} = renderWithTheme(
75
+ <ConsentFormScreen form={baseForm} locale="en" onAgree={() => {}} />
76
+ );
77
+ expect(queryByTestId("consent-form-provisional-notice")).toBeNull();
78
+ });
79
+
80
+ it("still requires the user's own checkboxes and signature to agree", () => {
81
+ const onAgree = mock(() => {});
82
+ const {getByTestId} = renderWithTheme(
83
+ <ConsentFormScreen
84
+ form={{
85
+ ...baseForm,
86
+ captureSignature: true,
87
+ checkboxes: [{label: "I understand", required: true}],
88
+ provisionalSignature: {signedAt, signedByName: "Dana Rivera"},
89
+ }}
90
+ locale="en"
91
+ onAgree={onAgree}
92
+ />
93
+ );
94
+ expect(getByTestId("consent-form-agree-button").props.accessibilityState?.disabled).toBe(
95
+ true
96
+ );
97
+ expect(getByTestId("consent-footer-checkboxes-hint")).toBeTruthy();
98
+ expect(getByTestId("consent-footer-signature-hint")).toBeTruthy();
99
+ fireEvent.press(getByTestId("consent-form-agree-button"));
100
+ expect(onAgree).not.toHaveBeenCalled();
101
+ });
102
+
103
+ it("lets the user decline a provisionally signed form", async () => {
104
+ const onDecline = mock(() => {});
105
+ const {getByTestId} = renderWithTheme(
106
+ <ConsentFormScreen
107
+ form={{...baseForm, provisionalSignature: {signedAt, signedByName: "Dana Rivera"}}}
108
+ locale="en"
109
+ onAgree={() => {}}
110
+ onDecline={onDecline}
111
+ />
112
+ );
113
+ act(() => {
114
+ fireEvent.press(getByTestId("consent-form-decline-button"));
115
+ });
116
+ await waitFor(() => {
117
+ expect(onDecline).toHaveBeenCalledTimes(1);
118
+ });
119
+ });
120
+ });
121
+
38
122
  it("renders with default state and a locale fallback", () => {
39
123
  const onAgree = mock(() => {});
40
124
  const {getByTestId, getByText} = renderWithTheme(
@@ -61,7 +145,9 @@ describe("ConsentFormScreen", () => {
61
145
  });
62
146
 
63
147
  it("invokes onAgree with signature and checkbox values", () => {
64
- const onAgree = mock(() => {});
148
+ const onAgree = mock(
149
+ (_data: {checkboxValues: Record<string, boolean>; signature?: string}) => {}
150
+ );
65
151
  const form: ConsentFormPublic = {
66
152
  ...baseForm,
67
153
  captureSignature: false,
@@ -1,3 +1,4 @@
1
+ import {DateTime} from "luxon";
1
2
  import React, {useCallback, useRef, useState} from "react";
2
3
  import {
3
4
  type LayoutChangeEvent,
@@ -17,7 +18,7 @@ import {Modal} from "./Modal";
17
18
  import {Page} from "./Page";
18
19
  import {SignatureField} from "./SignatureField";
19
20
  import {Text} from "./Text";
20
- import type {ConsentFormPublic} from "./useConsentForms";
21
+ import {applyConsentVariables, type ConsentFormPublic} from "./useConsentForms";
21
22
 
22
23
  interface ConsentFormScreenProps {
23
24
  form: ConsentFormPublic;
@@ -49,9 +50,19 @@ export const ConsentFormScreen: React.FC<ConsentFormScreenProps> = ({
49
50
  const scrollViewRef = useRef<ScrollView>(null);
50
51
 
51
52
  const rawContent = form.content[locale] ?? form.content[form.defaultLocale] ?? "";
52
- const content = variables
53
- ? rawContent.replace(/\{\{(\w+)\}\}/g, (match, key) => variables[key] ?? match)
54
- : rawContent;
53
+ const content = applyConsentVariables(rawContent, variables);
54
+
55
+ // Staff may have signed provisionally; the user still reads and answers the form.
56
+ const provisionalSignedAt = form.provisionalSignature
57
+ ? DateTime.fromISO(form.provisionalSignature.signedAt).setLocale(locale)
58
+ : undefined;
59
+ const provisionalNotice = form.provisionalSignature
60
+ ? `Signed on your behalf by ${form.provisionalSignature.signedByName}${
61
+ provisionalSignedAt?.isValid
62
+ ? ` on ${provisionalSignedAt.toLocaleString(DateTime.DATETIME_MED)}`
63
+ : ""
64
+ }`
65
+ : undefined;
55
66
 
56
67
  const allRequiredCheckboxesChecked = form.checkboxes.every((checkbox, index) => {
57
68
  if (!checkbox.required) {
@@ -244,6 +255,19 @@ export const ConsentFormScreen: React.FC<ConsentFormScreenProps> = ({
244
255
  testID="consent-form-scroll-view"
245
256
  >
246
257
  <Box direction="column" gap={3} paddingY={2}>
258
+ {Boolean(provisionalNotice) && (
259
+ <Box
260
+ border="default"
261
+ color="secondaryExtraLight"
262
+ padding={3}
263
+ rounding="md"
264
+ testID="consent-form-provisional-notice"
265
+ >
266
+ <Text size="md" testID="consent-form-provisional-notice-text">
267
+ {provisionalNotice}
268
+ </Text>
269
+ </Box>
270
+ )}
247
271
  <MarkdownView onLoad={handleMarkdownLoad}>{content}</MarkdownView>
248
272
 
249
273
  {form.checkboxes.length > 0 && (
@@ -28,9 +28,8 @@ const makeForm = (overrides: Partial<ConsentFormPublic> = {}): ConsentFormPublic
28
28
  });
29
29
 
30
30
  const createMockApi = (forms: ConsentFormPublic[]) => {
31
- const mockSubmitMutation = mock(() => Promise.resolve({data: {agreed: true, id: "response-1"}}));
32
31
  const mockUnwrap = mock(() => Promise.resolve({agreed: true, id: "response-1"}));
33
- mockSubmitMutation.mockReturnValue({unwrap: mockUnwrap});
32
+ const mockSubmitMutation = mock(() => ({unwrap: mockUnwrap}));
34
33
 
35
34
  const innerApi = {
36
35
  injectEndpoints: mock((_config: unknown) => ({
@@ -13,14 +13,19 @@ describe("CustomSelectField", () => {
13
13
 
14
14
  it("renders correctly with default props", () => {
15
15
  const {toJSON} = renderWithTheme(
16
- <CustomSelectField onChange={() => {}} options={defaultOptions} />
16
+ <CustomSelectField onChange={() => {}} options={defaultOptions} value="" />
17
17
  );
18
18
  expect(toJSON()).toMatchSnapshot();
19
19
  });
20
20
 
21
21
  it("renders with title", () => {
22
22
  const {getByText, toJSON} = renderWithTheme(
23
- <CustomSelectField onChange={() => {}} options={defaultOptions} title="Select Option" />
23
+ <CustomSelectField
24
+ onChange={() => {}}
25
+ options={defaultOptions}
26
+ title="Select Option"
27
+ value=""
28
+ />
24
29
  );
25
30
  expect(getByText("Select Option")).toBeTruthy();
26
31
  expect(toJSON()).toMatchSnapshot();
@@ -28,7 +33,12 @@ describe("CustomSelectField", () => {
28
33
 
29
34
  it("renders with placeholder", () => {
30
35
  const {toJSON} = renderWithTheme(
31
- <CustomSelectField onChange={() => {}} options={defaultOptions} placeholder="Choose one..." />
36
+ <CustomSelectField
37
+ onChange={() => {}}
38
+ options={defaultOptions}
39
+ placeholder="Choose one..."
40
+ value=""
41
+ />
32
42
  );
33
43
  expect(toJSON()).toMatchSnapshot();
34
44
  });
@@ -53,6 +63,7 @@ describe("CustomSelectField", () => {
53
63
  errorText="Please select an option"
54
64
  onChange={() => {}}
55
65
  options={defaultOptions}
66
+ value=""
56
67
  />
57
68
  );
58
69
  expect(getByText("Please select an option")).toBeTruthy();
@@ -64,6 +75,7 @@ describe("CustomSelectField", () => {
64
75
  helperText="Select or enter a custom value"
65
76
  onChange={() => {}}
66
77
  options={defaultOptions}
78
+ value=""
67
79
  />
68
80
  );
69
81
  expect(getByText("Select or enter a custom value")).toBeTruthy();
@@ -79,7 +91,7 @@ describe("CustomSelectField", () => {
79
91
  it("includes custom option in dropdown", () => {
80
92
  // The component automatically adds a "Custom" option to the options list
81
93
  const {toJSON} = renderWithTheme(
82
- <CustomSelectField onChange={() => {}} options={defaultOptions} />
94
+ <CustomSelectField onChange={() => {}} options={defaultOptions} value="" />
83
95
  );
84
96
  expect(toJSON()).toMatchSnapshot();
85
97
  });
@@ -3,7 +3,7 @@ import {act, fireEvent, waitFor} from "@testing-library/react-native";
3
3
  import {type FC, useState} from "react";
4
4
  import {Platform, StyleSheet} from "react-native";
5
5
 
6
- import type {DataTableCustomComponentMap, DataTableProps} from "./Common";
6
+ import type {DataTableCellData, DataTableCustomComponentMap, DataTableProps} from "./Common";
7
7
  import {DataTable} from "./DataTable";
8
8
  import {Text} from "./Text";
9
9
  import {renderWithTheme} from "./test-utils";
@@ -290,7 +290,7 @@ describe("DataTable", () => {
290
290
  });
291
291
 
292
292
  it("renders with cell highlight", () => {
293
- const highlightData = [[{highlight: "primary", value: "Highlighted"}]];
293
+ const highlightData: DataTableCellData[][] = [[{highlight: "primary", value: "Highlighted"}]];
294
294
  const {toJSON} = renderWithTheme(
295
295
  <DataTable columns={[{columnType: "text", title: "Name", width: 150}]} data={highlightData} />
296
296
  );
@@ -303,7 +303,7 @@ describe("DataTable", () => {
303
303
  {columnType: "number", title: "Count", width: 100},
304
304
  {columnType: "date", title: "Due", width: 150},
305
305
  ];
306
- const highlightData = [
306
+ const highlightData: DataTableCellData[][] = [
307
307
  [
308
308
  {highlight: "error", value: "Overdue"},
309
309
  {highlight: "error", value: 42},
@@ -495,7 +495,7 @@ describe("DataTable", () => {
495
495
  });
496
496
 
497
497
  it("renders with cell highlight color", () => {
498
- const highlightData = [[{highlight: "primary", value: "Highlighted"}]];
498
+ const highlightData: DataTableCellData[][] = [[{highlight: "primary", value: "Highlighted"}]];
499
499
  const highlightColumns = [{columnType: "text", title: "Col", width: 150}];
500
500
  const {toJSON} = renderWithTheme(<DataTable columns={highlightColumns} data={highlightData} />);
501
501
  expect(toJSON()).toBeTruthy();
@@ -1,3 +1,4 @@
1
+ import {describe, it} from "bun:test";
1
2
  import {act, fireEvent, render} from "@testing-library/react-native";
2
3
  import {assert} from "chai";
3
4
  import type React from "react";
@@ -1,4 +1,5 @@
1
1
  import {describe, expect, it} from "bun:test";
2
+ import {createRef} from "react";
2
3
 
3
4
  import {DateTimeActionSheet} from "./DateTimeActionSheet";
4
5
  import {renderWithTheme} from "./test-utils";
@@ -8,6 +9,7 @@ import {renderWithTheme} from "./test-utils";
8
9
 
9
10
  describe("DateTimeActionSheet", () => {
10
11
  const defaultProps = {
12
+ actionSheetRef: createRef<unknown>(),
11
13
  onChange: () => {},
12
14
  onDismiss: () => {},
13
15
  visible: true,
@@ -1,13 +1,4 @@
1
- import {
2
- afterAll,
3
- afterEach,
4
- beforeEach,
5
- describe,
6
- expect,
7
- it,
8
- type mock as MockType,
9
- mock,
10
- } from "bun:test";
1
+ import {afterAll, afterEach, beforeEach, describe, expect, it, mock} from "bun:test";
11
2
  import {act, fireEvent, userEvent} from "@testing-library/react-native";
12
3
  import {assert} from "chai";
13
4
  import {DateTime} from "luxon";
@@ -59,7 +50,7 @@ afterAll(() => {
59
50
  });
60
51
 
61
52
  describe("DateTimeField", () => {
62
- let mockOnChange: ReturnType<MockType>;
53
+ let mockOnChange: ReturnType<typeof setupComponentTest>["onChange"];
63
54
 
64
55
  beforeEach(() => {
65
56
  setDesktop();
@@ -1497,7 +1488,7 @@ describe("DateTimeField", () => {
1497
1488
  describe("TimezonePicker onChange", () => {
1498
1489
  it("forwards the picked timezone to onTimezoneChange and emits a new value", async () => {
1499
1490
  setDesktop();
1500
- const mockTzChange = mock(() => {});
1491
+ const mockTzChange = mock((_timezone: string) => {});
1501
1492
  const {UNSAFE_root} = renderWithTheme(
1502
1493
  <DateTimeField
1503
1494
  onChange={mockOnChange}
@@ -74,7 +74,7 @@ const DateTimeSegment: FC<DateTimeSegmentProps> = ({
74
74
  style={{
75
75
  alignItems: "center",
76
76
  backgroundColor: "transparent",
77
- borderColor: error ? theme.border.error : "transparent",
77
+ borderColor: error ? theme.field.borderError : "transparent",
78
78
  flexDirection: "row",
79
79
  flexShrink: 1,
80
80
  height: 40,
@@ -237,7 +237,7 @@ const MobileTimeDisplay: FC<MobileTimeDisplayProps> = ({
237
237
  paddingVertical: showBorder ? 8 : 4,
238
238
  ...(showBorder
239
239
  ? {
240
- backgroundColor: disabled ? theme.surface.disabled : theme.surface.base,
240
+ backgroundColor: disabled ? theme.surface.disabled : theme.field.background,
241
241
  borderColor,
242
242
  borderRadius: 4,
243
243
  borderWidth: 1,
@@ -461,20 +461,22 @@ export const DateTimeField: FC<DateTimeFieldProps> = ({
461
461
  providedTimezone ?? DateTime.local().zoneName ?? "UTC"
462
462
  );
463
463
 
464
- const breakpoint = 395; // Breakpoint for switching to action sheet
464
+ // Parent width, in pt, below which inline controls do not fit. This is the field's own
465
+ // minimum, not a viewport breakpoint.
466
+ const inlineControlsMinWidth = 395;
465
467
  let minimumWidth = 230; // Minimum width for the field container
466
468
  if (type === "date") {
467
469
  minimumWidth = 200;
468
470
  }
469
471
 
470
- let maximumWidth = breakpoint; // Maximum width for the field container
472
+ let maximumWidth = inlineControlsMinWidth; // Maximum width for the field container
471
473
  if (["date", "time"].includes(type)) {
472
474
  maximumWidth = minimumWidth + 10;
473
475
  }
474
476
 
475
477
  const [parentWidth, setParentWidth] = useState<number | null>(null);
476
478
  const parentIsLessThanBreakpointOrIsMobile =
477
- (parentWidth !== null && parentWidth < breakpoint) || isNarrowViewport();
479
+ (parentWidth !== null && parentWidth < inlineControlsMinWidth) || isNarrowViewport();
478
480
 
479
481
  // We need to store the pending value in a ref because the state changes don't trigger
480
482
  // immediately, so onBlur may use stale values.
@@ -495,11 +497,11 @@ export const DateTimeField: FC<DateTimeFieldProps> = ({
495
497
  const timezone = providedTimezone ?? localTimezone;
496
498
  const inputRefs = useRef<(TextInput | null)[]>([]);
497
499
 
498
- let borderColor = theme.border.dark;
500
+ let borderColor = theme.field.border;
499
501
  if (disabled) {
500
- borderColor = theme.border.activeNeutral;
502
+ borderColor = theme.field.borderDisabled;
501
503
  } else if (errorText || Object.values(fieldErrors).some((error) => error !== undefined)) {
502
- borderColor = theme.border.error;
504
+ borderColor = theme.field.borderError;
503
505
  }
504
506
 
505
507
  /** Builds the ordered array of {@link FieldConfig} for each input segment based on the field type. */
@@ -1080,7 +1082,7 @@ export const DateTimeField: FC<DateTimeFieldProps> = ({
1080
1082
  onPress={openActionSheet}
1081
1083
  style={{
1082
1084
  alignItems: parentIsLessThanBreakpointOrIsMobile ? "stretch" : "center",
1083
- backgroundColor: theme.surface.base,
1085
+ backgroundColor: theme.field.background,
1084
1086
  borderColor,
1085
1087
  borderRadius: 4,
1086
1088
  borderWidth: 1,
@@ -7,7 +7,11 @@ import {renderWithTheme} from "./test-utils";
7
7
  describe("DismissButton", () => {
8
8
  it("renders correctly with default props", () => {
9
9
  const {toJSON} = renderWithTheme(
10
- <DismissButton accessibilityLabel="Dismiss" onClick={() => {}} />
10
+ <DismissButton
11
+ accessibilityHint="Dismisses the message"
12
+ accessibilityLabel="Dismiss"
13
+ onClick={() => {}}
14
+ />
11
15
  );
12
16
  expect(toJSON()).toMatchSnapshot();
13
17
  });
@@ -15,7 +19,11 @@ describe("DismissButton", () => {
15
19
  it("calls onClick when pressed", () => {
16
20
  const handleClick = mock(() => {});
17
21
  const {getByLabelText} = renderWithTheme(
18
- <DismissButton accessibilityLabel="Dismiss" onClick={handleClick} />
22
+ <DismissButton
23
+ accessibilityHint="Dismisses the message"
24
+ accessibilityLabel="Dismiss"
25
+ onClick={handleClick}
26
+ />
19
27
  );
20
28
 
21
29
  fireEvent.press(getByLabelText("Dismiss"));
@@ -24,14 +32,24 @@ describe("DismissButton", () => {
24
32
 
25
33
  it("renders with primary color (default)", () => {
26
34
  const {toJSON} = renderWithTheme(
27
- <DismissButton accessibilityLabel="Dismiss" color="primary" onClick={() => {}} />
35
+ <DismissButton
36
+ accessibilityHint="Dismisses the message"
37
+ accessibilityLabel="Dismiss"
38
+ color="primary"
39
+ onClick={() => {}}
40
+ />
28
41
  );
29
42
  expect(toJSON()).toMatchSnapshot();
30
43
  });
31
44
 
32
45
  it("renders with inverted color", () => {
33
46
  const {toJSON} = renderWithTheme(
34
- <DismissButton accessibilityLabel="Dismiss" color="inverted" onClick={() => {}} />
47
+ <DismissButton
48
+ accessibilityHint="Dismisses the message"
49
+ accessibilityLabel="Dismiss"
50
+ color="inverted"
51
+ onClick={() => {}}
52
+ />
35
53
  );
36
54
  expect(toJSON()).toMatchSnapshot();
37
55
  });
@@ -177,6 +177,21 @@ describe("DonutChart", () => {
177
177
  expect(queryByTestId("chart.tooltip")).toBeNull();
178
178
  });
179
179
 
180
+ it("records a positive plot width from layout", () => {
181
+ const {getByTestId} = renderWithTheme(<DonutChart data={POINTS} testID="chart" />);
182
+
183
+ act(() => {
184
+ fireEvent(getByTestId("chart.plot"), "layout", {
185
+ nativeEvent: {layout: {height: 0, width: 0}},
186
+ });
187
+ fireEvent(getByTestId("chart.plot"), "layout", {
188
+ nativeEvent: {layout: {height: 180, width: 320}},
189
+ });
190
+ });
191
+
192
+ expect(getByTestId("chart.plot")).toBeTruthy();
193
+ });
194
+
180
195
  it("does not open URLs from slice legend labels", () => {
181
196
  const {getByText} = renderWithTheme(
182
197
  <DonutChart data={[{label: "https://evil.example", value: 10}]} />
@@ -6,29 +6,27 @@ import {renderWithTheme} from "./test-utils";
6
6
 
7
7
  describe("EmailField", () => {
8
8
  it("renders correctly with default props", () => {
9
- const {toJSON} = renderWithTheme(<EmailField label="Email" onChange={() => {}} value="" />);
9
+ const {toJSON} = renderWithTheme(<EmailField onChange={() => {}} value="" />);
10
10
  expect(toJSON()).toMatchSnapshot();
11
11
  });
12
12
 
13
13
  it("renders with placeholder", () => {
14
14
  const {getByPlaceholderText} = renderWithTheme(
15
- <EmailField label="Email" onChange={() => {}} placeholder="Enter your email" value="" />
15
+ <EmailField onChange={() => {}} placeholder="Enter your email" value="" />
16
16
  );
17
17
  expect(getByPlaceholderText("Enter your email")).toBeTruthy();
18
18
  });
19
19
 
20
20
  it("renders with initial value", () => {
21
21
  const {getByDisplayValue} = renderWithTheme(
22
- <EmailField label="Email" onChange={() => {}} value="test@example.com" />
22
+ <EmailField onChange={() => {}} value="test@example.com" />
23
23
  );
24
24
  expect(getByDisplayValue("test@example.com")).toBeTruthy();
25
25
  });
26
26
 
27
27
  it("calls onChange with valid email", async () => {
28
28
  const handleChange = mock((_value: string) => {});
29
- const {getByDisplayValue} = renderWithTheme(
30
- <EmailField label="Email" onChange={handleChange} value="" />
31
- );
29
+ const {getByDisplayValue} = renderWithTheme(<EmailField onChange={handleChange} value="" />);
32
30
 
33
31
  const input = getByDisplayValue("");
34
32
  await act(async () => {
@@ -42,9 +40,7 @@ describe("EmailField", () => {
42
40
 
43
41
  it("does not call onChange with invalid email", async () => {
44
42
  const handleChange = mock((_value: string) => {});
45
- const {getByDisplayValue} = renderWithTheme(
46
- <EmailField label="Email" onChange={handleChange} value="" />
47
- );
43
+ const {getByDisplayValue} = renderWithTheme(<EmailField onChange={handleChange} value="" />);
48
44
 
49
45
  const input = getByDisplayValue("");
50
46
  await act(async () => {
@@ -57,16 +53,13 @@ describe("EmailField", () => {
57
53
 
58
54
  it("validates email format and shows error for invalid input", () => {
59
55
  // EmailField should show error for invalid email after typing
60
- const {unmount} = renderWithTheme(
61
- <EmailField label="Email" onChange={() => {}} value="invalid-email" />
62
- );
56
+ const {unmount} = renderWithTheme(<EmailField onChange={() => {}} value="invalid-email" />);
63
57
 
64
58
  // Render with errorText to test that custom error displays
65
59
  unmount();
66
60
  const {queryByText: queryByText2} = renderWithTheme(
67
61
  <EmailField
68
62
  errorText="Please enter a valid email"
69
- label="Email"
70
63
  onChange={() => {}}
71
64
  value="invalid-email"
72
65
  />
@@ -76,9 +69,7 @@ describe("EmailField", () => {
76
69
 
77
70
  it("accepts valid email addresses", async () => {
78
71
  const handleChange = mock((_value: string) => {});
79
- const {getByDisplayValue} = renderWithTheme(
80
- <EmailField label="Email" onChange={handleChange} value="" />
81
- );
72
+ const {getByDisplayValue} = renderWithTheme(<EmailField onChange={handleChange} value="" />);
82
73
 
83
74
  const input = getByDisplayValue("");
84
75
  await act(async () => {
@@ -92,14 +83,14 @@ describe("EmailField", () => {
92
83
 
93
84
  it("renders with custom errorText", () => {
94
85
  const {getByText} = renderWithTheme(
95
- <EmailField errorText="Custom error message" label="Email" onChange={() => {}} value="" />
86
+ <EmailField errorText="Custom error message" onChange={() => {}} value="" />
96
87
  );
97
88
  expect(getByText("Custom error message")).toBeTruthy();
98
89
  });
99
90
 
100
91
  it("renders with icon", () => {
101
92
  const {toJSON} = renderWithTheme(
102
- <EmailField iconName="envelope" label="Email" onChange={() => {}} value="" />
93
+ <EmailField iconName="envelope" onChange={() => {}} value="" />
103
94
  );
104
95
  expect(toJSON()).toMatchSnapshot();
105
96
  });
@@ -107,7 +98,7 @@ describe("EmailField", () => {
107
98
  it("calls onBlur with valid email", async () => {
108
99
  const handleBlur = mock((_value: string) => {});
109
100
  const {getByDisplayValue} = renderWithTheme(
110
- <EmailField label="Email" onBlur={handleBlur} onChange={() => {}} value="valid@email.com" />
101
+ <EmailField onBlur={handleBlur} onChange={() => {}} value="valid@email.com" />
111
102
  );
112
103
 
113
104
  const input = getByDisplayValue("valid@email.com");
@@ -123,7 +114,7 @@ describe("EmailField", () => {
123
114
  it("does not call onBlur with invalid email", async () => {
124
115
  const handleBlur = mock((_value: string) => {});
125
116
  const {getByDisplayValue} = renderWithTheme(
126
- <EmailField label="Email" onBlur={handleBlur} onChange={() => {}} value="" />
117
+ <EmailField onBlur={handleBlur} onChange={() => {}} value="" />
127
118
  );
128
119
 
129
120
  const input = getByDisplayValue("");
@@ -140,7 +131,7 @@ describe("EmailField", () => {
140
131
  it("clears local error when typing a valid email after invalid", async () => {
141
132
  const handleChange = mock((_value: string) => {});
142
133
  const {getByDisplayValue, queryByText} = renderWithTheme(
143
- <EmailField label="Email" onChange={handleChange} value="" />
134
+ <EmailField onChange={handleChange} value="" />
144
135
  );
145
136
 
146
137
  const input = getByDisplayValue("");
@@ -172,7 +163,7 @@ describe("EmailField", () => {
172
163
  it("validates empty string as valid on blur", async () => {
173
164
  const handleBlur = mock((_value: string) => {});
174
165
  const {getByDisplayValue} = renderWithTheme(
175
- <EmailField label="Email" onBlur={handleBlur} onChange={() => {}} value="" />
166
+ <EmailField onBlur={handleBlur} onChange={() => {}} value="" />
176
167
  );
177
168
 
178
169
  const input = getByDisplayValue("");
@@ -351,7 +351,7 @@ describe("EmojiSelector", () => {
351
351
  },
352
352
  ];
353
353
  const getItemMock = mock(async () => JSON.stringify(existing));
354
- const setItemMock = mock(async () => undefined);
354
+ const setItemMock = mock(async (_key: string, _value: string) => undefined);
355
355
  const originalGetItem = AsyncStorage.getItem;
356
356
  const originalSetItem = AsyncStorage.setItem;
357
357
  AsyncStorage.getItem = getItemMock as unknown as typeof AsyncStorage.getItem;
@@ -396,7 +396,7 @@ describe("EmojiSelector", () => {
396
396
  const onEmojiSelected = mock(() => {});
397
397
  const originalGetItem = AsyncStorage.getItem;
398
398
  const originalSetItem = AsyncStorage.setItem;
399
- const setItemMock = mock(async () => undefined);
399
+ const setItemMock = mock(async (_key: string, _value: string) => undefined);
400
400
  AsyncStorage.setItem = setItemMock as unknown as typeof AsyncStorage.setItem;
401
401
  try {
402
402
  const {root, UNSAFE_getAllByType} = renderWithTheme(
@@ -1,10 +1,11 @@
1
1
  import {afterAll, beforeAll, describe, expect, it, mock, spyOn} from "bun:test";
2
2
  import React from "react";
3
3
 
4
+ import type {ErrorPageProps} from "./Common";
4
5
  import {ErrorBoundary} from "./ErrorBoundary";
5
6
  import {ErrorPage} from "./ErrorPage";
6
7
  import {Text} from "./Text";
7
- import {renderWithTheme} from "./test-utils";
8
+ import {elementProps, renderWithTheme} from "./test-utils";
8
9
 
9
10
  describe("ErrorBoundary", () => {
10
11
  // Suppress console.warn during tests
@@ -89,7 +90,8 @@ describe("ErrorBoundary", () => {
89
90
  const renderedElement = boundary.render() as React.ReactElement;
90
91
 
91
92
  expect(renderedElement.type).toBe(ErrorPage);
92
- expect(renderedElement.props.error).toBe(error);
93
- expect(typeof renderedElement.props.resetError).toBe("function");
93
+ const pageProps = elementProps<ErrorPageProps>(renderedElement);
94
+ expect(pageProps.error).toBe(error);
95
+ expect(typeof pageProps.resetError).toBe("function");
94
96
  });
95
97
  });