Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
describe('when saving new workflow data', () => {
const workflowData = new TestWorkflowData()
workflowData.$workflowId = uuid.v4()
workflowData.$status = WorkflowStatus.Running
workflowData.$version = 0
workflowData.eventValue = 'abc'
workflowData.property1 = 'something'
beforeAll(async () => {
await sut.saveWorkflowData(workflowData)
})
it('should add the row into the table', async () => {
const result = await postgres.query('select count(*) from "workflows"."testworkflowdata"')
const { count } = result.rows[0] as { count: string }
expect(count).toEqual('1')
})
describe('when getting the workflow data by property', () => {
const testCommand = new TestCommand(workflowData.property1)