From fc73d8cd4a4df887a151e89d61567a049ccd9fdc Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 11 Mar 2025 17:02:48 +1100 Subject: [PATCH] Ensure we test for the right text after AJAX loads filters --- spec/system/consumer/caching/shops_caching_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/system/consumer/caching/shops_caching_spec.rb b/spec/system/consumer/caching/shops_caching_spec.rb index d9cda44d54..312615bd90 100644 --- a/spec/system/consumer/caching/shops_caching_spec.rb +++ b/spec/system/consumer/caching/shops_caching_spec.rb @@ -83,8 +83,11 @@ RSpec.describe "Shops caching", caching: true do it "caches rendered response for taxons and properties, with the provided options" do visit enterprise_shop_path(distributor) - expect(page).to have_content "Cached Taxon" - expect(page).to have_content "Cached Property" + # Ensure we test for the right text after AJAX loads filters: + within(".sticky-shop-filters-container", text: "Filter by") do + expect(page).to have_content "Cached Taxon" + expect(page).to have_content "Cached Property" + end expect_cached taxons_key, options expect_cached properties_key, options