code: nextjs,frontends,workflow (3 files)

This commit is contained in:
2025-12-25 19:48:14 +00:00
parent 5d7418c301
commit a74a3cdf61
3 changed files with 24 additions and 5 deletions
@@ -0,0 +1,19 @@
import { describe, expect, it } from 'vitest'
import { validateWorkflowUpdate } from '../../../src/core/validation/validate-workflow-update'
describe('validateWorkflowUpdate', () => {
it.each([
{ data: { name: 'Updated' }, expected: [] },
{ data: { isActive: false }, expected: [] },
])('returns $expected for valid case', ({ data, expected }) => {
expect(validateWorkflowUpdate(data)).toEqual(expected)
})
it.each([
{ data: { trigger: 'invalid' as unknown as 'manual' }, message: 'trigger must be one of manual, schedule, event, webhook' },
{ data: { isActive: 'yes' as unknown as boolean }, message: 'isActive must be a boolean' },
{ data: { triggerConfig: [] }, message: 'triggerConfig must be an object' },
])('rejects invalid case', ({ data, message }) => {
expect(validateWorkflowUpdate(data)).toContain(message)
})
})
@@ -6,5 +6,5 @@ export {
generateDeterministicScrambledPassword,
simulateEmailSend,
DEFAULT_SMTP_CONFIG,
} from './password'
export type { SMTPConfig } from './password'
} from './index'
export type { SMTPConfig } from './index'
@@ -1,7 +1,7 @@
import type { ComponentInstance } from './builder-types'
import type { ComponentInstance } from '../types/builder-types'
import type { User } from '../types/level-types'
import { Database } from './database'
import { LuaEngine } from './lua-engine'
import { Database } from '../database'
import { LuaEngine } from '../lua-engine'
export interface PageDefinition {
id: string