Merge pull request #1375 from automatisch/factories/flow

test: Add factory file for the flow model
This commit is contained in:
Ömer Faruk Aydın
2023-10-23 18:43:14 +02:00
committed by GitHub

View File

@@ -0,0 +1,11 @@
import Flow from '../../src/models/flow';
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!';
const [flow] = await global.knex.table('flows').insert(params).returning('*');
return flow;
};