mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-17 04:34:24 +00:00
Consolidate translations for hidden field
The string '< Hidden >' was agreed on as a good default, so we will use the hidden_field key. I also moved the definition in en.yml up to the more general area at the start of admin.reports section (before it was hidden between report-specific keys.
This commit is contained in:
@@ -133,7 +133,7 @@ module Reporting
|
||||
|
||||
it "shows line items supplied by my producers, with names hidden" do
|
||||
expect(subject.table_items).to eq([li2])
|
||||
expect(subject.table_items.first.order.bill_address.firstname).to eq("HIDDEN")
|
||||
expect(subject.table_items.first.order.bill_address.firstname).to eq("< Hidden >")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ RSpec.describe Reporting::LineItems do
|
||||
|
||||
it 'returns masked data' do
|
||||
line_items = reports_line_items.list
|
||||
expect(line_items.first.order.email).to eq('HIDDEN')
|
||||
expect(line_items.first.order.email).to eq("< Hidden >")
|
||||
end
|
||||
|
||||
context "when filtering by product" do
|
||||
|
||||
@@ -120,7 +120,7 @@ RSpec.describe Reporting::Reports::OrdersAndDistributors::Base do
|
||||
it "shows line items supplied by my producers, with contact details hidden" do
|
||||
expect(row).not_to include("FirstName LastName")
|
||||
expect(row).not_to include("123-456", "City", order.email)
|
||||
expect(row[2..5]).to eq ["HIDDEN", "HIDDEN", "", ""]
|
||||
expect(row[2..5]).to eq ["< Hidden >", "< Hidden >", "", ""]
|
||||
end
|
||||
|
||||
context "where the distributor allows suppliers to see customer names" do
|
||||
@@ -131,7 +131,7 @@ RSpec.describe Reporting::Reports::OrdersAndDistributors::Base do
|
||||
it "shows line items supplied by my producers, with only contact names shown" do
|
||||
expect(row).to include("FirstName LastName")
|
||||
expect(row).not_to include("123-456", "City", order.email)
|
||||
expect(row[2..5]).to eq [bill_address.full_name, "HIDDEN", "", ""]
|
||||
expect(row[2..5]).to eq [bill_address.full_name, "< Hidden >", "", ""]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -142,7 +142,7 @@ RSpec.describe Reporting::Reports::OrdersAndDistributors::Base do
|
||||
|
||||
it "shows line items supplied by my producers, with only contact details shown" do
|
||||
expect(row).not_to include("FirstName LastName", "City")
|
||||
expect(row[2..5]).to eq ["HIDDEN", order.email, "123-456", ""]
|
||||
expect(row[2..5]).to eq ["< Hidden >", order.email, "123-456", ""]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,11 +12,11 @@ RSpec.describe Orders::MaskDataService do
|
||||
described_class.new(order).call
|
||||
|
||||
expect(order.bill_address.attributes).to include(
|
||||
'firstname' => 'HIDDEN',
|
||||
'firstname' => "< Hidden >",
|
||||
'lastname' => ''
|
||||
)
|
||||
expect(order.ship_address.attributes).to include(
|
||||
'firstname' => 'HIDDEN',
|
||||
'firstname' => "< Hidden >",
|
||||
'lastname' => ''
|
||||
)
|
||||
end
|
||||
@@ -29,7 +29,7 @@ RSpec.describe Orders::MaskDataService do
|
||||
expect(order.bill_address.attributes).to include('phone' => '')
|
||||
expect(order.ship_address.attributes).to include('phone' => '')
|
||||
|
||||
expect(order.email).to eq('HIDDEN')
|
||||
expect(order.email).to eq("< Hidden >")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,11 +65,11 @@ RSpec.describe Orders::MaskDataService do
|
||||
described_class.new(order).call
|
||||
|
||||
expect(order.bill_address.attributes).not_to include(
|
||||
firstname: 'HIDDEN',
|
||||
firstname: "< Hidden >",
|
||||
lastname: ''
|
||||
)
|
||||
expect(order.ship_address.attributes).not_to include(
|
||||
firstname: 'HIDDEN',
|
||||
firstname: "< Hidden >",
|
||||
lastname: ''
|
||||
)
|
||||
end
|
||||
@@ -95,7 +95,7 @@ RSpec.describe Orders::MaskDataService do
|
||||
expect(order.bill_address.attributes).not_to include('phone' => '')
|
||||
expect(order.ship_address.attributes).not_to include('phone' => '')
|
||||
|
||||
expect(order.email).not_to eq('HIDDEN')
|
||||
expect(order.email).not_to eq("< Hidden >")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user