assert(db);
});
+ it('is healthy', async function () {
+ const result = await db.healthCheck();
+ assert(result);
+ });
+
describe('Authentication', function () {
let identifier, credential;
beforeEach(function () {
assert.strictEqual(Number(topic.contentFetchAttemptsSinceSuccess), 0);
});
});
+ step('gets publish history', async function () {
+ await db.context(async (dbCtx) => {
+ const result = (await db.topicPublishHistory(dbCtx, topicId, 7))
+ .map((x) => Number(x));
+ const expected = [1, 0, 0, 0, 0, 0, 0];
+ assert.deepStrictEqual(result, expected);
+ });
+ });
step('deletes a topic', async function () {
await db.context(async (dbCtx) => {
const result = await db.topicSet(dbCtx, testData.anotherTopicSet);
step('complete subscription', async function () {
const { callback } = testData.subscriptionUpsert;
await db.context(async (dbCtx) => {
- await db.subscriptionDeliveryComplete(dbCtx, callback, topicId);
+ const topic = await db.topicGetById(dbCtx, topicId);
+ await db.subscriptionDeliveryComplete(dbCtx, callback, topicId, topic.contentUpdated);
const subscription = await db.subscriptionGetById(dbCtx, subscriptionId);
assert.strictEqual(Number(subscription.deliveryAttemptsSinceSuccess), 0);
});