mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
eslintify all test files
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
/* global libsignal, textsecure */
|
||||
|
||||
describe('encrypting and decrypting profile data', () => {
|
||||
const NAME_PADDED_LENGTH = 26;
|
||||
describe('encrypting and decrypting profile names', () => {
|
||||
@@ -61,12 +63,12 @@ describe('encrypting and decrypting profile data', () => {
|
||||
'This is an avatar'
|
||||
).toArrayBuffer();
|
||||
const key = libsignal.crypto.getRandomBytes(32);
|
||||
const bad_key = libsignal.crypto.getRandomBytes(32);
|
||||
const badKey = libsignal.crypto.getRandomBytes(32);
|
||||
|
||||
return textsecure.crypto.encryptProfile(buffer, key).then(encrypted => {
|
||||
assert(encrypted.byteLength === buffer.byteLength + 16 + 12);
|
||||
return textsecure.crypto
|
||||
.decryptProfile(encrypted, bad_key)
|
||||
.decryptProfile(encrypted, badKey)
|
||||
.catch(error => {
|
||||
assert.strictEqual(error.name, 'ProfileDecryptError');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user