mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-30 10:36:35 +02:00
42 lines
610 B
TypeScript
42 lines
610 B
TypeScript
import { getDisplayParentId, getTrashFolderId } from '.';
|
|
|
|
describe('services/trash', () => {
|
|
|
|
test.each([
|
|
[
|
|
{
|
|
deleted_time: 0,
|
|
parent_id: '1',
|
|
},
|
|
{
|
|
deleted_time: 0,
|
|
},
|
|
'1',
|
|
],
|
|
[
|
|
{
|
|
deleted_time: 1000,
|
|
parent_id: '1',
|
|
},
|
|
{
|
|
deleted_time: 0,
|
|
},
|
|
getTrashFolderId(),
|
|
],
|
|
[
|
|
{
|
|
deleted_time: 1000,
|
|
parent_id: '1',
|
|
},
|
|
{
|
|
deleted_time: 1000,
|
|
},
|
|
'1',
|
|
],
|
|
])('should return the display parent ID', (item, itemParent, expected) => {
|
|
const actual = getDisplayParentId(item, itemParent);
|
|
expect(actual).toBe(expected);
|
|
});
|
|
|
|
});
|