Scroll to reveal White Label tab

The Vouchers tab pushed the White Label tab further down and it was
hidden by the savebar. The CSS adjustment in this commit makes sure
that users can always see all menu items.

The automatic scrolling by Capybara fails because of the savebar but
scrolling to the bottom works.
This commit is contained in:
Maikel Linke
2023-12-22 16:06:04 +11:00
parent b0b061f97d
commit e2eead0f86
2 changed files with 20 additions and 27 deletions

View File

@@ -2,6 +2,9 @@
border-right: 2px solid #f6f6f6;
border-top: 2px solid #f6f6f6;
/* Reserve space for the save bar to avoid hidden menu items. */
margin-bottom: 2em;
.menu_item {
display: block;
padding: 8px 15px;

View File

@@ -623,9 +623,7 @@ describe '
before do
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
end
it "set the hide_ofn_navigation preference for the current shop" do
@@ -636,9 +634,7 @@ describe '
expect(distributor1.reload.hide_ofn_navigation).to be true
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
uncheck "Hide OFN navigation"
click_button 'Update'
@@ -655,9 +651,7 @@ describe '
expect(distributor1.reload.hide_ofn_navigation).to be true
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
expect(page).to have_content "LOGO USED IN SHOPFRONT"
uncheck "Hide OFN navigation"
@@ -672,9 +666,7 @@ describe '
distributor1.update_attribute(:hide_ofn_navigation, true)
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
end
it "can updload the white label logo for the current shop" do
@@ -694,9 +686,7 @@ describe '
distributor1.update white_label_logo: white_logo_file
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
end
it "can remove the white label logo for the current shop" do
@@ -750,9 +740,7 @@ describe '
expect(distributor1.reload.hide_groups_tab).to be true
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
uncheck "Hide groups tab in shopfront"
click_button 'Update'
@@ -764,9 +752,7 @@ describe '
context "creating custom tabs" do
before do
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
check "Create custom tab in shopfront"
end
@@ -788,9 +774,7 @@ describe '
expect(page).to have_content("Custom tab title can't be blank")
expect(distributor1.reload.custom_tab).to be_nil
within(".side_menu") do
click_link "White Label"
end
select_white_label
expect(page).to have_checked_field "Create custom tab in shopfront"
end
@@ -813,9 +797,7 @@ describe '
before do
distributor1.update(custom_tab:)
visit edit_admin_enterprise_path(distributor1)
within(".side_menu") do
click_link "White Label"
end
select_white_label
end
it "display the custom tab fields with the current values" do
@@ -1094,6 +1076,14 @@ describe '
end
end
end
def select_white_label
# The savebar sits on top of the bottom menu item until we scroll.
scroll_to :bottom
within(".side_menu") do
click_link "White Label"
end
end
end
def update_message