Update specs for background reports

This commit is contained in:
Maikel Linke
2023-11-30 16:20:10 +11:00
parent 0b7cf86b5b
commit 049df77558
3 changed files with 11 additions and 5 deletions

View File

@@ -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_order_spec.rb",
"./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",
@@ -255,4 +254,5 @@ RSpec.configure do |config|
config.include Features::DatepickerHelper, type: :system
config.include Features::TrixEditorHelper, type: :system
config.include DownloadsHelper, type: :system
config.include ReportsHelper, type: :system
end

View File

@@ -0,0 +1,8 @@
# frozen_string_literal: true
module ReportsHelper
def run_report
click_on "Go"
perform_enqueued_jobs(only: ReportJob)
end
end

View File

@@ -163,8 +163,7 @@ describe "Enterprise Summary Fee with Tax Report By Order" do
visit admin_reports_path
click_on I18n.t("admin.reports.enterprise_fees_with_tax_report_by_order")
expect(page).to have_button("Go")
click_on "Go"
run_report
expect(page.find("table.report__table thead tr").text).to have_content(table_header)
@@ -242,8 +241,7 @@ describe "Enterprise Summary Fee with Tax Report By Order" do
visit admin_reports_path
click_on I18n.t("admin.reports.enterprise_fees_with_tax_report_by_order")
expect(page).to have_button("Go")
click_on "Go"
run_report
expect(page.find("table.report__table thead tr").text).to have_content(table_header)