@@ -233,6 +233,9 @@ const createStateAfterPending = () => {
233
233
minedTx : 'not_mined' ,
234
234
minedHash : '' ,
235
235
} ,
236
+ accountHardwareType : 'Ledger Hardware' ,
237
+ accountType : 'hardware' ,
238
+ deviceModel : 'ledger' ,
236
239
} ,
237
240
] ;
238
241
} ;
@@ -262,6 +265,9 @@ const createStateAfterSuccess = () => {
262
265
'0x55ad39634ee10d417b6e190cfd3736098957e958879cffe78f1f00f4fd2654d6' ,
263
266
minedTx : 'success' ,
264
267
} ,
268
+ accountHardwareType : 'Ledger Hardware' ,
269
+ accountType : 'hardware' ,
270
+ deviceModel : 'ledger' ,
265
271
} ,
266
272
] ;
267
273
} ;
@@ -616,7 +622,21 @@ describe('SmartTransactionsController', () => {
616
622
smartTransactionsController . trackStxStatusChange (
617
623
smartTransaction as SmartTransaction ,
618
624
) ;
619
- expect ( trackMetaMetricsEventSpy ) . toHaveBeenCalled ( ) ;
625
+ expect ( trackMetaMetricsEventSpy ) . toHaveBeenCalledWith (
626
+ expect . objectContaining ( {
627
+ event : 'STX Status Updated' ,
628
+ category : 'Transactions' ,
629
+ properties : expect . objectContaining ( {
630
+ stx_status : SmartTransactionStatuses . PENDING ,
631
+ is_smart_transaction : true ,
632
+ } ) ,
633
+ sensitiveProperties : expect . objectContaining ( {
634
+ account_hardware_type : 'Ledger Hardware' ,
635
+ account_type : 'hardware' ,
636
+ device_model : 'ledger' ,
637
+ } ) ,
638
+ } ) ,
639
+ ) ;
620
640
} ) ;
621
641
622
642
it ( 'does not track if smartTransaction and prevSmartTransaction have the same status' , ( ) => {
@@ -630,15 +650,32 @@ describe('SmartTransactionsController', () => {
630
650
631
651
it ( 'tracks status change if smartTransaction and prevSmartTransaction have different statuses' , ( ) => {
632
652
const smartTransaction = {
633
- ...createStateAfterPending ( ) [ 0 ] ,
653
+ ...createStateAfterSuccess ( ) [ 0 ] ,
634
654
swapMetaData : { } ,
635
655
} ;
636
- const prevSmartTransaction = { ...smartTransaction , status : '' } ;
656
+ const prevSmartTransaction = {
657
+ ...smartTransaction ,
658
+ status : SmartTransactionStatuses . PENDING ,
659
+ } ;
637
660
smartTransactionsController . trackStxStatusChange (
638
661
smartTransaction as SmartTransaction ,
639
662
prevSmartTransaction as SmartTransaction ,
640
663
) ;
641
- expect ( trackMetaMetricsEventSpy ) . toHaveBeenCalled ( ) ;
664
+ expect ( trackMetaMetricsEventSpy ) . toHaveBeenCalledWith (
665
+ expect . objectContaining ( {
666
+ event : 'STX Status Updated' ,
667
+ category : 'Transactions' ,
668
+ properties : expect . objectContaining ( {
669
+ stx_status : SmartTransactionStatuses . SUCCESS ,
670
+ is_smart_transaction : true ,
671
+ } ) ,
672
+ sensitiveProperties : expect . objectContaining ( {
673
+ account_hardware_type : 'Ledger Hardware' ,
674
+ account_type : 'hardware' ,
675
+ device_model : 'ledger' ,
676
+ } ) ,
677
+ } ) ,
678
+ ) ;
642
679
} ) ;
643
680
} ) ;
644
681
0 commit comments