1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00
This commit is contained in:
Laurent Cozic
2021-06-26 18:18:10 +01:00
parent 400ede122d
commit 05e4b32d9b
41 changed files with 284 additions and 109 deletions

View File

@@ -2,7 +2,7 @@ import MasterKey from '../models/MasterKey';
import Setting from '../models/Setting';
import { encryptionService, setupDatabaseAndSynchronizer, switchClient } from '../testing/test-utils';
import MigrationService from './MigrationService';
import { SyncTargetInfo } from './synchronizer/syncTargetInfoUtils';
import { setActiveMasterKeyId, setEncryptionEnabled, SyncTargetInfo } from './synchronizer/syncTargetInfoUtils';
function migrationService() {
return new MigrationService();
@@ -20,8 +20,8 @@ describe('MigrationService', function() {
const mk1 = await MasterKey.save(await encryptionService().generateMasterKey('1'));
const mk2 = await MasterKey.save(await encryptionService().generateMasterKey('2'));
Setting.setValue('encryption.enabled', true);
Setting.setValue('encryption.activeMasterKeyId', mk2.id);
setEncryptionEnabled(true);
setActiveMasterKeyId(mk2.id);
await migrationService().runScript(40);