Move Customers report spec to own file

This commit is contained in:
Maikel Linke
2024-10-16 16:12:35 +11:00
parent 197363b199
commit aa2a5757ec
2 changed files with 25 additions and 22 deletions

View File

@@ -0,0 +1,25 @@
# frozen_string_literal: true
require "system_helper"
RSpec.describe "Customers report" do
include AuthenticationHelper
it "can be rendered" do
login_as_admin
visit admin_reports_path
within "table.index" do
click_link "Customers"
end
run_report
rows = find("table.report__table").all("thead tr")
table = rows.map { |r| r.all("th").map { |c| c.text.strip } }
expect(table.sort).to eq([
["First Name", "Last Name", "Billing Address", "Email", "Phone", "Hub", "Hub Address",
"Shipping Method", "Total Number of Orders", "Total incl. tax ($)",
"Last completed order date"]
].sort)
end
end

View File

@@ -151,28 +151,6 @@ RSpec.describe '
end
end
describe "Can access Customers reports and generate customers report" do
before do
login_as_admin
visit admin_reports_path
end
it "customers report" do
within "table.index" do
click_link "Customers"
end
run_report
rows = find("table.report__table").all("thead tr")
table = rows.map { |r| r.all("th").map { |c| c.text.strip } }
expect(table.sort).to eq([
["First Name", "Last Name", "Billing Address", "Email", "Phone", "Hub", "Hub Address",
"Shipping Method", "Total Number of Orders", "Total incl. tax ($)",
"Last completed order date"]
].sort)
end
end
describe "Order cycle management report" do
before do
login_as_admin