Skip to content

Commit

Permalink
Add similar spinner test in lib/
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Jun 10, 2024
1 parent 0dfd414 commit 35c9ee4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/lib/primer/forms/text_field_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,18 @@ def test_leading_visual

assert_selector "svg.octicon.octicon-search.FormControl-input-leadingVisual"
end

def test_enforces_leading_visual_when_spinner_requested
error = assert_raises(ArgumentError) do
render_in_view_context do
primer_form_with(url: "/foo") do |f|
render_inline_form(f) do |text_field_form|
text_field_form.text_field(name: :foo, label: "Foo", leading_spinner: true)
end
end
end
end

assert_includes error.message, "must also specify a leading visual"
end
end

0 comments on commit 35c9ee4

Please sign in to comment.