1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/lib/services/trash/index.test.ts
2024-03-02 14:25:27 +00:00

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