mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
fix: update e2e test
This commit is contained in:
@ -2,7 +2,7 @@ import fs from 'node:fs';
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
import { prisma } from '..';
|
import { prisma } from '..';
|
||||||
import { DocumentDataType } from '../client';
|
import { DocumentDataType, ReadStatus, RecipientRole, SendStatus, SigningStatus } from '../client';
|
||||||
|
|
||||||
const examplePdf = fs
|
const examplePdf = fs
|
||||||
.readFileSync(path.join(__dirname, '../../../assets/example.pdf'))
|
.readFileSync(path.join(__dirname, '../../../assets/example.pdf'))
|
||||||
@ -28,9 +28,36 @@ export const seedTemplate = async (options: SeedTemplateOptions) => {
|
|||||||
return await prisma.template.create({
|
return await prisma.template.create({
|
||||||
data: {
|
data: {
|
||||||
title,
|
title,
|
||||||
templateDocumentDataId: documentData.id,
|
templateDocumentData: {
|
||||||
userId: userId,
|
connect: {
|
||||||
teamId,
|
id: documentData.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
User: {
|
||||||
|
connect: {
|
||||||
|
id: userId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Recipient: {
|
||||||
|
create: {
|
||||||
|
email: 'recipient.1@documenso.com',
|
||||||
|
name: 'Recipient 1',
|
||||||
|
token: Math.random().toString().slice(2, 7),
|
||||||
|
sendStatus: SendStatus.NOT_SENT,
|
||||||
|
signingStatus: SigningStatus.NOT_SIGNED,
|
||||||
|
readStatus: ReadStatus.NOT_OPENED,
|
||||||
|
role: RecipientRole.SIGNER,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...(teamId
|
||||||
|
? {
|
||||||
|
team: {
|
||||||
|
connect: {
|
||||||
|
id: teamId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user