Skip to content

Commit

Permalink
Merge pull request #9529 from Philwi/make-the-shop-url-clickable
Browse files Browse the repository at this point in the history
Make the shop url clickable
  • Loading branch information
filipefurtad0 authored Aug 17, 2022
2 parents cedfa35 + 141a2a5 commit d3f1d4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/views/admin/enterprises/form/_primary_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
%div{'ofn-with-tip' => t('.link_to_front_tip')}
%a= t('admin.whats_this')
.eight.columns.omega
= surround main_app.root_url, "/shop" do
{{Enterprise.permalink}}
- front_shop_path = "#{main_app.root_url}#{@enterprise.permalink}/shop"
= link_to front_shop_path, front_shop_path , target: "_blank"
.row
.three.columns.alpha
= f.label :id, t('.ofn_uid')
Expand Down
13 changes: 10 additions & 3 deletions spec/system/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@

select2_select eg1.name, from: 'enterprise_group_ids'

within(".permalink") do
link_path = "#{main_app.root_url}#{@enterprise.permalink}/shop"
link = find_link(link)
expect(link[:href]).to eq link_path
expect(link[:target]).to eq '_blank'
end

accept_alert do
click_link "Payment Methods"
end
Expand Down Expand Up @@ -186,7 +193,7 @@
shop_message_input = page.find("text-angular#enterprise_preferred_shopfront_message div[id^='taTextElement']")
shop_message_input.native.send_keys('This is my shopfront message.')
expect(page).to have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_close_at"
#using "find" as fields outside of the screen and are not visible
#using "find" as fields outside of the screen and are not visible
find(:xpath, '//*[@id="enterprise_preferred_shopfront_order_cycle_order_orders_open_at"]').trigger("click")
find(:xpath, '//*[@id="enterprise_enable_subscriptions_true"]').trigger("click")

Expand Down Expand Up @@ -483,7 +490,7 @@
within(".side_menu") do
click_link "Shop Preferences"
end

choose "enterprise_preferred_shopfront_product_sorting_method_by_category"
find("#s2id_enterprise_preferred_shopfront_taxon_order").click
find(".select2-result-label", text: "Tricky Taxon").click
Expand All @@ -504,7 +511,7 @@
within(".side_menu") do
click_link "Shop Preferences"
end

choose "enterprise_preferred_shopfront_product_sorting_method_by_producer"
find("#s2id_enterprise_preferred_shopfront_producer_order").click
find(".select2-result-label", text: "First Supplier").click
Expand Down

0 comments on commit d3f1d4a

Please sign in to comment.