@@ -695,6 +695,13 @@ describe('SecurityTokenRegistryWrapper', () => {
695
695
txData : { } ,
696
696
safetyFactor : 10 ,
697
697
} ;
698
+ const securityToken = '0x9999999999999999999999999999999999999999' ;
699
+ // Mocked method
700
+ const mockedGetSecurityTokenAddressMethod = mock ( MockedCallMethod ) ;
701
+ // Stub the method
702
+ when ( mockedContract . getSecurityTokenAddress ) . thenReturn ( instance ( mockedGetSecurityTokenAddressMethod ) ) ;
703
+ // Stub the request
704
+ when ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . thenResolve ( securityToken ) ;
698
705
699
706
// checkOnlyOwner
700
707
const expectedOwnerResult = '0x0123456789012345678901234567890123456789' ;
@@ -739,21 +746,32 @@ describe('SecurityTokenRegistryWrapper', () => {
739
746
verify ( mockedContract . owner ) . once ( ) ;
740
747
verify ( mockedOwnerMethod . callAsync ( ) ) . once ( ) ;
741
748
verify ( mockedWrapper . getAvailableAddressesAsync ( ) ) . once ( ) ;
749
+ verify ( mockedContract . getSecurityTokenAddress ) . once ( ) ;
750
+ verify ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . once ( ) ;
751
+
742
752
} ) ;
743
753
} ) ;
744
754
745
755
describe ( 'ModifyExistingSecurityToken' , ( ) => {
746
756
test ( 'should call modifyExistingSecurityToken with ModifyExistingSecurityTokenParams' , async ( ) => {
757
+ const securityToken = '0x5555555555555555555555555555555555555555' ;
747
758
const mockedParams = {
748
759
ticker : "TTEST" ,
749
760
owner : "0x0023456789002345678900234567890023456789" ,
750
- securityToken : "0x1123456789112345678911234567891123456789" ,
761
+ securityToken,
751
762
tokenDetails : "" ,
752
763
deployedAt : new Date ( 2018 , 10 , 10 ) ,
753
764
txData : { } ,
754
765
safetyFactor : 10 ,
755
766
} ;
756
767
768
+ // Mocked method
769
+ const mockedGetSecurityTokenAddressMethod = mock ( MockedCallMethod ) ;
770
+ // Stub the method
771
+ when ( mockedContract . getSecurityTokenAddress ) . thenReturn ( instance ( mockedGetSecurityTokenAddressMethod ) ) ;
772
+ // Stub the request
773
+ when ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . thenResolve ( securityToken ) ;
774
+
757
775
// checkOnlyOwner
758
776
const expectedOwnerResult = '0x0123456789012345678901234567890123456789' ;
759
777
const mockedOwnerMethod = mock ( MockedCallMethod ) ;
@@ -797,6 +815,8 @@ describe('SecurityTokenRegistryWrapper', () => {
797
815
verify ( mockedContract . owner ) . once ( ) ;
798
816
verify ( mockedOwnerMethod . callAsync ( ) ) . once ( ) ;
799
817
verify ( mockedWrapper . getAvailableAddressesAsync ( ) ) . once ( ) ;
818
+ verify ( mockedContract . getSecurityTokenAddress ) . once ( ) ;
819
+ verify ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . once ( ) ;
800
820
} ) ;
801
821
} ) ;
802
822
@@ -2000,6 +2020,13 @@ describe('SecurityTokenRegistryWrapper', () => {
2000
2020
safetyFactor : 10 ,
2001
2021
} ;
2002
2022
2023
+ // Mocked method
2024
+ const mockedGetSecurityTokenAddressMethod = mock ( MockedCallMethod ) ;
2025
+ // Stub the method
2026
+ when ( mockedContract . getSecurityTokenAddress ) . thenReturn ( instance ( mockedGetSecurityTokenAddressMethod ) ) ;
2027
+ // Stub the request
2028
+ when ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . thenResolve ( securityToken ) ;
2029
+
2003
2030
const expectedResult = getMockedPolyResponse ( ) ;
2004
2031
// Mocked method
2005
2032
const mockedMethod = mock ( MockedSendMethod ) ;
@@ -2042,6 +2069,8 @@ describe('SecurityTokenRegistryWrapper', () => {
2042
2069
verify ( mockedContract . owner ) . once ( ) ;
2043
2070
verify ( mockedOwnerMethod . callAsync ( ) ) . once ( ) ;
2044
2071
verify ( mockedWrapper . getAvailableAddressesAsync ( ) ) . once ( ) ;
2072
+ verify ( mockedContract . getSecurityTokenAddress ) . once ( ) ;
2073
+ verify ( mockedGetSecurityTokenAddressMethod . callAsync ( mockedParams . ticker ) ) . once ( ) ;
2045
2074
} ) ;
2046
2075
} ) ;
2047
2076
0 commit comments