X-Git-Url: http://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=test%2Fsrc%2Fdb%2Fpostgres.js;h=626b0c2573a145f1727e6cc5e099e06e16d1cdc1;hp=da071f2ab28566b53b73ba3ff25858c7e96e0355;hb=737fbd003d5c4dfea81b667ef906f1c106a60612;hpb=17b4ff9c1974842c02071d2cd02144d2e5a99eb5 diff --git a/test/src/db/postgres.js b/test/src/db/postgres.js index da071f2..626b0c2 100644 --- a/test/src/db/postgres.js +++ b/test/src/db/postgres.js @@ -1322,6 +1322,21 @@ describe('DatabasePostgres', function () { }); }); + describe('topicPublishHistory', function () { + beforeEach(function () { + sinon.stub(db.db, 'manyOrNone'); + }); + it('success', async function () { + db.db.manyOrNone.returns([ + { daysAgo: 1, contentUpdates: 1 }, + { daysAgo: 3, contentUpdates: 2 }, + ]); + const result = await db.topicPublishHistory(dbCtx, topicId, 7); + const expected = [0, 1, 0, 2, 0, 0, 0]; + assert.deepStrictEqual(result, expected); + }); + }); // topicPublishHistory + describe('topicSet', function () { let data; beforeEach(function () {