diff --git a/tests/integration/databaseTests/baseConnector.tests.js b/tests/integration/databaseTests/baseConnector.tests.js index 7f15dc90f..c34064bbe 100644 --- a/tests/integration/databaseTests/baseConnector.tests.js +++ b/tests/integration/databaseTests/baseConnector.tests.js @@ -101,6 +101,9 @@ const getExpiredCase = [ 'baseConnector-getExpired()-tester-1', 'baseConnector-getExpired()-tester-2', ]; +const getCountWithStatusCase = [ + 'baseConnector-getCountWithStatusCase()-tester-0' +]; const upsertCases = { insert: 'baseConnector-upsert()-tester-row-inserted', update: 'baseConnector-upsert()-tester-row-updated' @@ -205,7 +208,7 @@ afterAll(async function () { const upsertIds = Object.values(upsertCases); const tableChangesIds = [...emptyCallbacksCase, ...documentsWithChangesCase, ...changesIds, ...insertIds]; - const tableResultIds = [...emptyCallbacksCase, ...documentsWithChangesCase, ...getExpiredCase, ...upsertIds]; + const tableResultIds = [...emptyCallbacksCase, ...documentsWithChangesCase, ...getExpiredCase, ...getCountWithStatusCase, ...upsertIds]; const deletionPool = [ deleteRowsByIds(cfgTableChanges, tableChangesIds), @@ -413,6 +416,17 @@ describe('Base database connector', function () { expect(resultAfterNewRows.length).toEqual(resultBeforeNewRows.length + getExpiredCase.length); }); + + test('Get Count With Status', async function () { + let countWithStatus = await baseConnector.getCountWithStatus(ctx, commonDefines.FileStatus.SaveVersion); + expect(countWithStatus).toEqual(0); + for (const id of getCountWithStatusCase) { + const task = createTask(id); + task.status = commonDefines.FileStatus.SaveVersion; + await insertIntoResultTable(date, task); + } + expect(countWithStatus).toEqual(getCountWithStatusCase.length); + }); }); describe('upsert() method', function () {