Skip to content

Commit

Permalink
Merge pull request #5998 from MadelineCollier/fix/flaky-modal-specs
Browse files Browse the repository at this point in the history
[specs] Wait for modal before testing its content
  • Loading branch information
MadelineCollier authored Dec 4, 2024
2 parents e2f5282 + a25a62a commit 81c605c
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 81c605c

Please sign in to comment.