mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix some filtering test cases for fee report
The calculators of the adjustments related to the enterprise fees created in the test setup have a preferred_amount of 0. So, when computed, the adjustments' amounts end up being `0 = 0 * 1 line_item`. Then, the ReportService filters these out in `#exclude_groups_with_zero_total` from the result set. This is why the assertions can't find them in `totals`.
This commit is contained in:
@@ -517,9 +517,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do
|
||||
let!(:producer_b) { create(:supplier_enterprise, name: "Producer B") }
|
||||
let!(:producer_c) { create(:supplier_enterprise, name: "Producer C") }
|
||||
|
||||
let!(:fee_a) { create(:enterprise_fee, name: "Fee A", enterprise: producer_a) }
|
||||
let!(:fee_b) { create(:enterprise_fee, name: "Fee B", enterprise: producer_b) }
|
||||
let!(:fee_c) { create(:enterprise_fee, name: "Fee C", enterprise: producer_c) }
|
||||
let!(:fee_a) { create(:enterprise_fee, name: "Fee A", enterprise: producer_a, amount: 1) }
|
||||
let!(:fee_b) { create(:enterprise_fee, name: "Fee B", enterprise: producer_b, amount: 1) }
|
||||
let!(:fee_c) { create(:enterprise_fee, name: "Fee C", enterprise: producer_c, amount: 1) }
|
||||
|
||||
let!(:product_a) { create(:product, supplier: producer_a) }
|
||||
let!(:product_b) { create(:product, supplier: producer_b) }
|
||||
@@ -588,9 +588,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do
|
||||
end
|
||||
|
||||
describe "for specified enterprise fees" do
|
||||
let!(:fee_a) { create(:enterprise_fee, name: "Fee A", enterprise: distributor) }
|
||||
let!(:fee_b) { create(:enterprise_fee, name: "Fee B", enterprise: distributor) }
|
||||
let!(:fee_c) { create(:enterprise_fee, name: "Fee C", enterprise: distributor) }
|
||||
let!(:fee_a) { create(:enterprise_fee, name: "Fee A", enterprise: distributor, amount: 1) }
|
||||
let!(:fee_b) { create(:enterprise_fee, name: "Fee B", enterprise: distributor, amount: 1) }
|
||||
let!(:fee_c) { create(:enterprise_fee, name: "Fee C", enterprise: distributor, amount: 1) }
|
||||
|
||||
let!(:variant) { prepare_variant(outgoing_exchange_fees: variant_outgoing_exchange_fees) }
|
||||
let!(:variant_outgoing_exchange_fees) { [fee_a, fee_b, fee_c] }
|
||||
|
||||
Reference in New Issue
Block a user