update depedencies, changes to support updated authentication-module
[squeep-indie-auther] / test / src / service.js
index ab6646f19ae9ecccb817388cb8bbb71a18396e82..e55502913d3cccd917b94fe17a92aaeaa80c9ef8 100644 (file)
@@ -106,6 +106,32 @@ describe('Service', function () {
     });
   }); // handlerGetAdminLogout
 
+  describe('handlerGetAdminSettings', function () {
+    it('covers authenticated', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(true);
+      await service.handlerGetAdminSettings(req, res, ctx);
+      assert(service.sessionManager.getAdminSettings.called);
+    });
+    it('covers unauthenticated', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(false);
+      await service.handlerGetAdminSettings(req, res, ctx);
+      assert(service.sessionManager.getAdminSettings.notCalled);
+    });
+  }); // handlerGetAdminSettings
+
+  describe('handlerPostAdminSettings', function () {
+    it('covers authenticated', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(true);
+      await service.handlerPostAdminSettings(req, res, ctx);
+      assert(service.sessionManager.postAdminSettings.called);
+    });
+    it('covers unauthenticated', async function () {
+      service.authenticator.sessionRequiredLocal.resolves(false);
+      await service.handlerPostAdminSettings(req, res, ctx);
+      assert(service.sessionManager.postAdminSettings.notCalled);
+    });
+  }); // handlerPostAdminSettings
+
   describe('handlerGetAdmin', function () {
     it('covers authenticated', async function () {
       service.authenticator.sessionRequiredLocal.resolves(true);