display history of topic updates on topic details page
[websub-hub] / test / src / db / integration.js
index 83feac761222a620793cb6963b9a2604e3fb60f5..b92202d41b0e30a04e759872ee984e756f95a13c 100644 (file)
@@ -79,6 +79,11 @@ describe('Database Integration', function () {
         assert(db);
       });
 
+      it('is healthy', async function () {
+        const result = await db.healthCheck();
+        assert(result);
+      });
+
       describe('Authentication', function () {
         let identifier, credential;
         beforeEach(function () {
@@ -220,6 +225,14 @@ describe('Database Integration', 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);