X-Git-Url: http://git.squeep.com/?p=websub-hub;a=blobdiff_plain;f=test%2Fsrc%2Fdb%2Fsqlite.js;h=deb0ee244fbbb0811f0f6b62b66bebe41aac8ff6;hp=be6399445bcb01279ca2c2b9392c58cbf94e934c;hb=737fbd003d5c4dfea81b667ef906f1c106a60612;hpb=17b4ff9c1974842c02071d2cd02144d2e5a99eb5 diff --git a/test/src/db/sqlite.js b/test/src/db/sqlite.js index be63994..deb0ee2 100644 --- a/test/src/db/sqlite.js +++ b/test/src/db/sqlite.js @@ -460,7 +460,7 @@ describe('DatabaseSQLite', function () { assert.deepStrictEqual(e, expected); } }); - }); + }); // subscriptionDeleteExpired describe('subscriptionDeliveryClaim', function () { it('success', async function () { @@ -1151,7 +1151,22 @@ describe('DatabaseSQLite', function () { } assert(db.statement.topicDeleteById.run.called); }); - }); + }); // topicPendingDelete + + describe('topicPublishHistory', function () { + beforeEach(function () { + sinon.stub(db.statement.topicPublishHistory, 'all'); + }); + it('success', function () { + db.statement.topicPublishHistory.all.returns([ + { daysAgo: 1, contentUpdates: 1 }, + { daysAgo: 3, contentUpdates: 2 }, + ]); + const result = db.topicPublishHistory(dbCtx, topicId, 7); + const expected = [0, 1, 0, 2, 0, 0, 0]; + assert.deepStrictEqual(result, expected); + }); + }); // topicPublishHistory describe('topicSet', function () { let data;