update dependencies, fixes to support new authentication features
[websub-hub] / test / src / service.js
index 8be37e2416b7310d3f3ccdcd1886728f913872e0..2cfe38d66ed4b55115ebb070dcc4301c1f7b9f1d 100644 (file)
@@ -188,6 +188,34 @@ describe('Service', function () {
     });
   }); // handlerGetAdminLogin
 
+  describe('handlerGetAdminSettings', function () {
+    it('covers logged in', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(true);
+      await service.handlerGetAdminSettings(req, res, ctx);
+      assert(service.sessionManager.getAdminSettings.called);
+    });
+    it('covers not logged in', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(false);
+      await service.handlerGetAdminSettings(req, res, ctx);
+      assert(service.sessionManager.getAdminSettings.notCalled);
+    });
+  }); // handlerGetAdminSettings
+
+  describe('handlerPostAdminSettings', function () {
+    it('covers logged in', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(true);
+      sinon.stub(service, 'bodyData').resolves();
+      await service.handlerPostAdminSettings(req, res, ctx);
+      assert(service.sessionManager.postAdminSettings.called);
+    });
+    it('covers logged outo', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(false);
+      sinon.stub(service, 'bodyData').resolves();
+      await service.handlerPostAdminSettings(req, res, ctx);
+      assert(service.sessionManager.postAdminSettings.notCalled);
+    });
+  }); // handlerPostAdminSettings
+
   describe('handlerPostAdminLogin', function () {
     it('covers', async function () {
       sinon.stub(service, 'bodyData').resolves();