columnTwo: 4,
},
];
- db.pgpInitOptions.receive(data, result, event)
+ db.pgpInitOptions.receive({ data, result, ctx: event });
assert(db.logger.debug.called);
assert.deepStrictEqual(data, expectedData);
});
columnTwo: 4,
},
];
- db.pgpInitOptions.receive(data, result, event)
+ db.pgpInitOptions.receive({ data, result, ctx: event });
assert(!db.logger.debug.called);
assert.deepStrictEqual(data, expectedData);
});
});
});
+ 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 () {