@@ -26,12 +26,6 @@ const disabledFeatureFlags = {
2626 approve : false ,
2727} ;
2828
29- jest . mock ( '../../../../util/address' , ( ) => ( {
30- ...jest . requireActual ( '../../../../util/address' ) ,
31- isHardwareAccount : jest . fn ( ) ,
32- isExternalHardwareAccount : jest . fn ( ) ,
33- } ) ) ;
34-
3529jest . mock ( '../../../../core/Engine' , ( ) => ( {
3630 getTotalEvmFiatAccountBalance : ( ) => ( { tokenFiat : 10 } ) ,
3731 context : {
@@ -53,11 +47,9 @@ describe('useConfirmationRedesignEnabled', () => {
5347 const confirmationRedesignFlagsMock = jest . mocked (
5448 selectConfirmationRedesignFlags ,
5549 ) ;
56- const isHardwareAccountMock = jest . mocked ( isHardwareAccount ) ;
5750
5851 beforeEach ( ( ) => {
5952 jest . clearAllMocks ( ) ;
60- isHardwareAccountMock . mockReturnValue ( false ) ;
6153 confirmationRedesignFlagsMock . mockReturnValue ( disabledFeatureFlags ) ;
6254 } ) ;
6355
@@ -183,24 +175,6 @@ describe('useConfirmationRedesignEnabled', () => {
183175 expect ( result . current . isRedesignedEnabled ) . toBe ( false ) ;
184176 } ) ;
185177
186- it ( 'returns true when from address is external hardware account' , async ( ) => {
187- confirmationRedesignFlagsMock . mockReturnValue ( {
188- ...disabledFeatureFlags ,
189- signatures : true ,
190- staking_confirmations : true ,
191- } ) ;
192-
193- isHardwareAccountMock . mockReturnValue ( true ) ;
194- const { result } = renderHookWithProvider (
195- useConfirmationRedesignEnabled ,
196- {
197- state : stakingDepositConfirmationState ,
198- } ,
199- ) ;
200-
201- expect ( result . current . isRedesignedEnabled ) . toBe ( true ) ;
202- } ) ;
203-
204178 it ( 'only redesign if transactions is staking deposit' , async ( ) => {
205179 confirmationRedesignFlagsMock . mockReturnValue ( {
206180 ...disabledFeatureFlags ,
@@ -344,27 +318,6 @@ describe('useConfirmationRedesignEnabled', () => {
344318 ) ;
345319 } ) ;
346320
347- it ( 'if confirmation is a transaction, validates `txParams.from` is hardware account' , ( ) => {
348- isHardwareAccountMock . mockReturnValue ( true ) ;
349- confirmationRedesignFlagsMock . mockReturnValue ( {
350- ...disabledFeatureFlags ,
351- transfer : true ,
352- } ) ;
353-
354- const { result } = renderHookWithProvider ( useConfirmationRedesignEnabled , {
355- state : transferConfirmationState ,
356- } ) ;
357-
358- const expectedFromAddress =
359- transferConfirmationState . engine . backgroundState . TransactionController
360- . transactions [ 0 ] . txParams . from ;
361-
362- expect ( isHardwareAccountMock ) . toHaveBeenCalledTimes ( 1 ) ;
363- expect ( isHardwareAccountMock ) . toHaveBeenCalledWith ( expectedFromAddress ) ;
364-
365- expect ( result . current . isRedesignedEnabled ) . toBe ( false ) ;
366- } ) ;
367-
368321 it ( 'returns false if transaction type is not in the list of redesigned transaction types' , ( ) => {
369322 const state = cloneDeep ( approveERC20TransactionStateMock ) ;
370323 state . engine . backgroundState . TransactionController . transactions [ 0 ] . type =
0 commit comments