Skip to content

Commit

Permalink
refactor isLoginRequest test
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 43e8442 commit e50573e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/unit/util_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,40 +522,48 @@ describe('Util', function ()
}
});

it("Util.isLoginRequest Test", function () {
describe("Util.isLoginRequest Test", function () {
const baseUrl = 'wwww.test.com';
const testCases =
[
{
testName: 'test URL with a right login end point',
endPoint: '/v1/login-request',
result: true,
},
{
testName: 'test URL with a wrong login end point',
endPoint: '/login-request',
result: false,
},
{
testName: 'test URL with a right authenticator-request point',
endPoint: '/authenticator-request',
result:true,
},
{
testName: 'test URL with a wrong authenticator-request point',
endPoint: '/authenticator-requ',
result:false,
},
{
testName: 'test URL with a right token point',
endPoint: '/token-request',
result:true,
},
{
testName: 'test URL with a wrong token point',
endPoint: '/tokenRequest',
result:false,
},
];

for (const {endPoint,result} of testCases)
for (const {testName, endPoint,result} of testCases)
{
const isLoginRequest = Util.isLoginRequest(baseUrl + endPoint);
assert.strictEqual(isLoginRequest, result);
it(testName, function () {
const isLoginRequest = Util.isLoginRequest(baseUrl + endPoint);
assert.strictEqual(isLoginRequest, result);
})
}
});

Expand Down

0 comments on commit e50573e

Please sign in to comment.