mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-04 02:34:52 +00:00
code: nextjs,frontends,workflow (3 files)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user