test: trigger only flow should not be publishable

This commit is contained in:
Jakub P.
2024-09-23 22:35:19 +02:00
parent c8dae9ea9a
commit 06e8f5bfdc
8 changed files with 107 additions and 8 deletions

View File

@@ -0,0 +1,18 @@
const { pgPool } = require('./postgres-config');
const { expect } = require('../../fixtures/index');
export const flowShouldNotHavePublishedAtDateFilled = async (flowId) => {
const queryFlow = {
text: 'SELECT * FROM flows WHERE id = $1',
values: [flowId]
};
try {
const queryFlowResult = await pgPool.query(queryFlow);
expect(queryFlowResult.rowCount).toEqual(1);
expect(queryFlowResult.rows[0].published_at).toBeNull();
} catch (err) {
console.error(err.message);
throw err;
}
};