mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
Do not shows <a /> if producers is hidden
Different style as it does not open any modal
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
= t :shopping_producers_of_hub, hub: '{{ shopfront.name }}'
|
||||
%ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3
|
||||
%li{"ng-repeat" => "enterprise in shopfront.producers"}
|
||||
%enterprise-modal
|
||||
%enterprise-modal{"ng-if": "enterprise.visible != 'hidden'"}
|
||||
%i.ofn-i_036-producers
|
||||
{{ enterprise.name }}
|
||||
%span{"ng-if": "enterprise.visible == 'hidden'"}
|
||||
%i.ofn-i_036-producers
|
||||
{{ enterprise.name }}
|
||||
|
||||
@@ -42,15 +42,43 @@ describe "As a consumer I want to shop with a distributor" do
|
||||
expect(first("distributor img")['src']).to include "logo-white.png"
|
||||
end
|
||||
|
||||
it "shows the producers for a distributor" do
|
||||
exchange = Exchange.find(oc1.exchanges.to_enterprises(distributor).outgoing.first.id)
|
||||
add_variant_to_order_cycle(exchange, variant)
|
||||
|
||||
visit shop_path
|
||||
within ".tab-buttons" do
|
||||
click_link "Producers"
|
||||
describe "producers tab" do
|
||||
before do
|
||||
exchange = Exchange.find(oc1.exchanges.to_enterprises(distributor).outgoing.first.id)
|
||||
add_variant_to_order_cycle(exchange, variant)
|
||||
visit shop_path
|
||||
within ".tab-buttons" do
|
||||
click_link "Producers"
|
||||
end
|
||||
end
|
||||
|
||||
it "shows the producers for a distributor" do
|
||||
expect(page).to have_content supplier.name
|
||||
find("a", text: supplier.name).click
|
||||
within ".reveal-modal" do
|
||||
expect(page).to have_content supplier.name
|
||||
end
|
||||
end
|
||||
|
||||
context "when the producer visibility is set to 'hidden'" do
|
||||
before do
|
||||
supplier.visible = "hidden"
|
||||
supplier.save
|
||||
visit shop_path
|
||||
within ".tab-buttons" do
|
||||
click_link "Producers"
|
||||
end
|
||||
end
|
||||
|
||||
it "shows the producer name" do
|
||||
expect(page).to have_content supplier.name
|
||||
end
|
||||
|
||||
it "does not show the producer modal" do
|
||||
expect(page).to_not have_link supplier.name
|
||||
expect(page).to_not have_selector ".reveal-modal"
|
||||
end
|
||||
end
|
||||
expect(page).to have_content supplier.name
|
||||
end
|
||||
|
||||
describe "selecting an order cycle" do
|
||||
|
||||
Reference in New Issue
Block a user