Skip to content

Commit

Permalink
Add specs for _mfa_selection recommended tag
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 20, 2024
1 parent a8a4a7f commit 06661bb
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
let(:form_builder) do
SimpleForm::FormBuilder.new(form_object.model_name.param_key, form_object, view_context, {})
end
let(:option) { presenter.options.first }
subject(:rendered) { render(partial: 'mfa_selection', locals: { form: form_builder, option: }) }

context 'before selecting options' do
subject(:rendered) do
Expand Down Expand Up @@ -143,4 +145,20 @@
)
end
end

describe 'recommended tag' do
it 'does not render recommended tag' do
expect(rendered).not_to have_css('.usa-tag', text: t('two_factor_authentication.recommended'))
end

context 'when option is recommended' do
before do
allow(option).to receive(:recommended?).and_return(true)
end

it 'renders with recommended tag' do
expect(rendered).to have_css('.usa-tag', text: t('two_factor_authentication.recommended'))
end
end
end
end

0 comments on commit 06661bb

Please sign in to comment.