From d1c73f86c0282df5127024ea83b60b3a6dc28f77 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 1 Dec 2023 09:27:58 +1100 Subject: [PATCH] Update specs for background reports --- spec/base_spec_helper.rb | 1 - ...ry_fee_with_tax_report_by_producer_spec.rb | 24 +++++++------------ 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index a2c6776ec3..d0da65f9a8 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -98,7 +98,6 @@ RSpec.configure do |config| Flipper.disable(:background_reports) if example.file_path.in?( [ # rubocop:disable Layout/LineLength - "./spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb", "./spec/system/admin/reports/orders_and_fulfillment_spec.rb", "./spec/system/admin/reports/packing_report_spec.rb", "./spec/system/admin/reports/payments_report_spec.rb", diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb index 8fb6731421..b85a67b156 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb @@ -277,7 +277,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do context "with line items from a single supplier" do it 'generates the report and displays fees for the respective suppliers' do visit_report - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -313,8 +313,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do page.find("#s2id_q_order_cycle_id_in").click find('li', text: order_cycle.name).click - expect(page).to have_button("Go") - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) table = page.find("table.report__table tbody") @@ -489,8 +488,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do page.find("#s2id_q_order_cycle_id_in").click find('li', text: order_cycle3.name).click - expect(page).to have_button("Go") - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) table = page.find("table.report__table tbody") @@ -520,8 +518,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do page.find("#s2id_supplier_id_in").click find('li', text: supplier2.name).click - expect(page).to have_button("Go") - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) table = page.find("table.report__table tbody") @@ -545,8 +542,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do page.find(fee_name_selector).click find('li', text: supplier_fees.name).click - expect(page).to have_button("Go") - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -575,8 +571,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do page.find(fee_owner_selector).click find('li', text: supplier.name).click - expect(page).to have_button("Go") - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) table = page.find("table.report__table tbody") @@ -690,7 +685,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do context "with line items from a single supplier" do it 'generates the report and displays fees for the respective suppliers' do visit_report - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -828,7 +823,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do it 'should list all the tax rates' do visit_report - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -923,7 +918,7 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do it 'should list all the tax rates' do visit_report - click_on "Go" + run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -951,6 +946,5 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do report_type: :enterprise_fee_summary, report_subtype: :enterprise_fees_with_tax_report_by_producer ) - expect(page).to have_button("Go") end end