test: Add createdAt and updatedAt defaultst to execution and flow
This commit is contained in:
@@ -4,6 +4,8 @@ import { createFlow } from './flow';
|
||||
export const createExecution = async (params: Partial<Execution> = {}) => {
|
||||
params.flowId = params?.flowId || (await createFlow()).id;
|
||||
params.testRun = params?.testRun || false;
|
||||
params.createdAt = params?.createdAt || new Date().toISOString();
|
||||
params.updatedAt = params?.updatedAt || new Date().toISOString();
|
||||
|
||||
const [execution] = await global.knex
|
||||
.table('executions')
|
||||
|
@@ -4,6 +4,8 @@ import { createUser } from './user';
|
||||
export const createFlow = async (params: Partial<Flow> = {}) => {
|
||||
params.userId = params?.userId || (await createUser()).id;
|
||||
params.name = params?.name || 'Name your flow!';
|
||||
params.createdAt = params?.createdAt || new Date().toISOString();
|
||||
params.updatedAt = params?.updatedAt || new Date().toISOString();
|
||||
|
||||
const [flow] = await global.knex.table('flows').insert(params).returning('*');
|
||||
|
||||
|
Reference in New Issue
Block a user