X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsrc%2Fservice.js;h=e55502913d3cccd917b94fe17a92aaeaa80c9ef8;hb=fba42a499fe1af051b0982c1f3e8b3873c9ed2fb;hp=ab6646f19ae9ecccb817388cb8bbb71a18396e82;hpb=e8dccf76ec2776f07eddd1ce2f1c4fc150a6f790;p=squeep-indie-auther diff --git a/test/src/service.js b/test/src/service.js index ab6646f..e555029 100644 --- a/test/src/service.js +++ b/test/src/service.js @@ -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);