You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
All: Add support for share permissions (#8491)
This commit is contained in:
@ -5,6 +5,7 @@ import Folder from '../../models/Folder';
|
||||
import Note from '../../models/Note';
|
||||
import BaseItem from '../../models/BaseItem';
|
||||
import WelcomeUtils from '../../WelcomeUtils';
|
||||
import { NoteEntity } from '../database/types';
|
||||
|
||||
describe('Synchronizer.basics', () => {
|
||||
|
||||
@ -12,6 +13,7 @@ describe('Synchronizer.basics', () => {
|
||||
await setupDatabaseAndSynchronizer(1);
|
||||
await setupDatabaseAndSynchronizer(2);
|
||||
await switchClient(1);
|
||||
synchronizer().testingHooks_ = [];
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
@ -260,6 +262,25 @@ describe('Synchronizer.basics', () => {
|
||||
expect(disabledItems.length).toBe(1);
|
||||
}));
|
||||
|
||||
it('should handle items that are read-only on the sync target', (async () => {
|
||||
const folder = await Folder.save({ title: 'folder' });
|
||||
const note = await Note.save({ title: 'un', is_todo: 1, parent_id: folder.id });
|
||||
const noteId = note.id;
|
||||
await synchronizerStart();
|
||||
await Note.save({ id: noteId, title: 'un mod' });
|
||||
synchronizer().testingHooks_ = ['itemIsReadOnly'];
|
||||
await synchronizerStart();
|
||||
synchronizer().testingHooks_ = [];
|
||||
|
||||
const noteReload = await Note.load(note.id);
|
||||
expect(noteReload.title).toBe(note.title);
|
||||
|
||||
const conflictNote: NoteEntity = (await Note.all()).find((n: NoteEntity) => !!n.is_conflict);
|
||||
expect(conflictNote).toBeTruthy();
|
||||
expect(conflictNote.title).toBe('un mod');
|
||||
expect(conflictNote.id).not.toBe(note.id);
|
||||
}));
|
||||
|
||||
it('should allow duplicate folder titles', (async () => {
|
||||
await Folder.save({ title: 'folder' });
|
||||
|
||||
|
Reference in New Issue
Block a user