Skip to content

Commit

Permalink
🐞 Marketplace: Fix link label to Seller's Order History (#1489)
Browse files Browse the repository at this point in the history
🐞 `Marketplace`: Fix label on link to Order History

- #1331
  • Loading branch information
zspencer authored May 22, 2023
1 parent bf2b4b6 commit 9a42210
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/furniture/marketplace/breadcrumbs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

crumb :marketplace_orders do |marketplace|
parent :marketplace, marketplace
link t("marketplace.order.index"), marketplace.location(child: :orders)
link t("marketplace.orders.index.link_to"), marketplace.location(child: :orders)
end

crumb :marketplace_products do |marketplace|
Expand Down
3 changes: 2 additions & 1 deletion app/furniture/marketplace/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ en:
success: "Marketplace updated successfully!"
failure: "Marketplace could not be updated."
order:
index: "Order History"
placed_mailer:
notification:
subject: "Order Placed at %{marketplace_name}!"
Expand All @@ -60,6 +59,8 @@ en:
subject: "Order Received for %{marketplace_name}: %{order_id}"
placed_at: "Received At %{placed_at}"
orders:
index:
link_to: "Order History"
show:
link_to: "Order %{order_id}"
products:
Expand Down
2 changes: 1 addition & 1 deletion app/furniture/marketplace/management_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
) if policy(marketplace.bazaar.tax_rates.new(marketplace: marketplace)).create? %>

<%= render ButtonComponent.new(
label: t('marketplace.tax_rates.index.link_to'),
label: t('marketplace.orders.index.link_to'),
icon: :cart,
href: marketplace.location(child: :orders),
turbo_stream: false, method: :get, scheme: :secondary
Expand Down
18 changes: 18 additions & 0 deletions spec/furniture/marketplace/management_component_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require "rails_helper"

RSpec.describe Marketplace::ManagementComponent, type: :component do
subject(:output) { render_inline(component) }

let(:operator) { create(:person, operator: true) }

let(:component) { described_class.new(marketplace: marketplace, current_person: operator) }
let(:marketplace) { create(:marketplace) }

it { is_expected.to have_selector("a[href='#{polymorphic_path(marketplace.location(child: :products))}']", text: I18n.t("marketplace.products.index.link_to")) }

it { is_expected.to have_selector("a[href='#{polymorphic_path(marketplace.location(child: :delivery_areas))}']", text: I18n.t("marketplace.delivery_areas.index.link_to")) }

it { is_expected.to have_selector("a[href='#{polymorphic_path(marketplace.location(child: :tax_rates))}']", text: I18n.t("marketplace.tax_rates.index.link_to")) }

it { is_expected.to have_selector("a[href='#{polymorphic_path(marketplace.location(child: :orders))}']", text: I18n.t("marketplace.orders.index.link_to")) }
end

0 comments on commit 9a42210

Please sign in to comment.