1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Mobile: Fixes #10188: Fix "new note" button is shown in the trash notebook (#10227)

This commit is contained in:
Henry Heino
2024-03-29 05:11:15 -07:00
committed by GitHub
parent 06aa64016f
commit 688d807eee
7 changed files with 29 additions and 27 deletions

View File

@ -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);
});
});