-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PUI expand/collapse all config option
- Loading branch information
1 parent
944aa84
commit 14afc81
Showing
6 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
require 'spec_helper' | ||
require 'rails_helper' | ||
|
||
describe 'Accordion of additional record information blocks', js: true do | ||
before(:each) do | ||
visit('/') | ||
click_link 'Collections' | ||
expect(current_path).to eq ('/repositories/resources') | ||
resource = first("a.record-title") | ||
visit(resource['href']) | ||
|
||
$panels = page.all('.upper-record-details + .acc_holder div.panel.panel-default') | ||
end | ||
|
||
it 'should be found after the upper record details of a resource page' do | ||
expect(page).to have_css('div.upper-record-details + div.acc_holder') | ||
end | ||
|
||
it 'should have all panels expanded by default' do | ||
$panels.each do |panel| | ||
expect(panel).to have_css('.note_panel[aria-expanded="true"]', visible: true) | ||
end | ||
|
||
end | ||
|
||
it 'should collapse then expand all panels on button clicks' do | ||
accordion_toggle_btn = page.find('.upper-record-details + .acc_holder > a.acc_button') | ||
accordion_toggle_btn.click | ||
|
||
$panels.each do |panel| | ||
expect(panel).to have_css('.note_panel[aria-expanded="false"]', visible: :hidden) | ||
end | ||
|
||
accordion_toggle_btn.click | ||
|
||
$panels.each do |panel| | ||
expect(panel).to have_css('.note_panel[aria-expanded="true"]', visible: true) | ||
end | ||
|
||
end | ||
|
||
end |