diff --git a/jest.config.js b/jest.config.js index 513257c467..2e451b9051 100644 --- a/jest.config.js +++ b/jest.config.js @@ -179,7 +179,7 @@ module.exports = { // transform: { "\\.[jt]sx?$": "babel-jest" }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation - transformIgnorePatterns: ["/node_modules/(?!(stimulus|tom-select)/)"], + transformIgnorePatterns: ["/node_modules/(?!(stimulus.+|tom-select)/)"], // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them // unmockedModulePathPatterns: undefined, 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 002e0a7247..2218908fac 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 @@ -296,11 +296,8 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do end it "should filter by distributor and order cycle" do - page.find("#s2id_autogen1").click - find('li', text: distributor.name).click # selects Distributor - - page.find("#s2id_q_order_cycle_id_in").click - find('li', text: order_cycle.name).click + tomselect_multiselect distributor.name, from: 'q[distributor_id_in][]' + tomselect_multiselect order_cycle.name, from: 'q[order_cycle_id_in][]' run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -455,9 +452,6 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do } context "filtering" do - let(:fee_name_selector){ "#s2id_q_enterprise_fee_id_in" } - let(:fee_owner_selector){ "#s2id_q_enterprise_fee_owner_id_in" } - let(:summary_row_after_filtering_by_fee_name){ [cost_of_produce1, "TOTAL", "120.0", "4.8", "124.8"].join(" ") } @@ -471,11 +465,8 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do end it "should filter by distributor and order cycle" do - page.find("#s2id_autogen1").click - find('li', text: distributor.name).click # selects Distributor - - page.find("#s2id_q_order_cycle_id_in").click - find('li', text: order_cycle3.name).click + tomselect_multiselect distributor.name, from: 'q[distributor_id_in][]' + tomselect_multiselect order_cycle3.name, from: 'q[order_cycle_id_in][]' run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -504,8 +495,7 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do end it "should filter by producer" do - page.find("#s2id_supplier_id_in").click - find('li', text: supplier2.name).click + tomselect_multiselect supplier2.name, from: 'supplier_id_in[]' run_report expect(page.find("table.report__table thead tr")).to have_content(table_header) @@ -528,8 +518,7 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do end it "should filter by fee name" do - page.find(fee_name_selector).click - find('li', text: supplier_fees.name).click + tomselect_multiselect supplier_fees.name, from: 'q[enterprise_fee_id_in][]' run_report @@ -557,8 +546,7 @@ RSpec.describe "Enterprise Summary Fee with Tax Report By Producer" do end it "should filter by fee owner" do - page.find(fee_owner_selector).click - find('li', text: supplier.name).click + tomselect_multiselect supplier.name, from: 'q[enterprise_fee_owner_id_in][]' run_report expect(page.find("table.report__table thead tr")).to have_content(table_header)