Skip to content

Commit

Permalink
Wait for modal before testing its content
Browse files Browse the repository at this point in the history
Building off of #5993, a few
more specs required a short wait time to give the modal a chance to
load. They were flaky (failing somewhat regularly in CI, but always
passing locally) and this should help remedy that.
  • Loading branch information
MadelineCollier committed Dec 4, 2024
1 parent f7a1391 commit a25a62a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/spec/features/refund_reasons_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
before do
visit "/admin/refund_reasons/#{query}"
click_on "Add new"
expect(page).to have_selector("dialog")
expect(page).to have_css("dialog", wait: 5)
expect(page).to have_content("New Refund Reason")
expect(page).to be_axe_clean
end
Expand Down Expand Up @@ -66,7 +66,7 @@
Spree::RefundReason.create(name: "Return process")
visit "/admin/refund_reasons#{query}"
find_row("Return process").click
expect(page).to have_selector("dialog")
expect(page).to have_css("dialog", wait: 5)
expect(page).to have_content("Edit Refund Reason")
expect(page).to be_axe_clean
end
Expand Down
4 changes: 2 additions & 2 deletions admin/spec/features/shipping_categories_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
before do
visit "/admin/shipping_categories#{query}"
click_on "Add new"
expect(page).to have_selector("dialog")
expect(page).to have_css("dialog", wait: 5)
expect(page).to have_content("New Shipping Category")
expect(page).to be_axe_clean
end
Expand Down Expand Up @@ -66,7 +66,7 @@
Spree::ShippingCategory.create(name: "Letter Mail")
visit "/admin/shipping_categories#{query}"
find_row("Letter Mail").click
expect(page).to have_selector("dialog")
expect(page).to have_css("dialog", wait: 5)
expect(page).to have_content("Edit Shipping Category")
expect(page).to be_axe_clean
end
Expand Down

0 comments on commit a25a62a

Please sign in to comment.