Skip to content

Commit

Permalink
test(Stack): static props test
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelucca committed Oct 1, 2024
1 parent 320ba20 commit 09bd744
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/components/alpha/stack_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ def test_renders_responsive_props
end
end

# iterate over
def test_renders_static_props
end
Primer::Alpha::Stack::ResponsiveArg.descendants.each do |descendant|
descendant::OPTIONS.each do |option|
next unless option
define_method("test_renders_static_prop_#{descendant.arg_name}_with_#{option}_option") do
render_inline(Primer::Alpha::Stack.new(descendant.arg_name => option)) do
"content"
end

assert_selector("div[data-#{descendant.arg_name.to_s.dasherize}=\"#{option.to_s.dasherize}\"]")
end
end
end

def test_status
assert_component_state(Primer::Alpha::Stack, :alpha)
end
Expand Down

0 comments on commit 09bd744

Please sign in to comment.