mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
Rename CipherString and CipherArrayBuffer to Enc (#352)
This commit is contained in:
@@ -10,14 +10,14 @@ import { StorageService } from '../../../src/abstractions/storage.service';
|
||||
import { UserService } from '../../../src/abstractions/user.service';
|
||||
import { Utils } from '../../../src/misc/utils';
|
||||
import { Cipher } from '../../../src/models/domain/cipher';
|
||||
import { CipherArrayBuffer } from '../../../src/models/domain/cipherArrayBuffer';
|
||||
import { CipherString } from '../../../src/models/domain/cipherString';
|
||||
import { EncArrayBuffer } from '../../../src/models/domain/encArrayBuffer';
|
||||
import { EncString } from '../../../src/models/domain/encString';
|
||||
import { SymmetricCryptoKey } from '../../../src/models/domain/symmetricCryptoKey';
|
||||
|
||||
import { CipherService } from '../../../src/services/cipher.service';
|
||||
|
||||
const ENCRYPTED_TEXT = 'This data has been encrypted';
|
||||
const ENCRYPTED_BYTES = new CipherArrayBuffer(Utils.fromUtf8ToArray(ENCRYPTED_TEXT).buffer);
|
||||
const ENCRYPTED_BYTES = new EncArrayBuffer(Utils.fromUtf8ToArray(ENCRYPTED_TEXT).buffer);
|
||||
|
||||
describe('Cipher Service', () => {
|
||||
let cryptoService: SubstituteOf<CryptoService>;
|
||||
@@ -42,7 +42,7 @@ describe('Cipher Service', () => {
|
||||
searchService = Substitute.for<SearchService>();
|
||||
|
||||
cryptoService.encryptToBytes(Arg.any(), Arg.any()).resolves(ENCRYPTED_BYTES);
|
||||
cryptoService.encrypt(Arg.any(), Arg.any()).resolves(new CipherString(ENCRYPTED_TEXT));
|
||||
cryptoService.encrypt(Arg.any(), Arg.any()).resolves(new EncString(ENCRYPTED_TEXT));
|
||||
|
||||
cipherService = new CipherService(cryptoService, userService, settingsService, apiService, fileUploadService,
|
||||
storageService, i18nService, () => searchService);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FolderService } from '../../../src/abstractions/folder.service';
|
||||
import { ExportService } from '../../../src/services/export.service';
|
||||
|
||||
import { Cipher } from '../../../src/models/domain/cipher';
|
||||
import { CipherString } from '../../../src/models/domain/cipherString';
|
||||
import { EncString } from '../../../src/models/domain/encString';
|
||||
import { Login } from '../../../src/models/domain/login';
|
||||
import { CipherWithIds as CipherExport } from '../../../src/models/export/cipherWithIds';
|
||||
|
||||
@@ -46,11 +46,11 @@ function generateCipherView(deleted: boolean) {
|
||||
function generateCipherDomain(deleted: boolean) {
|
||||
return BuildTestObject({
|
||||
id: GetUniqueString('id'),
|
||||
notes: new CipherString(GetUniqueString('notes')),
|
||||
notes: new EncString(GetUniqueString('notes')),
|
||||
type: CipherType.Login,
|
||||
login: BuildTestObject<Login>({
|
||||
username: new CipherString(GetUniqueString('username')),
|
||||
password: new CipherString(GetUniqueString('password')),
|
||||
username: new EncString(GetUniqueString('username')),
|
||||
password: new EncString(GetUniqueString('password')),
|
||||
}, Login),
|
||||
collectionIds: null,
|
||||
deletedDate: deleted ? new Date() : null,
|
||||
|
||||
Reference in New Issue
Block a user