Skip to content

Commit

Permalink
add testing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Oct 20, 2023
1 parent 829edee commit c2299fc
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/unit/util_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c2299fc

Please sign in to comment.