-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Corrects sort order of factors #194
🐛 Corrects sort order of factors #194
Conversation
@mauriciocastillosilva-okta Please review this PR |
0124d01
to
2b82201
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left few comments, but this is looking good!
@@ -327,7 +336,7 @@ function (_, $, OktaAuth, Util, EnrollChoicesForm, Beacon, Expect, Router, | |||
itp('has a setup button for each unenrolled optional factor which navigates to the correct page (On-Prem)', | |||
function () { | |||
return setupWithAllOptionalSomeEnrolled(true).then(function (test) { | |||
expect(test.form.factorButton('OKTA_VERIFY').length).toBe(1); | |||
expect(test.form.factorButton('OKTA_VERIFY_PUSH').length).toBe(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be 1 right? Since that factor is there now instead of OKTA_VERIFY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setupWithAllOptionalSomeEnrolled sets the first factor in the xhr to enrolled. In MFA_ENROLLED_allFactors_OnPrem.js
, the first factor was changed from QUESTION
to OKTA_VERIFY_PUSH
. Because OKTA_VERIFY_PUSH
is now enrolled, it will not have a factor button, so length will be 0. I decided to write it this way, so the test would ensure the first factor does not have a button, and the rest do. Previously the test only ensured the un-enrolled factors had a button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah makes sense. Would it be a good idea then to add QUESTION
and check that the Setup button is there for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Good point. I think some of the others are missing too. Ill add them in as well.
test/unit/spec/EnrollChoices_spec.js
Outdated
'YUBIKEY','DUO','GOOGLE_AUTH','SYMANTEC_VIP','RSA_SECURID','QUESTION']); | ||
}); | ||
}); | ||
itp(' with push and onPrem is in correct order', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need for the space at the beginning of the test description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I will remove the space.
'QUESTION': 10 | ||
}; | ||
|
||
function clickFactorInDropdown(test, factorName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
2b82201
to
b7c6dc2
Compare
@mauriciocastillosilva-okta Implemented suggestions, Please review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of minor comments. Mind taking a look? It's all minor, functionality wise this is great.
@@ -1,4 +1,4 @@ | |||
define(['jquery', './Form'], function ($, Form) { | |||
define(['jquery', './Form', 'underscore'], function ($, Form, _) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missed this, but generally we have jquery and underscore before other files
define(['jquery', 'underscore', './Form'], function ($, _, Form) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 agreed!
@@ -68,6 +68,13 @@ define(['jquery', './Form'], function ($, Form) { | |||
|
|||
optionalFactorListTitle: function () { | |||
return this.optionalFactorList().find('.list-title').trimmedText(); | |||
}, | |||
|
|||
getFactorSequence: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: getFactorList
or getAllFactorsList
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this
test/unit/spec/EnrollChoices_spec.js
Outdated
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need for this extra line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting extra line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Can you, just for future reference, put a screen shot of how it looked before your change and how it looks after your change?
Factors are now in the correct order when signing in. The correct order can be viewed in the ticket. Also, added and updated tests to honor this new order. Resolves: OKTA-99123
a445dc6
to
ca31c1f
Compare
Factors are now in the correct order when signing in. The correct order can be viewed in the ticket. Also, added and updated tests to honor this new order.
Resolves: OKTA-99123