@@ -156,6 +156,9 @@ describe('useAddAccountScreen', () => {
156156 'add_account_create_universal_wallet_button' ,
157157 )
158158 expect ( result . current . mainOptions [ 1 ] ?. testID ) . toBe (
159+ 'add_account_create_joint_button' ,
160+ )
161+ expect ( result . current . mainOptions [ 2 ] ?. testID ) . toBe (
159162 'add_account_import_button' ,
160163 )
161164 } )
@@ -247,64 +250,43 @@ describe('useAddAccountScreen', () => {
247250 expect ( mockGoBack ) . toHaveBeenCalledTimes ( 1 )
248251 } )
249252
250- it ( 'handleImportAccount opens import options ' , ( ) => {
253+ it ( 'import account option navigates to ImportAccountOptions ' , ( ) => {
251254 const { result } = renderHook ( ( ) => useAddAccountScreen ( ) )
252255
253- expect ( result . current . isImportOptionsVisible ) . toBe ( false )
254-
255- act ( ( ) => {
256- result . current . handleImportAccount ( )
257- } )
258-
259- expect ( result . current . isImportOptionsVisible ) . toBe ( true )
260- } )
261-
262- it ( 'handleCloseImportOptions closes import options' , ( ) => {
263- const { result } = renderHook ( ( ) => useAddAccountScreen ( ) )
256+ const importOption = result . current . mainOptions . find (
257+ o => o . testID === 'add_account_import_button' ,
258+ ) !
264259
265260 act ( ( ) => {
266- result . current . handleImportAccount ( )
261+ importOption . onPress ( )
267262 } )
268- expect ( result . current . isImportOptionsVisible ) . toBe ( true )
269263
270- act ( ( ) => {
271- result . current . handleCloseImportOptions ( )
272- } )
273- expect ( result . current . isImportOptionsVisible ) . toBe ( false )
264+ expect ( mockPush ) . toHaveBeenCalledWith ( 'ImportAccountOptions' )
274265 } )
275266
276- it ( 'handleHDWalletPress closes import options and navigates to ImportInfo with hdWallet ' , ( ) => {
267+ it ( 'mainOptions does not include pair ledger or scan qr options ' , ( ) => {
277268 const { result } = renderHook ( ( ) => useAddAccountScreen ( ) )
278269
279- act ( ( ) => {
280- result . current . handleImportAccount ( )
281- } )
282-
283- act ( ( ) => {
284- result . current . handleHDWalletPress ( )
285- } )
286-
287- expect ( result . current . isImportOptionsVisible ) . toBe ( false )
288- expect ( mockPush ) . toHaveBeenCalledWith ( 'ImportInfo' , {
289- accountType : 'hdWallet' ,
290- } )
270+ expect (
271+ result . current . mainOptions . find (
272+ o => o . testID === 'add_account_pair_ledger_button' ,
273+ ) ,
274+ ) . toBeUndefined ( )
275+ expect (
276+ result . current . mainOptions . find (
277+ o => o . testID === 'add_account_scan_qr_button' ,
278+ ) ,
279+ ) . toBeUndefined ( )
291280 } )
292281
293- it ( 'handleAlgo25Press closes import options and navigates to ImportInfo with algo25 ' , ( ) => {
282+ it ( 'mainOptions includes joint account option ' , ( ) => {
294283 const { result } = renderHook ( ( ) => useAddAccountScreen ( ) )
295284
296- act ( ( ) => {
297- result . current . handleImportAccount ( )
298- } )
299-
300- act ( ( ) => {
301- result . current . handleAlgo25Press ( )
302- } )
303-
304- expect ( result . current . isImportOptionsVisible ) . toBe ( false )
305- expect ( mockPush ) . toHaveBeenCalledWith ( 'ImportInfo' , {
306- accountType : 'algo25' ,
307- } )
285+ expect (
286+ result . current . mainOptions . find (
287+ o => o . testID === 'add_account_create_joint_button' ,
288+ ) ,
289+ ) . toBeDefined ( )
308290 } )
309291
310292 it ( 'watch address option navigates to WatchInfo' , ( ) => {
0 commit comments