Skip to content

Commit

Permalink
Add another test case
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Apr 12, 2024
1 parent c9d6248 commit 7496bb5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions lib/capybara/spec/session/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@
expect(@session.find(:button, 'Should be clickable')).to be_visible
expect(@session.find(:button, 'Should not be clickable')).not_to be_visible
end

it 'works with popover parents' do
expect(@session.find(:id, 'popover_parent')).not_to be_visible
expect(@session.find(:id, 'popover_child')).not_to be_visible
@session.click_button('Show parent popover')
expect(@session.find(:id, 'popover_child', text: 'Popover Contents')).to be_visible
end
end

describe '#obscured?', requires: [:css] do
Expand Down
14 changes: 11 additions & 3 deletions lib/capybara/spec/views/with_html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,22 @@ banana</textarea>
<div>
<div style="position: relative; overflow: hidden;">
<button popovertarget="show">Show popover</button>
<%# <button style="position: absolute; top: 30px;">Can not be clicked</button> %>
<%# <button popover id="not_shown" style="position: absolute; top: 60px;">Should not be clickable</button>
<button popover id="show" style="position: absolute; top: 60px;">Should be clickable</button> %>
<button popover id="not_shown">Should not be clickable</button>
<button popover id="show">Should be clickable</button>
</div>
</div>

<div>
<div style="position: relative; overflow: hidden;">
<button popovertarget="popover_parent">Show parent popover</button>
<div popover id="popover_parent">
<div id="popover_child">
Popover Contents
</div>
</div>
</div>
</div>


<div style='height: 1000px'>spacer</div>

Expand Down

0 comments on commit 7496bb5

Please sign in to comment.