From c2299fc84a96f4accc58f76b0523348d4df7975c Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-jy Date: Fri, 20 Oct 2023 00:21:10 -0700 Subject: [PATCH] add testing cases --- test/unit/util_test.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/unit/util_test.js b/test/unit/util_test.js index 6a0e11e57..92c0d5f05 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -522,6 +522,42 @@ describe('Util', function () } }) + it("Util.isLoginRequest Test", function () { + const baseUrl = 'wwww.test.com'; + const testCases = + [ + { + endPoint: '/v1/login-request', + result: true, + }, + { + endPoint: '/login-request', + result: false, + }, + { + endPoint: '/authenticator-request', + result:true, + }, + { + endPoint: '/authenticator-requ', + result:false, + }, + { + endPoint: '/token-request', + result:true, + }, + { + endPoint: '/tokenRequest', + result:false, + } + ]; + for (const {endPoint,result} of testCases) + { + const isLoginRequest = Util.isLoginRequest(baseUrl+endPoint); + assert.strictEqual(isLoginRequest,result); + } + }) + it('Util.apply()', function () { assert.strictEqual(Util.apply(null, null), null);