File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,7 @@ module TestHelper
99 # assert_equal "Hello world", props[:message]
1010 # end
1111 def assert_react_component ( name )
12- assert_select "div[data-react-class]" do |dom |
13- assert_select "[data-react-class=?]" , name
14-
12+ assert_select "div[data-react-class=?]" , name do |dom |
1513 if block_given?
1614 props = JSON . parse ( dom . attr ( "data-react-props" ) )
1715 props . deep_transform_keys! { |key | key . to_s . underscore }
Original file line number Diff line number Diff line change @@ -13,5 +13,8 @@ class TestHelperTest < ActionDispatch::IntegrationTest
1313 assert_select "[id=?]" , "component"
1414 assert_select "[class=?]" , "greeting-message"
1515 end
16+ assert_react_component "Todo" do |props |
17+ assert_equal "Another Component" , props [ :todo ]
18+ end
1619 end
1720end
You can’t perform that action at this time.
0 commit comments