File tree Expand file tree Collapse file tree
ruby/hyper-component/spec/client_features Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ class Foo
6565 end
6666 end
6767 end
68- expect ( page . body ) . to match ( /<input data-foo="12" data-reactroot="" \/ >/ )
68+ expect ( find ( 'input' ) [ 'data-reactroot' ] ) . to eq ( '' )
69+ expect ( find ( 'input' ) [ 'data-foo' ] ) . to eq ( '12' )
6970 end
7071
7172 it "will turn the last string in a block into a element" do
@@ -287,11 +288,11 @@ class Foo
287288 class Foo
288289 include Hyperstack ::Component
289290 render do
290- DIV ( title : { bar : :foo } )
291+ DIV ( id : :div , title : { bar : :foo } ) { 'the div' }
291292 end
292293 end
293294 end
294- expect ( page . body [ - 80 ..- 19 ] ) . to include ( '<div title="{" bar"=>" foo"}"></div> ')
295+ expect ( find ( '#div' ) [ 'title' ] ) . to eq ( '{" bar"=>" foo"} ')
295296 end
296297
297298 it "will remove all elements passed as params from the rendering buffer" do
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ class Foo
2828 end
2929 end
3030 end
31- expect ( page . body [ -285 ..-233 ] ) . to match ( /<input (type="text" value=""|value="" type="text").*\/ >/ )
31+ # these checks are really not doing anything except making sure a proper
32+ # input tag is created as expected. However if false, nil, or a blank event
33+ # name was not filtered errors would be raised during rendering which will
34+ # throw errors.
35+ expect ( find ( 'input' ) [ 'type' ] ) . to eq ( 'text' )
36+ expect ( find ( 'input' ) [ 'value' ] ) . to eq ( '' )
3237 end
3338 end
3439
You can’t perform that action at this time.
0 commit comments