@@ -41,7 +41,8 @@ import {
41
41
weiToValue ,
42
42
stringArrayToBytes32Array ,
43
43
bytes32ArrayToStringArray ,
44
- bigNumberToDate , parsePartitionBytes32Value ,
44
+ bigNumberToDate ,
45
+ parsePartitionBytes32Value ,
45
46
} from '../../../utils/convert' ;
46
47
import { MockedCallMethod , MockedSendMethod , getMockedPolyResponse } from '../../../test_utils/mocked_methods' ;
47
48
@@ -4838,6 +4839,20 @@ describe('SecurityTokenWrapper', () => {
4838
4839
test . todo ( 'should fail if name is 0 length' ) ;
4839
4840
test . todo ( 'should fail if uri is 0 length' ) ;
4840
4841
test ( 'should send the transaction to removeDocument' , async ( ) => {
4842
+ const documentUri = 'Uri' ;
4843
+ const documentHash = stringToBytes32 ( 'Hash' ) ;
4844
+ const documentTime = new Date ( 2030 , 1 ) ;
4845
+ const expectedGetDocumentResult = [ documentUri , documentHash , dateToBigNumber ( documentTime ) ] ;
4846
+ // Mocked method
4847
+ const mockedGetDocumentParams = { name : 'Name' } ;
4848
+ const mockedGetDocumentMethod = mock ( MockedCallMethod ) ;
4849
+ // Stub the method
4850
+ when ( mockedContract . getDocument ) . thenReturn ( instance ( mockedGetDocumentMethod ) ) ;
4851
+ // Stub the request
4852
+ when (
4853
+ mockedGetDocumentMethod . callAsync ( objectContaining ( stringToBytes32 ( mockedGetDocumentParams . name ) ) ) ,
4854
+ ) . thenResolve ( expectedGetDocumentResult ) ;
4855
+
4841
4856
// Mocked parameters
4842
4857
const mockedParams = {
4843
4858
name : 'Name' ,
@@ -4887,6 +4902,8 @@ describe('SecurityTokenWrapper', () => {
4887
4902
verify ( mockedContract . owner ) . once ( ) ;
4888
4903
verify ( mockedOwnerMethod . callAsync ( ) ) . once ( ) ;
4889
4904
verify ( mockedWrapper . getAvailableAddressesAsync ( ) ) . once ( ) ;
4905
+ verify ( mockedContract . getDocument ) . once ( ) ;
4906
+ verify ( mockedGetDocumentMethod . callAsync ( objectContaining ( stringToBytes32 ( mockedGetDocumentParams . name ) ) ) ) . once ( ) ;
4890
4907
} ) ;
4891
4908
} ) ;
4892
4909
0 commit comments