mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 17:51:49 +10:00
chore: changes based on review
This commit is contained in:
@ -632,10 +632,10 @@ test('[DOCUMENT_FLOW]: should be able to create and sign a document with 3 recip
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the document to be signed.
|
// Wait for the document to be signed.
|
||||||
await page.waitForTimeout(5000);
|
await expect(async () => {
|
||||||
|
const signedDocument = await getDocumentById({ id: document.id, userId: user.id });
|
||||||
const signedDocument = await getDocumentById({ id: document.id, userId: user.id });
|
expect(signedDocument?.status).toBe(DocumentStatus.COMPLETED);
|
||||||
expect(signedDocument?.status).toBe(DocumentStatus.COMPLETED);
|
}).toPass();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('[DOCUMENT_FLOW]: should prevent out-of-order signing in sequential mode', async ({
|
test('[DOCUMENT_FLOW]: should prevent out-of-order signing in sequential mode', async ({
|
||||||
@ -747,8 +747,8 @@ test('[DOCUMENT_FLOW]: should be able to self sign a document', async ({ page })
|
|||||||
const updatedRecipient = await getRecipientById({ documentId: document.id, id: recipientId });
|
const updatedRecipient = await getRecipientById({ documentId: document.id, id: recipientId });
|
||||||
expect(updatedRecipient?.signingStatus).toBe(SigningStatus.SIGNED);
|
expect(updatedRecipient?.signingStatus).toBe(SigningStatus.SIGNED);
|
||||||
|
|
||||||
await page.waitForTimeout(5000);
|
await expect(async () => {
|
||||||
|
const signedDocument = await getDocumentById({ id: document.id, userId: user.id });
|
||||||
const signedDocument = await getDocumentById({ id: document.id, userId: user.id });
|
expect(signedDocument?.status).toBe(DocumentStatus.COMPLETED);
|
||||||
expect(signedDocument?.status).toBe(DocumentStatus.COMPLETED);
|
}).toPass();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export const selfSignDocument = async ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const document = await prisma.document.findUnique({
|
const document = await prisma.document.findFirstOrThrow({
|
||||||
where: {
|
where: {
|
||||||
id: documentId,
|
id: documentId,
|
||||||
userId,
|
userId,
|
||||||
@ -64,7 +64,7 @@ export const selfSignDocument = async ({
|
|||||||
|
|
||||||
const { documentData } = document;
|
const { documentData } = document;
|
||||||
|
|
||||||
if (!documentData.data) {
|
if (!documentData || !documentData.data) {
|
||||||
throw new Error('Document data not found');
|
throw new Error('Document data not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ export const sendDocument = async ({
|
|||||||
|
|
||||||
const { documentData } = document;
|
const { documentData } = document;
|
||||||
|
|
||||||
if (!documentData.data) {
|
if (!documentData || !documentData.data) {
|
||||||
throw new Error('Document data not found');
|
throw new Error('Document data not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user