LG 11140 Break up webauthn selection presenter#9467
Conversation
aduth
left a comment
There was a problem hiding this comment.
Looking good. Couple minor comments
There was a problem hiding this comment.
I'd suggest reordering these methods so that the constructor is first.
| def method | |
| :webauthn_platform | |
| end | |
| def initialize(user:, configuration: nil) | |
| @user = user | |
| @configuration = configuration | |
| end | |
| def initialize(user:, configuration: nil) | |
| @user = user | |
| @configuration = configuration | |
| end | |
| def method | |
| :webauthn_platform | |
| end |
There was a problem hiding this comment.
Got that reordered.
There was a problem hiding this comment.
I think we can remove checks below to configuration.blank?, since I would expect that the configuration should never be blank in the "Sign in" classes. They should be replaced with false.
3069918 to
4d2be38
Compare
4d2be38 to
3c30b5d
Compare
| it 'raises with missing translation' do | ||
| expect(presenter.label).to eq( | ||
| t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | ||
| ) | ||
| end | ||
| end | ||
|
|
||
| describe '#info' do | ||
| it 'raises with missing translation' do |
There was a problem hiding this comment.
I just noticed these as I start work on a related ticket. These methods don't raise, so I think we should revise the expectation description accordingly.
| it 'raises with missing translation' do | |
| expect(presenter.label).to eq( | |
| t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | |
| ) | |
| end | |
| end | |
| describe '#info' do | |
| it 'raises with missing translation' do | |
| it 'returns the label text' do | |
| expect(presenter.label).to eq( | |
| t('two_factor_authentication.two_factor_choice_options.webauthn_platform'), | |
| ) | |
| end | |
| end | |
| describe '#info' do | |
| it 'returns the info text' do |
| @@ -17,19 +17,6 @@ | |||
| end | |||
| end | |||
|
|
|||
| describe '#render_in' do | |||
There was a problem hiding this comment.
I think we lost test coverage here, we still have a SetUpWebauthnSelectionPresenter#render_in method.
🎫 Ticket
LG-11140
🛠 Summary of changes
Split up Webauthn & Webauthn Platform presenters into Sign Up and Sign In classes as a follow up to #9211
📜 Testing Plan
Adding Security key and Face or touch unlock MFA should continue to work as expected. Sign in with Security key or Face or touch unlock MFA should continue to work as expected.