Skip to content

LG-10918 Cancel option visible on OTP screen#9165

Merged
kevinsmaster5 merged 19 commits intomainfrom
kmas-lg-10918-cancel-option-visible
Sep 26, 2023
Merged

LG-10918 Cancel option visible on OTP screen#9165
kevinsmaster5 merged 19 commits intomainfrom
kmas-lg-10918-cancel-option-visible

Conversation

@kevinsmaster5
Copy link
Contributor

@kevinsmaster5 kevinsmaster5 commented Sep 7, 2023

🎫 Ticket

LG-10918

🛠 Summary of changes

Modify the bottom of the Phone/Text confirmation screen so it uses the common cancel_or_back_to_options partial that is used by the other auth method confirmation views.

📜 Testing Plan

  • On http://localhost:3000/ create a new account and pick Face or touch unlock as the first MFA
  • Add another method then do Text or voice
  • On Cancel link can click back to add second MFA screen

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

I would not expect this to be specific to "Face or Touch Unlock", but rather any phone OTP confirmation stemming from the MFA selection screen. Maybe we can use MfaSetupConcern#in_multi_mfa_selection_flow? for this?

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Can we add some test coverage for the expected behavior under these conditions?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the screenshot in the pull request is accurate (anymore), since the partial being removed also rendered the footer with the border, which is no longer present as expected.

image

Copy link
Contributor

@aduth aduth Sep 15, 2023

Choose a reason for hiding this comment

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

I hadn't necessarily expected that the "Cancel" text needed to change as part of the ticket, more the link destination. In that regard, I don't know that we need to actually update the view here, and instead look at fixing the logic of PhoneDeliveryPresenter#cancel_link to handle the scenario where someone in the multi-MFA selection flow should be returned to the MFA selection screen.

def cancel_link
locale = LinkLocaleResolver.locale
if confirmation_for_add_phone || reauthn
account_path(locale: locale)
else
sign_out_path(locale: locale)
end
end

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 see. I took the title too literally. I'll work it back from the presenter instead.

@kevinsmaster5 kevinsmaster5 marked this pull request as draft September 15, 2023 19:01
@kevinsmaster5 kevinsmaster5 force-pushed the kmas-lg-10918-cancel-option-visible branch from 507f2b4 to 2df5cc1 Compare September 19, 2023 13:39
@kevinsmaster5 kevinsmaster5 marked this pull request as ready for review September 20, 2023 14:06
Copy link
Contributor

@jmdembe jmdembe Sep 22, 2023

Choose a reason for hiding this comment

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

We need to create an account at this point before we do mock_webauthn_setup_challenge

Comment on lines 81 to 82
Copy link
Contributor

Choose a reason for hiding this comment

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

sign_up_and_set_password does not need to be assigned to a user because it also creates a password

Suggested change
user = sign_up_and_set_password
user.password = Features::SessionHelper::VALID_PASSWORD
sign_up_and_set_password

Copy link
Contributor

@jmdembe jmdembe left a comment

Choose a reason for hiding this comment

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

Everything here LGTM once the comments are addressed. I would say that we should put the feature spec that was created into a new folder and file in spec/features so that it's clearer to what we are testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need this line anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. That's removed.

@kevinsmaster5
Copy link
Contributor Author

Everything here LGTM once the comments are addressed. I would say that we should put the feature spec that was created into a new folder and file in spec/features so that it's clearer to what we are testing.

So there's a /spec/features/phone folder - should I start a new xyz_spec.rb file there specific to the new test?

@jmdembe
Copy link
Contributor

jmdembe commented Sep 22, 2023

Everything here LGTM once the comments are addressed. I would say that we should put the feature spec that was created into a new folder and file in spec/features so that it's clearer to what we are testing.

So there's a /spec/features/phone folder - should I start a new xyz_spec.rb file there specific to the new test?

yeah, that's how I would approach it

@kevinsmaster5 kevinsmaster5 force-pushed the kmas-lg-10918-cancel-option-visible branch from 695d41f to 7f2a343 Compare September 25, 2023 12:53
Comment on lines 11 to 12
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not expecting data to be here, should it be?

Suggested change
:in_multi_mfa_selection_flow,
:data
:in_multi_mfa_selection_flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. That's removed.

@kevinsmaster5 kevinsmaster5 force-pushed the kmas-lg-10918-cancel-option-visible branch from e3d62e8 to e9dc25e Compare September 25, 2023 16:48
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

One question, but works well in my testing 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I might wonder if we should put this in spec/features/two_factor_authentication/multiple_mfa_sign_up_spec.rb as part of the multi-MFA-during-setup test suite, rather than a new standalone file. Thoughts?

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 agree, especially if it's not likely that in the near future more tests would need to be added to that spec.

@kevinsmaster5 kevinsmaster5 merged commit cfbf165 into main Sep 26, 2023
@kevinsmaster5 kevinsmaster5 deleted the kmas-lg-10918-cancel-option-visible branch September 26, 2023 11:49
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.

3 participants