@@ -15,7 +15,6 @@ import {
15
15
import { PolymathError } from '../../PolymathError' ;
16
16
import { Wallet } from '../../Wallet' ;
17
17
18
-
19
18
const params : DisableControllerProcedureArgs = {
20
19
symbol : 'TEST1' ,
21
20
} ;
@@ -103,23 +102,32 @@ describe('DisableController', () => {
103
102
} ) ;
104
103
105
104
test ( 'should add a transaction to the queue to disable controller of the security token, without passing in a signature' , async ( ) => {
106
- const addTransactionSpy = spy ( target , 'addTransaction' ) ;
105
+ const disableControllerArgsSpy = sinon . spy ( ) ;
106
+ const addTransactionStub = stub ( target , 'addTransaction' ) ;
107
+
107
108
const addSignatureRequestSpy = spy ( target , 'addSignatureRequest' ) ;
108
109
securityTokenMock . mock ( 'signDisableControllerAck' , randomSignature ) ;
109
110
securityTokenMock . mock ( 'disableController' , 'DisableController' ) ;
111
+ const { disableController } = securityTokenMock . getMockInstance ( ) ;
112
+ addTransactionStub . withArgs ( disableController ) . returns ( disableControllerArgsSpy ) ;
110
113
111
114
// Real call
112
115
await target . prepareTransactions ( ) ;
113
116
114
117
// Verifications
118
+ expect ( disableControllerArgsSpy . getCall ( 0 ) . args [ 0 ] ) . toEqual ( {
119
+ signature : randomSignature ,
120
+ } ) ;
121
+ expect ( disableControllerArgsSpy . callCount ) . toEqual ( 1 ) ;
122
+
115
123
expect (
116
- addTransactionSpy
124
+ addTransactionStub
117
125
. getCall ( 0 )
118
126
. calledWithExactly ( securityTokenMock . getMockInstance ( ) . disableController , {
119
127
tag : PolyTransactionTag . DisableController ,
120
128
} )
121
129
) . toEqual ( true ) ;
122
- expect ( addTransactionSpy . callCount ) . toEqual ( 1 ) ;
130
+ expect ( addTransactionStub . callCount ) . toEqual ( 1 ) ;
123
131
124
132
expect (
125
133
addSignatureRequestSpy
0 commit comments