You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { getDisplayParentId, getTrashFolderId } from '.';
|
||||
import { ModelType } from '../../BaseModel';
|
||||
import Folder from '../../models/Folder';
|
||||
|
||||
describe('services/trash', () => {
|
||||
|
||||
@ -40,10 +41,32 @@ describe('services/trash', () => {
|
||||
},
|
||||
'1',
|
||||
],
|
||||
|
||||
// should show non-deleted conflicts in the conflicts folder
|
||||
[
|
||||
{
|
||||
deleted_time: 0,
|
||||
is_conflict: 1,
|
||||
parent_id: Folder.conflictFolderId(),
|
||||
id: 'b',
|
||||
},
|
||||
Folder.conflictFolder(),
|
||||
Folder.conflictFolderId(),
|
||||
],
|
||||
// should show deleted conflicts in the trash folder
|
||||
[
|
||||
{
|
||||
deleted_time: 1000,
|
||||
is_conflict: 1,
|
||||
parent_id: Folder.conflictFolderId(),
|
||||
id: 'someidhere',
|
||||
},
|
||||
Folder.conflictFolder(),
|
||||
getTrashFolderId(),
|
||||
],
|
||||
])('should return the display parent ID (case %#)', (item, itemParent, expected) => {
|
||||
const defaultProps = { type_: ModelType.Folder };
|
||||
const actual = getDisplayParentId({ ...defaultProps, ...item }, { ...defaultProps, ...itemParent });
|
||||
expect(actual).toBe(expected);
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user