1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-27 10:32:58 +02:00
joplin/packages/lib/testing/share/makeMockShareInvitation.ts

28 lines
645 B
TypeScript

import { ShareInvitation, ShareUserStatus } from '../../services/share/reducer';
let idCounter = 0;
const makeMockShareInvitation = (userName: string, userEmail: string, status: ShareUserStatus): ShareInvitation => {
const shareTypeFolder = 3;
return {
id: `test-${idCounter++}`,
master_key: null,
share: {
type: shareTypeFolder,
id: `share-id-${idCounter++}`,
folder_id: 'some-id-here',
user: {
id: `user-${idCounter++}`,
full_name: userName,
email: userEmail,
},
master_key_id: null,
note_id: null,
},
status: status,
can_read: 1,
can_write: 1,
};
};
export default makeMockShareInvitation;