@@ -834,6 +834,53 @@ describe('# auth service tests', () => {
834834 ] ) ;
835835 } ) ;
836836 } ) ;
837+ describe ( 'Legacy recover account' , ( ) => {
838+ it ( 'Should call with right params & return values' , async ( ) => {
839+ // Arrange
840+ const callStub = sinon . stub ( httpClient , 'put' ) . resolves ( { } ) ;
841+ const { client, headers } = clientAndHeaders ( ) ;
842+
843+ const payload = {
844+ token : 'recovery-token' ,
845+ encryptedPassword : 'encrypted-password' ,
846+ encryptedSalt : 'encrypted-salt' ,
847+ encryptedMnemonic : 'encrypted-mnemonic' ,
848+ eccEncryptedMnemonic : 'ecc-encrypted-mnemonic' ,
849+ kyberEncryptedMnemonic : 'kyber-encrypted-mnemonic' ,
850+ keys : {
851+ ecc : {
852+ public : 'ecc-public-key' ,
853+ private : 'ecc-private-key' ,
854+ revocationKey : 'ecc-revocation-key' ,
855+ } ,
856+ kyber : {
857+ public : 'kyber-public-key' ,
858+ private : 'kyber-private-key' ,
859+ } ,
860+ } ,
861+ } ;
862+
863+ // Act
864+ const result = await client . legacyRecoverAccount ( payload ) ;
865+
866+ // Assert
867+ expect ( callStub . firstCall . args ) . toEqual ( [
868+ `/users/legacy-recover-account?token=${ payload . token } ` ,
869+ {
870+ password : payload . encryptedPassword ,
871+ salt : payload . encryptedSalt ,
872+ mnemonic : payload . encryptedMnemonic ,
873+ asymmetricEncryptedMnemonic : {
874+ ecc : payload . eccEncryptedMnemonic ,
875+ hybrid : payload . kyberEncryptedMnemonic ,
876+ } ,
877+ keys : payload . keys ,
878+ } ,
879+ headers ,
880+ ] ) ;
881+ expect ( result ) . toEqual ( { } ) ;
882+ } ) ;
883+ } ) ;
837884} ) ;
838885
839886function clientAndHeaders (
0 commit comments