Stabilise flaky assertion on PDF text

The PDF reader can't always place text elements in the right place. So
something that should be in one line can be in multiple lines and those
lines can be in a different order. I'm asserting the moving parts
separately as done in other places of this spec.
This commit is contained in:
Maikel Linke
2023-08-02 13:14:28 +10:00
parent 1b6eeb0928
commit efbf1d6b8f

View File

@@ -212,7 +212,9 @@ describe '
end
it "displays $0.00 when a line item has no tax" do
expect(page).to have_content "#{Spree::Product.first.name} (1g) 1 $0.00 $12.54"
expect(page).to have_content Spree::Product.first.name
expect(page).to have_content "(1g)"
expect(page).to have_content "1 $0.00 $12.54"
end
it "displays the taxes correctly" do
@@ -343,7 +345,9 @@ describe '
convert_pdf_to_page
end
it "displays $0.0 when a line item has no tax" do
expect(page).to have_content "#{Spree::Product.first.name} (1g) 1 $0.00 $12.54"
expect(page).to have_content Spree::Product.first.name
expect(page).to have_content "(1g)"
expect(page).to have_content "1 $0.00 $12.54"
end
it "displays the added tax on the GST colum" do