REF: String

This commit is contained in:
marcosrdz 2020-11-22 04:18:05 -05:00
parent c0b525de8a
commit 1d2689bbb0
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ module.exports.decrypt = function (data, password) {
str = bytes.toString(CryptoJS.enc.Utf8);
} catch (e) {}
// for some reason, sometimes decrypt would succeed with wrong password and return random couple of characters.
// for some reason, sometimes decrypt would succeed with incorrect password and return random couple of characters.
// at least in nodejs environment. so with this little hack we are not alowing to encrypt data that is shorter than
// 10 characters, and thus if decrypted data is less than 10 characters we assume that decrypt actually failed.
if (str.length < 10) return false;

View File

@ -96,11 +96,11 @@ describe('BlueWallet UI Tests', () => {
.toBeVisible()
.withTimeout(33000);
// trying to decrypt with wrong password
// trying to decrypt with incorrect password
await expect(element(by.text('Your storage is encrypted. Password is required to decrypt it'))).toBeVisible();
await element(by.type('android.widget.EditText')).typeText('wrong');
await element(by.text('OK')).tap();
await expect(element(by.text('Wrong password, please try again.'))).toBeVisible();
await expect(element(by.text('Incorrect password, please try again.'))).toBeVisible();
// correct password
await element(by.type('android.widget.EditText')).typeText('qqq');
@ -249,7 +249,7 @@ describe('BlueWallet UI Tests', () => {
await element(by.text('OK')).tap();
await element(by.type('android.widget.EditText')).typeText('fake');
await element(by.text('OK')).tap();
await expect(element(by.text('Wrong password, please try again.'))).toBeVisible();
await expect(element(by.text('Incorrect password, please try again.'))).toBeVisible();
await element(by.text('OK')).tap();
// correct password
@ -328,7 +328,7 @@ describe('BlueWallet UI Tests', () => {
await element(by.text('OK')).tap();
await element(by.type('android.widget.EditText')).typeText('pass');
await element(by.text('OK')).tap();
await expect(element(by.text('Wrong password, please try again.'))).toBeVisible();
await expect(element(by.text('Incorrect password, please try again.'))).toBeVisible();
await element(by.text('OK')).tap();
// correct password