@@ -91,7 +91,8 @@ describe('MMIController', function () {
91
91
accountsController ,
92
92
keyringController ,
93
93
metaMetricsController ,
94
- custodyController ;
94
+ custodyController ,
95
+ mmiControllerMessenger ;
95
96
96
97
beforeEach ( async function ( ) {
97
98
const mockMessenger = {
@@ -239,7 +240,7 @@ describe('MMIController', function () {
239
240
jest . fn ( ) . mockReturnValue ( createMockNetworkConfiguration ( ) ) ,
240
241
) ;
241
242
242
- const mmiControllerMessenger = controllerMessenger . getRestricted ( {
243
+ mmiControllerMessenger = controllerMessenger . getRestricted ( {
243
244
name : 'MMIController' ,
244
245
allowedActions : [
245
246
'AccountsController:getAccountByAddress' ,
@@ -255,7 +256,7 @@ describe('MMIController', function () {
255
256
} ) ;
256
257
257
258
mmiController = new MMIController ( {
258
- messagingSystem : mmiControllerMessenger ,
259
+ messenger : mmiControllerMessenger ,
259
260
mmiConfigurationController,
260
261
keyringController,
261
262
transactionUpdateController : new TransactionUpdateController ( {
@@ -539,7 +540,7 @@ describe('MMIController', function () {
539
540
CUSTODIAN_TYPES [ 'CUSTODIAN-TYPE' ] = {
540
541
keyringClass : { type : 'mock-keyring-class' } ,
541
542
} ;
542
- jest . spyOn ( ControllerMessenger . prototype , 'call' ) . mockReturnValue ( { address : '0x1' } ) ;
543
+ jest . spyOn ( mmiControllerMessenger , 'call' ) . mockReturnValue ( { address : '0x1' } ) ;
543
544
mmiController . custodyController . getCustodyTypeByAddress = jest
544
545
. fn ( )
545
546
. mockReturnValue ( 'custodian-type' ) ;
@@ -763,7 +764,7 @@ describe('MMIController', function () {
763
764
764
765
describe ( 'handleMmiDashboardData' , ( ) => {
765
766
it ( 'should return internalAccounts as identities' , async ( ) => {
766
- const controllerMessengerSpy = jest . spyOn ( ControllerMessenger . prototype , 'call' ) ;
767
+ const controllerMessengerSpy = jest . spyOn ( mmiControllerMessenger , 'call' ) ;
767
768
await mmiController . handleMmiDashboardData ( ) ;
768
769
769
770
expect ( controllerMessengerSpy ) . toHaveBeenCalledWith (
@@ -841,7 +842,7 @@ describe('MMIController', function () {
841
842
842
843
describe ( 'setAccountAndNetwork' , ( ) => {
843
844
it ( 'should set a new selected account if the selectedAddress and the address from the arguments is different' , async ( ) => {
844
- const selectedAccountSpy = jest . spyOn ( ControllerMessenger . prototype , 'call' ) ;
845
+ const selectedAccountSpy = jest . spyOn ( mmiControllerMessenger , 'call' ) ;
845
846
await mmiController . setAccountAndNetwork (
846
847
'mock-origin' ,
847
848
mockAccount2 . address ,
@@ -859,7 +860,7 @@ describe('MMIController', function () {
859
860
} ) ;
860
861
861
862
it ( 'should not set a new selected account the accounts are the same' , async ( ) => {
862
- const selectedAccountSpy = jest . spyOn ( ControllerMessenger . prototype , 'call' ) ;
863
+ const selectedAccountSpy = jest . spyOn ( mmiControllerMessenger , 'call' ) ;
863
864
await mmiController . setAccountAndNetwork (
864
865
'mock-origin' ,
865
866
mockAccount . address ,
0 commit comments