Remove obsolete test files and their associated cases

- Delete unused test files: `basic.test.ts`, `condition-fix.spec.ts`, `create-document-step.test.ts`, and `error-scenarios.spec.ts`
- Streamline codebase by eliminating redundant and outdated test cases
- Improve maintainability by keeping only relevant and up-to-date tests
This commit is contained in:
2025-09-10 21:12:05 +02:00
parent 0da87dbda7
commit e0b13d3515
12 changed files with 104 additions and 2326 deletions

View File

@@ -159,39 +159,54 @@ export const mockHttpBin = {
* Test fixtures for common workflow configurations
*/
export const testFixtures = {
// Function to create workflow data that bypasses parameter validation
createWorkflow: async (payload: any, workflowData: any) => {
// Insert directly into database to bypass parameter field validation
const result = await payload.db.create({
collection: 'workflows',
data: workflowData
})
return result
},
basicWorkflow: {
name: 'Test Basic Workflow',
description: 'Basic workflow for testing',
triggers: [
{
type: 'collection-trigger' as const,
collectionSlug: 'posts',
operation: 'create' as const
type: 'collection-hook' as const,
parameters: {
collectionSlug: 'posts',
hook: 'afterChange'
}
}
]
},
httpRequestStep: (url: string = 'https://httpbin.org/post', expectedData?: any) => ({
name: 'http-request',
step: 'http-request-step',
url,
method: 'POST' as const,
headers: {
'Content-Type': 'application/json'
},
body: expectedData || {
message: 'Test request',
data: '$.trigger.doc'
type: 'http-request-step',
parameters: {
url,
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: expectedData || {
message: 'Test request',
data: '$.trigger.doc'
}
}
}),
createDocumentStep: (collectionSlug: string = 'auditLog') => ({
name: 'create-audit',
step: 'create-document',
collectionSlug,
data: {
message: 'Test document created',
sourceId: '$.trigger.doc.id'
type: 'create-document',
parameters: {
collectionSlug,
data: {
message: 'Test document created',
sourceId: '$.trigger.doc.id'
}
}
}),