You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
@@ -11,6 +11,7 @@ import BaseItem from '../../models/BaseItem';
|
||||
import Synchronizer from '../../Synchronizer';
|
||||
import { fetchSyncInfo, getEncryptionEnabled, localSyncInfo, setEncryptionEnabled } from '../synchronizer/syncInfoUtils';
|
||||
import { loadMasterKeysFromSettings, setupAndDisableEncryption, setupAndEnableEncryption } from '../e2ee/utils';
|
||||
import { remoteNotesAndFolders } from '../../testing/test-utils-synchronizer';
|
||||
|
||||
let insideBeforeEach = false;
|
||||
|
||||
@@ -72,6 +73,25 @@ describe('Synchronizer.e2ee', () => {
|
||||
expect(!folder1_2.encryption_cipher_text).toBe(true);
|
||||
}));
|
||||
|
||||
it('should not encrypt structural properties', (async () => {
|
||||
setEncryptionEnabled(true);
|
||||
await loadEncryptionMasterKey();
|
||||
const folder1 = await Folder.save({});
|
||||
const folder2 = await Folder.save({});
|
||||
const note1 = await Note.save({ parent_id: folder1.id });
|
||||
const note2 = await Note.save({ parent_id: folder2.id });
|
||||
|
||||
await Folder.delete(folder2.id, { toTrash: true, deleteChildren: true });
|
||||
|
||||
await synchronizerStart();
|
||||
|
||||
const remoteItems = await remoteNotesAndFolders();
|
||||
expect(remoteItems.find(i => i.id === folder1.id).deleted_time).toBe(0);
|
||||
expect(remoteItems.find(i => i.id === folder2.id).deleted_time).toBeGreaterThan(0);
|
||||
expect(remoteItems.find(i => i.id === note1.id).deleted_time).toBe(0);
|
||||
expect(remoteItems.find(i => i.id === note2.id).deleted_time).toBeGreaterThan(0);
|
||||
}));
|
||||
|
||||
it('should mark the key has having been used when synchronising the first time', (async () => {
|
||||
setEncryptionEnabled(true);
|
||||
await loadEncryptionMasterKey();
|
||||
|
||||
Reference in New Issue
Block a user