Skip to content
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

Conversation

gowthamidommety-okta
Copy link
Contributor

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

@gowthamidommety-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta Please review this PR

@gowthamidommety-okta gowthamidommety-okta force-pushed the gd-OKTA-99123-signInWidgetFactorSortOrder branch from 0124d01 to 2b82201 Compare March 16, 2017 20:16
Copy link
Contributor

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);

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

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

'YUBIKEY','DUO','GOOGLE_AUTH','SYMANTEC_VIP','RSA_SECURID','QUESTION']);
});
});
itp(' with push and onPrem is in correct order', function () {

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

Copy link
Contributor Author

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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gowthamidommety-okta gowthamidommety-okta force-pushed the gd-OKTA-99123-signInWidgetFactorSortOrder branch from 2b82201 to b7c6dc2 Compare March 17, 2017 17:50
@gowthamidommety-okta
Copy link
Contributor Author

@mauriciocastillosilva-okta Implemented suggestions, Please review again.

Copy link
Contributor

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, _) {

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) {

Copy link
Contributor Author

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() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: getFactorList or getAllFactorsList

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this

});


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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting extra line

Copy link
Contributor

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
@gowthamidommety-okta gowthamidommety-okta force-pushed the gd-OKTA-99123-signInWidgetFactorSortOrder branch from a445dc6 to ca31c1f Compare March 20, 2017 17:51
@mauriciocastillosilva-okta mauriciocastillosilva-okta merged commit 4f03d68 into okta:master Mar 21, 2017
@gowthamidommety-okta gowthamidommety-okta deleted the gd-OKTA-99123-signInWidgetFactorSortOrder branch March 21, 2017 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants