Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1333 from vitoravelino/fix-bootstrap-js
Browse files Browse the repository at this point in the history
Added missing button/collapse bootstrap js
  • Loading branch information
mssola authored Jul 21, 2017
2 parents b0f0c23 + ac6f858 commit 7a3e364
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/assets/javascripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import 'bootstrap/js/tab';
import 'bootstrap/js/tooltip';
import 'bootstrap/js/popover';
import 'bootstrap/js/dropdown';
import 'bootstrap/js/button';
import 'bootstrap/js/collapse';

// Life it up
import 'vendor/lifeitup_layout';
Expand Down
52 changes: 52 additions & 0 deletions spec/features/admin/registries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@
expect(page).to have_content("Registry was successfully created.")
expect(Registry.any?).to be_truthy
end

it "shows advanced options when clicking on Show Advanced", js: true do
visit new_admin_registry_path

expect(page).not_to have_css("#advanced.collapse.in")

click_button "Show Advanced"
wait_for_effect_on("#advanced")

expect(page).to have_content("External Registry Name")
expect(page).to have_css("#advanced.collapse.in")
end

it "hides advanced options when clicking on Hide Advanced", js: true do
visit new_admin_registry_path

click_button "Show Advanced"
wait_for_effect_on("#advanced")

expect(page).to have_content("External Registry Name")
expect(page).to have_css("#advanced.collapse.in")

click_button "Hide Advanced"
wait_for_effect_on("#advanced")

expect(page).not_to have_css("#advanced.collapse.in")
expect(page).not_to have_content("External Registry Name")
end
end

describe "update" do
Expand Down Expand Up @@ -64,5 +92,29 @@
registry.reload
expect(registry.hostname).to eq "lala"
end

it "shows advanced options when clicking on Show Advanced", js: true do
expect(page).not_to have_css("#advanced")

click_button "Show Advanced"
wait_for_effect_on("#advanced")

expect(page).to have_content("External Registry Name")
expect(page).to have_css("#advanced.collapse.in")
end

it "hides advanced options when clicking on Hide Advanced", js: true do
click_button "Show Advanced"
wait_for_effect_on("#advanced")

expect(page).to have_content("External Registry Name")
expect(page).to have_css("#advanced.collapse.in")

click_button "Hide Advanced"
wait_for_effect_on("#advanced")

expect(page).not_to have_css("#advanced.collapse.in")
expect(page).not_to have_content("External Registry Name")
end
end
end

0 comments on commit 7a3e364

Please sign in to comment.